]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-136852: Emscripten: Add PYTHON_NODE_VERSION environment variable (GH-136853...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 21 Jul 2025 09:58:57 +0000 (11:58 +0200)
committerGitHub <noreply@github.com>
Mon, 21 Jul 2025 09:58:57 +0000 (11:58 +0200)
To choose the node version we use. Together with:
https://github.com/python/buildmaster-config/pull/614
closes GH-136852.
(cherry picked from commit aec7f5f8b2e8b5e02869cdb4e1f8a9ef87c9f953)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
Tools/wasm/emscripten/__main__.py

index c0d58aeaadd2cf89ba2d59182d2f927ac6a91b53..1b31e36dd890b3265cf512f259d0d7cbdadd6391 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.strip()
     pkg_config_path_dir = (PREFIX_DIR / "lib/pkgconfig/").resolve()
     env_additions = {
         "CONFIG_SITE": config_site,