Skip to content

[bootstrap] Honor EMSDK_NODE in bootstrap.py - #27617

Merged
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:bootstrap-emsdk-node
Aug 29, 2026
Merged

[bootstrap] Honor EMSDK_NODE in bootstrap.py#27617
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:bootstrap-emsdk-node

Conversation

@sbc100

@sbc100 sbc100 commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

When EMSDK_NODE is present in the environment, prepend its directory to PATH before running bootstrap actions.

By default, emsdk avoids prepending its own node binary to PATH if a system node is already present in PATH. However, bootstrap actions (such as npm ci) may fail if the system node is an older incompatible version or lacks npm.

See: #27614

@sbc100
sbc100 requested a review from kripken August 28, 2026 21:24
@sbc100
sbc100 force-pushed the bootstrap-emsdk-node branch from 90b8dda to d4e27ff Compare August 28, 2026 21:30
@sbc100
sbc100 requested a review from dschuff August 28, 2026 21:30
When `EMSDK_NODE` is present in the environment, prepend its directory
to `PATH` before running bootstrap actions.

By default, emsdk avoids prepending its own node binary to `PATH` if a
system node is already present in `PATH`. However, bootstrap actions
(such as `npm ci`) may fail if the system node is an older incompatible
version or lacks npm.

See: emscripten-core#27614
@sbc100
sbc100 force-pushed the bootstrap-emsdk-node branch from d4e27ff to b0c7e62 Compare August 28, 2026 22:14
@sbc100
sbc100 enabled auto-merge (squash) August 28, 2026 22:54
@kripken

kripken commented Aug 28, 2026

Copy link
Copy Markdown
Member

I don't follow, why are bootstrap actions special? That is, the same reasoning suggests this could help non-bootstrap situations too?

@sbc100

sbc100 commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator Author

I don't follow, why are bootstrap actions special? That is, the same reasoning suggests this could help non-bootstrap situations too?

I tried to explain the comment but maybe its not clear. Non-bootstrap tools get NODE_JS from the config file. In this case we likely don't have a config file (See the comment at the top of bootstrap.py about why we cannot include shared.py) so we are using node (npm) form the PATH instead.

However, we do really want to use the same version of node that we have in the config file when we run npm ci since that is the version of node that we end up using the node_modules directory here in the emscripten directory.

@sbc100
sbc100 merged commit f4d9d9c into emscripten-core:main Aug 29, 2026
42 checks passed
@sbc100
sbc100 deleted the bootstrap-emsdk-node branch August 29, 2026 00:25
@sbc100

sbc100 commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator Author

Sorry, the auto-merge landed before you got a change to approve @kripken

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants