From 0aaf7e5e96a8e1125f557460ec0a3609b2bce484 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Tue, 27 Oct 2026 17:04:16 -0700 Subject: [PATCH 1/3] Add a `release` command --- Platforms/WASI/README.md | 12 +++++++++++- Platforms/WASI/__main__.py | 15 ++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Platforms/WASI/README.md b/Platforms/WASI/README.md index e56645b4db24c1..18eb7fc03be410 100644 --- a/Platforms/WASI/README.md +++ b/Platforms/WASI/README.md @@ -132,7 +132,7 @@ python3 Platforms/WASI build --quiet --logdir cross-build/logs ``` -### Packaging +### Releasing The `package` command is used to gather all the files necessary to make a release and place them in an archive: @@ -158,6 +158,16 @@ existing `dist/` directory before gathering files. There is no command just to archive the gathered files. +To do a release build from `build` to `package`, you can use the `release` +command: + +``shell +python3 Platforms/WASI release +``` + +Any release-specific build flags will be set via `release`. It will also run +`clean`. + ### Paths diff --git a/Platforms/WASI/__main__.py b/Platforms/WASI/__main__.py index dc1df16f829efe..8ac6013dd2a8b1 100644 --- a/Platforms/WASI/__main__.py +++ b/Platforms/WASI/__main__.py @@ -71,6 +71,8 @@ def main(): gather = subcommands.add_parser( "gather", help="Gather all the files for distribution" ) + release = subcommands.add_parser("release", + help="Build and package for a release") path = subcommands.add_parser( "path", help="Print the path to a build or distribution directory" ) @@ -94,6 +96,7 @@ def main(): make_host, pythoninfo_host, build_host, + release, ): subcommand.add_argument( "--quiet", @@ -133,7 +136,7 @@ def main(): subcommand.add_argument( "args", nargs="*", help="Extra arguments to pass to `configure`" ) - for subcommand in build, configure_host, build_host: + for subcommand in build, configure_host, build_host, release: subcommand.add_argument( "--wasi-sdk", type=pathlib.Path, @@ -160,6 +163,7 @@ def main(): gather, package, path, + release, ): subcommand.add_argument( "--host-triple", @@ -211,6 +215,15 @@ def main(): case "package": _package.gather(context) _package.archive(context) + case "release": + context.args = ["--without-static-libpython"] + _build.clean_contents(context) + _build.configure_build_python(context) + _build.make_build_python(context) + _build.configure_wasi_python(context) + _build.make_wasi_python(context) + _package.gather(context) + _package.archive(context) case "path": paths = { "build-python": "build_python_path", From a85275864c005096751af7a4b8277a3119cd1a98 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Tue, 27 Oct 2026 17:09:15 -0700 Subject: [PATCH 2/3] `ruff format` --- Platforms/WASI/__main__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Platforms/WASI/__main__.py b/Platforms/WASI/__main__.py index 8ac6013dd2a8b1..ee9e0f6de36438 100644 --- a/Platforms/WASI/__main__.py +++ b/Platforms/WASI/__main__.py @@ -71,8 +71,9 @@ def main(): gather = subcommands.add_parser( "gather", help="Gather all the files for distribution" ) - release = subcommands.add_parser("release", - help="Build and package for a release") + release = subcommands.add_parser( + "release", help="Build and package for a release" + ) path = subcommands.add_parser( "path", help="Print the path to a build or distribution directory" ) From 99baf350f4a7e6f49b4c2c0b0091f8ca319cdf31 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Wed, 28 Oct 2026 12:30:21 -0700 Subject: [PATCH 3/3] Apply suggestion from @savannahostrowski Co-authored-by: Savannah Ostrowski --- Platforms/WASI/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platforms/WASI/README.md b/Platforms/WASI/README.md index 18eb7fc03be410..5fe610615aec33 100644 --- a/Platforms/WASI/README.md +++ b/Platforms/WASI/README.md @@ -161,7 +161,7 @@ There is no command just to archive the gathered files. To do a release build from `build` to `package`, you can use the `release` command: -``shell +```shell python3 Platforms/WASI release ```