Repository navigation
sea: mount vfsArchive at layer 0 and in workers - #66709
Open
pipobscure wants to merge 2 commits into
Open
pipobscure wants to merge 2 commits into
pipobscure wants to merge 2 commits into
Conversation
A single executable application built with "vfsArchive" mounted its archive at the next free layer, like any file system a program mounts itself, and only in the main thread. A worker had no mount at all, so a path into the archive, such as the main script's __filename, could not be loaded there. Mount the archive at the layer reserved for --vfs-load instead, so it is at the same mount point in every thread, and mount it in each worker as well, with the main script placed at its root just as in the main thread. The worker reads the main script through a new getMainCode() binding, since no main script is handed to it. Unlike the --vfs-load source, the archive needs no provider that a preload could register, so its mount in a worker is not deferred past --import. Since the archive takes that mount point, reject --vfs-load alongside it: --build-sea refuses it in "execArgv", and the executable refuses it at startup when it comes from --node-options or from the execArgv of a worker. Also fix the example in vfs.md, which showed a file system a program mounts itself at layer 0, the layer reserved for these mounts. Signed-off-by: Philipp Dunkel <pip@pipobscure.com>
A worker required internal/vfs/sea to ask whether the SEA has an archive to mount, so every worker, in a SEA or not, loaded that module and the sea binding at startup. Record the answer in an internal [sea_vfs_archive] option instead, alongside [vfs_load_set], and have a worker require internal/vfs/sea only when it is set. Signed-off-by: Philipp Dunkel <pip@pipobscure.com>
Collaborator
|
Review requested:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #66709 +/- ##
=======================================
Coverage 90.48% 90.48%
=======================================
Files 791 791
Lines 277204 277258 +54
Branches 53309 53318 +9
=======================================
+ Hits 250827 250879 +52
Misses 16789 16789
- Partials 9588 9590 +2
🚀 New features to boost your workflow:
|
This comment was marked as outdated.
This comment was marked as outdated.
jasnell
approved these changes
Oct 14, 2026
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Re-land of #66614, reverted in #66706 because it broke
parallel/test-bootstrap-moduleswhen the test suite runs in worker mode.The first commit is the original change, unchanged. The second commit fixes
the regression:
A worker required
internal/vfs/seajust to ask whether the SEA has anarchive to mount. Every worker, SEA or not, therefore loaded that module and
internalBinding('sea')at startup. The answer is now recorded in C++ as aninternal
[sea_vfs_archive]option, alongside[vfs_load_set], and a workerrequires
internal/vfs/seaonly when that option is set. This matches how the--vfs-loadmount is gated.Verified locally:
tools/test.py --worker parallel/test-bootstrap-modules: failed before the fix, passes now.test/sea/*vfs*andparallel/test-vfs*pass. The vfs-zip SEA test starts a worker from inside the archive.Since the original PR landed despite this failure, please include
node-test-commit-custom-suites-freestylein the CI run; that job catches it.AI assistance was used. Every line was inspected by me personally.