From 88fba6915faf89a21148a6eeb4d1389462c40201 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Sun, 24 Jul 2022 15:45:51 +0200 Subject: [PATCH 1/9] gh-95205: Improve wasm README --- Tools/wasm/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tools/wasm/README.md b/Tools/wasm/README.md index 40f23a396f6711..fc59295b8e4eec 100644 --- a/Tools/wasm/README.md +++ b/Tools/wasm/README.md @@ -23,6 +23,8 @@ to a repository checkout. Christian Heimes maintains a container image with Emscripten SDK, Python build dependencies, WASI-SDK, wasmtime, and several additional tools. +From within your local CPython repo fork, run one of the following commands: + ``` # Fedora, RHEL, CentOS podman run --rm -ti -v $(pwd):/python-wasm/cpython:Z quay.io/tiran/cpythonbuild:emsdk3 @@ -36,7 +38,7 @@ docker run --rm -ti -v $(pwd):/python-wasm/cpython quay.io/tiran/cpythonbuild:em ```shell mkdir -p builddir/build pushd builddir/build -../../configure -C +../../cpython/configure -C make -j$(nproc) popd ``` From 257863d0daa8f7b15b9a414fbd89f92cece2355e Mon Sep 17 00:00:00 2001 From: Erlend Egeberg Aasland Date: Sun, 24 Jul 2022 15:47:36 +0200 Subject: [PATCH 2/9] Update Tools/wasm/README.md --- Tools/wasm/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/wasm/README.md b/Tools/wasm/README.md index fc59295b8e4eec..acb2730c33d22f 100644 --- a/Tools/wasm/README.md +++ b/Tools/wasm/README.md @@ -23,7 +23,7 @@ to a repository checkout. Christian Heimes maintains a container image with Emscripten SDK, Python build dependencies, WASI-SDK, wasmtime, and several additional tools. -From within your local CPython repo fork, run one of the following commands: +From within your local CPython repo clone, run one of the following commands: ``` # Fedora, RHEL, CentOS From 730e90ef3e2bb758aab28bca51011186b12c269e Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Sun, 24 Jul 2022 16:01:31 +0200 Subject: [PATCH 3/9] Make it explicit that we're building from within the container --- Tools/wasm/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Tools/wasm/README.md b/Tools/wasm/README.md index acb2730c33d22f..598cac1cf1de8b 100644 --- a/Tools/wasm/README.md +++ b/Tools/wasm/README.md @@ -35,6 +35,8 @@ docker run --rm -ti -v $(pwd):/python-wasm/cpython quay.io/tiran/cpythonbuild:em ### Compile a build Python interpreter +From within the container, run the following commands: + ```shell mkdir -p builddir/build pushd builddir/build From 61a1f6c6b0b1439b3a9e57e2757c84d5fffb1505 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Sun, 24 Jul 2022 18:20:10 +0200 Subject: [PATCH 4/9] Fix paths for browser/node builds; more explicitness --- Tools/wasm/README.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Tools/wasm/README.md b/Tools/wasm/README.md index 598cac1cf1de8b..3eedc6d8b0ad09 100644 --- a/Tools/wasm/README.md +++ b/Tools/wasm/README.md @@ -33,6 +33,10 @@ podman run --rm -ti -v $(pwd):/python-wasm/cpython:Z quay.io/tiran/cpythonbuild: docker run --rm -ti -v $(pwd):/python-wasm/cpython quay.io/tiran/cpythonbuild:emsdk3 ``` +Note that when you exit the container, all work will be lost. +See the `podman` or `docker` docs for how to preserve the container environment +across runs. + ### Compile a build Python interpreter From within the container, run the following commands: @@ -57,10 +61,10 @@ embuilder build zlib bzip2 mkdir -p builddir/emscripten-browser pushd builddir/emscripten-browser -CONFIG_SITE=../../Tools/wasm/config.site-wasm32-emscripten \ - emconfigure ../../configure -C \ +CONFIG_SITE=../../cpython/Tools/wasm/config.site-wasm32-emscripten \ + emconfigure ../../cpython/configure -C \ --host=wasm32-unknown-emscripten \ - --build=$(../../config.guess) \ + --build=$(../../cpython/config.guess) \ --with-emscripten-target=browser \ --with-build-python=$(pwd)/../build/python @@ -90,10 +94,10 @@ and header files with debug builds. mkdir -p builddir/emscripten-node pushd builddir/emscripten-node -CONFIG_SITE=../../Tools/wasm/config.site-wasm32-emscripten \ - emconfigure ../../configure -C \ +CONFIG_SITE=../../cpython/Tools/wasm/config.site-wasm32-emscripten \ + emconfigure ../../cpython/configure -C \ --host=wasm32-unknown-emscripten \ - --build=$(../../config.guess) \ + --build=$(../../cpython/config.guess) \ --with-emscripten-target=node \ --with-build-python=$(pwd)/../build/python From 330ca5ef4ac798d057b53210fdb9907f70040d76 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Sun, 24 Jul 2022 18:40:32 +0200 Subject: [PATCH 5/9] Don't reuse configure cache in container --- Tools/wasm/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tools/wasm/README.md b/Tools/wasm/README.md index 3eedc6d8b0ad09..9116b44a355b5c 100644 --- a/Tools/wasm/README.md +++ b/Tools/wasm/README.md @@ -44,7 +44,7 @@ From within the container, run the following commands: ```shell mkdir -p builddir/build pushd builddir/build -../../cpython/configure -C +../../cpython/configure make -j$(nproc) popd ``` @@ -62,7 +62,7 @@ mkdir -p builddir/emscripten-browser pushd builddir/emscripten-browser CONFIG_SITE=../../cpython/Tools/wasm/config.site-wasm32-emscripten \ - emconfigure ../../cpython/configure -C \ + emconfigure ../../cpython/configure \ --host=wasm32-unknown-emscripten \ --build=$(../../cpython/config.guess) \ --with-emscripten-target=browser \ @@ -95,7 +95,7 @@ mkdir -p builddir/emscripten-node pushd builddir/emscripten-node CONFIG_SITE=../../cpython/Tools/wasm/config.site-wasm32-emscripten \ - emconfigure ../../cpython/configure -C \ + emconfigure ../../cpython/configure \ --host=wasm32-unknown-emscripten \ --build=$(../../cpython/config.guess) \ --with-emscripten-target=node \ From 87e3f1b400c30268ac96279df0a97fc71622acdf Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Sun, 24 Jul 2022 19:03:49 +0200 Subject: [PATCH 6/9] Revert "Don't reuse configure cache in container" This reverts commit 330ca5ef4ac798d057b53210fdb9907f70040d76. --- Tools/wasm/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tools/wasm/README.md b/Tools/wasm/README.md index 9116b44a355b5c..3eedc6d8b0ad09 100644 --- a/Tools/wasm/README.md +++ b/Tools/wasm/README.md @@ -44,7 +44,7 @@ From within the container, run the following commands: ```shell mkdir -p builddir/build pushd builddir/build -../../cpython/configure +../../cpython/configure -C make -j$(nproc) popd ``` @@ -62,7 +62,7 @@ mkdir -p builddir/emscripten-browser pushd builddir/emscripten-browser CONFIG_SITE=../../cpython/Tools/wasm/config.site-wasm32-emscripten \ - emconfigure ../../cpython/configure \ + emconfigure ../../cpython/configure -C \ --host=wasm32-unknown-emscripten \ --build=$(../../cpython/config.guess) \ --with-emscripten-target=browser \ @@ -95,7 +95,7 @@ mkdir -p builddir/emscripten-node pushd builddir/emscripten-node CONFIG_SITE=../../cpython/Tools/wasm/config.site-wasm32-emscripten \ - emconfigure ../../cpython/configure \ + emconfigure ../../cpython/configure -C \ --host=wasm32-unknown-emscripten \ --build=$(../../cpython/config.guess) \ --with-emscripten-target=node \ From cdc38e54618f289ef0c91e3abe21dfe6b772dde6 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Sun, 24 Jul 2022 19:47:09 +0200 Subject: [PATCH 7/9] Revert path change; explicitly specify working dir instead --- Tools/wasm/README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Tools/wasm/README.md b/Tools/wasm/README.md index 3eedc6d8b0ad09..6717cb236b6d54 100644 --- a/Tools/wasm/README.md +++ b/Tools/wasm/README.md @@ -27,10 +27,10 @@ From within your local CPython repo clone, run one of the following commands: ``` # Fedora, RHEL, CentOS -podman run --rm -ti -v $(pwd):/python-wasm/cpython:Z quay.io/tiran/cpythonbuild:emsdk3 +podman run --rm -ti -v $(pwd):/python-wasm/cpython:Z -w /python-wasm/cpython quay.io/tiran/cpythonbuild:emsdk3 # other -docker run --rm -ti -v $(pwd):/python-wasm/cpython quay.io/tiran/cpythonbuild:emsdk3 +docker run --rm -ti -v $(pwd):/python-wasm/cpython -w /python-wasm/cpython quay.io/tiran/cpythonbuild:emsdk3 ``` Note that when you exit the container, all work will be lost. @@ -44,7 +44,7 @@ From within the container, run the following commands: ```shell mkdir -p builddir/build pushd builddir/build -../../cpython/configure -C +../../configure -C make -j$(nproc) popd ``` @@ -61,10 +61,10 @@ embuilder build zlib bzip2 mkdir -p builddir/emscripten-browser pushd builddir/emscripten-browser -CONFIG_SITE=../../cpython/Tools/wasm/config.site-wasm32-emscripten \ - emconfigure ../../cpython/configure -C \ +CONFIG_SITE=../../Tools/wasm/config.site-wasm32-emscripten \ + emconfigure ../../configure -C \ --host=wasm32-unknown-emscripten \ - --build=$(../../cpython/config.guess) \ + --build=$(../../config.guess) \ --with-emscripten-target=browser \ --with-build-python=$(pwd)/../build/python @@ -94,10 +94,10 @@ and header files with debug builds. mkdir -p builddir/emscripten-node pushd builddir/emscripten-node -CONFIG_SITE=../../cpython/Tools/wasm/config.site-wasm32-emscripten \ - emconfigure ../../cpython/configure -C \ +CONFIG_SITE=../../Tools/wasm/config.site-wasm32-emscripten \ + emconfigure ../../configure -C \ --host=wasm32-unknown-emscripten \ - --build=$(../../cpython/config.guess) \ + --build=$(../../config.guess) \ --with-emscripten-target=node \ --with-build-python=$(pwd)/../build/python From 7db408ceb6b2c0c9e7859ea1b63d1a3ca76693e8 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Sun, 24 Jul 2022 20:42:00 +0200 Subject: [PATCH 8/9] Specify what's lost --- Tools/wasm/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tools/wasm/README.md b/Tools/wasm/README.md index 6717cb236b6d54..05a4306fbd4b93 100644 --- a/Tools/wasm/README.md +++ b/Tools/wasm/README.md @@ -33,7 +33,8 @@ podman run --rm -ti -v $(pwd):/python-wasm/cpython:Z -w /python-wasm/cpython qua docker run --rm -ti -v $(pwd):/python-wasm/cpython -w /python-wasm/cpython quay.io/tiran/cpythonbuild:emsdk3 ``` -Note that when you exit the container, all work will be lost. +Note that when you exit the container, all work outside the mounted cpython +directory will be lost. See the `podman` or `docker` docs for how to preserve the container environment across runs. From 7364a94e49cf5736c8052e17c5f9a0879e3df63b Mon Sep 17 00:00:00 2001 From: Erlend Egeberg Aasland Date: Sun, 24 Jul 2022 21:21:50 +0200 Subject: [PATCH 9/9] Update Tools/wasm/README.md --- Tools/wasm/README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Tools/wasm/README.md b/Tools/wasm/README.md index 05a4306fbd4b93..b9d773b2269599 100644 --- a/Tools/wasm/README.md +++ b/Tools/wasm/README.md @@ -33,11 +33,6 @@ podman run --rm -ti -v $(pwd):/python-wasm/cpython:Z -w /python-wasm/cpython qua docker run --rm -ti -v $(pwd):/python-wasm/cpython -w /python-wasm/cpython quay.io/tiran/cpythonbuild:emsdk3 ``` -Note that when you exit the container, all work outside the mounted cpython -directory will be lost. -See the `podman` or `docker` docs for how to preserve the container environment -across runs. - ### Compile a build Python interpreter From within the container, run the following commands: