]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-136852: Emscripten: Add PYTHON_NODE_VERSION environment variable (#136853)
authorHood Chatham <roberthoodchatham@gmail.com>
Sun, 20 Jul 2025 22:30:35 +0000 (00:30 +0200)
committerGitHub <noreply@github.com>
Sun, 20 Jul 2025 22:30:35 +0000 (00:30 +0200)
To choose the node version we use. Together with:
https://github.com/python/buildmaster-config/pull/614
closes #136852.

Tools/wasm/emscripten/__main__.py

index dc8422420a564c5da43af4d70ebb9e490d2dc588..24b989f75f7b2be1b3649f8b98efc18f1c2e5150 100644 (file)
@@ -206,6 +206,17 @@ def configure_emscripten_python(context, working_dir):
         sysconfig_data += "-pydebug"
 
     host_runner = context.host_runner
+    if node_version := os.environ.get("PYTHON_NODE_VERSION", None):
+        res = subprocess.run(
+            [
+                "bash",
+                "-c",
+                f"source ~/.nvm/nvm.sh && nvm which {node_version}",
+            ],
+            text=True,
+            capture_output=True,
+        )
+        host_runner = res.stdout
     pkg_config_path_dir = (PREFIX_DIR / "lib/pkgconfig/").resolve()
     env_additions = {
         "CONFIG_SITE": config_site,