Skip to content

fix(nodeenv): ignore source trees during prebuilt installs - #450

Open
fly1d wants to merge 1 commit into
ekalinin:masterfrom
fly1d:fix/prebuilt-source-cache
Open

fly1d wants to merge 1 commit into
ekalinin:masterfrom
fly1d:fix/prebuilt-source-cache

Conversation

@fly1d

@fly1d fly1d commented Oct 28, 2026 •

Copy link
Copy Markdown

--prebuilt currently treats a cached source tree as a completed binary download. After a failed --source build it copies that tree into the environment; when both source and prebuilt trees remain, copying fails with multiple glob matches.

Keep source reuse for source builds, and require the version's trailing - when locating a prebuilt tree. Existing binary downloads and the arm64-to-x64 fallback keep their current behavior.

Fixes #443.

  • Tests cover the change, including source/binary cache combinations, platform layouts, version prefixes and x64 fallback with real directory copying

  • CHANGES has an unreleased entry

  • README.rst: no documentation change needed

  • Title uses type(scope): subject

  • tox -e py314 passes: 401 passed, 29 skipped, 11 integration tests deselected; flake8 passed

The focused regression set fails 5 of 9 cases on unchanged master and passes all 9 with the fix. Five independent CLI scenarios using local HTTP and stub archives pass, including a failed source build followed by prebuilt installation, both trees retained, source cache reuse and a real HTTP 404 triggering the x64 fallback. These exercise installation, activation and HTTP fallback with controlled archives.

Two further installation passes on macOS arm64 used the official Node.js 24.0.0 archive, verified against its published SHA256. With a seeded source-cache directory, the original code failed before creating bin/activate; the fix installed and ran Node.js 24.0.0 and bundled npm 11.3.0 from the target environment. --no-clean-src retained both trees without copying the source marker into the environment root; a subsequent --force --prebuilt --clean-src installation removed src and left Node/npm working. This checks a real native binary distribution; Node.js source compilation was not exercised.

#447 touches the same glob line to escape literal path characters. An isolated combination retaining both changes passed 18 focused cases and the same five CLI scenarios with brackets in the temporary path. The shared line will need to retain both glob.escape and -* when the changes are combined.

This branch has not been deployed

No deployments
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.

--prebuilt picks up a source tree left in src/

1 participant