Skip to content

Commit aec7f5f

Browse files
authored
gh-136852: Emscripten: Add PYTHON_NODE_VERSION environment variable (#136853)
To choose the node version we use. Together with: python/buildmaster-config#614 closes #136852.
1 parent acbe896 commit aec7f5f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Tools/wasm/emscripten/__main__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,17 @@ def configure_emscripten_python(context, working_dir):
206206
sysconfig_data += "-pydebug"
207207

208208
host_runner = context.host_runner
209+
if node_version := os.environ.get("PYTHON_NODE_VERSION", None):
210+
res = subprocess.run(
211+
[
212+
"bash",
213+
"-c",
214+
f"source ~/.nvm/nvm.sh && nvm which {node_version}",
215+
],
216+
text=True,
217+
capture_output=True,
218+
)
219+
host_runner = res.stdout
209220
pkg_config_path_dir = (PREFIX_DIR / "lib/pkgconfig/").resolve()
210221
env_additions = {
211222
"CONFIG_SITE": config_site,

0 commit comments

Comments
 (0)