Repository navigation
build(runtime): take the Node-only modules out of the default build - #503
Merged
Merged
Conversation
LAVA_NODE_MODULES (#config, default false) decides whether node:sqlite, node:fs, node:os, node:net, node:http, node:https, node:dns and node:tty are part of the build. With it off their bindings objects are never created and the loader's compile refuses their ids, so `require` of one is MODULE_NOT_FOUND. `NODE_MODULES=1 ./scripts/build.sh` builds them back in unchanged; nothing is deleted. CI: the test and mutation jobs run only from workflow_dispatch while tests are paused. Type-check and lint still run on every push and PR. Not done here: libsqlite3 is still linked (pkg/std/sqlite is still imported), the excluded modules' sources are still embedded, and node:crypto stays in because it loads at start-up. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.
What changed
LAVA_NODE_MODULES(#config, default false) decides whether the Node-only subsystems are part of the build:node:sqlite,node:fs,node:os,node:net,node:http,node:https,node:dns,node:tty(andnode:dns/promises,internal/http/*,internal/os/*).With it off:
install_internal_modules);builtin_compile_cb), sorequireof one isMODULE_NOT_FOUND.NODE_MODULES=1 ./scripts/build.shbuilds them back in unchanged. Nothing is deleted: this is the owner's call to exclude them while the engine core for Larva is built, keeping the way back to full Node parity.Still in the default build: the web surface (
fetch,URL, streams, encoding, timers),Buffer,events/stream/util/path/assert, and the CommonJS loader.CI
The
Linux (full build + tests)andMutation gatejobs now run only fromworkflow_dispatch(Actions → CI → Run workflow). Tests are paused for this phase on the owner's instruction. Type-check, format and lint still run on every push and PR.Not verified, not done
make checkpasses on all three targets with the define off,odin checkpasses with it on, and onelava evalper build confirmed the eight modules areMODULE_NOT_FOUNDwhen off and thatfsandsqliteload when on.NODE_MODULES=1.libsqlite3is still linked:pkg/std/sqliteis still imported.node:cryptostays in: it loads at start-up andBlobneedsrandomUUIDfrom it./pr-gatewas not run.Size
bin/lava,-o:speed, this machine: 2,036,720 bytes with the modules, 1,860,880 without (one build of each).Reuse verdict (§2)
No new low-level code: one
#configconstant, awhenblock around existing registrations, and an id check in the compile callback.Node parity
A declared §1 deviation while the define is off: the default build is not a Node-compatible runtime. Unpinned by a test, as above.
🤖 Generated with Claude Code