Make Node dependency outputs reproducible without build caches

This commit is contained in:
Timothy J. Aveni
2026-10-10 08:37:44 -07:00
parent d6434efc28
commit 6e591d5588
2 changed files with 22 additions and 0 deletions
+19
View File
@@ -61,6 +61,25 @@ with their own versions. Authored source symlinks and non-bundled portable impor
other than the SDK and server Node builtins are rejected. This is build closure other than the SDK and server Node builtins are rejected. This is build closure
checking, not a purity proof or security sandbox. checking, not a purity proof or security sandbox.
`mkCaminoYarnDependencies` installs the locked dependency recipe and exports its
installed Node dependency tree, including native package results and executable
links. Generated Yarn install/linker state stays outside runtime outputs. Yarn
describes its install-state file as an optimization cache in its
[configuration reference](https://yarnpkg.com/configuration/yarnrc#installStatePath).
This helper output is a dependency directory for a build, not a standalone
Package or a runnable Yarn project. Its `devShell` supplies freestanding Yarn for
editable projects; do not run Yarn against the readonly dependency output.
Use the shared `installDependencies` assembly for consumers: authored libraries
are copied into the consumer's `node_modules`, where Node can find their
transitive dependencies, while selected SDK links retain their canonical type
identity. Reserved SDK substitutions fail checks. Web Studio uses this same
assembly rather than retaining a full Yarn project just to resolve UI libraries.
Its dependency inputs contain manifests, lock and Yarn configuration/plugin
recipe; ordinary Studio source edits do not enter that dependency derivation.
Recipes with local/workspace dependencies must still include their needed source.
This is language-specific build machinery; it adds no core Package file contract.
The core/Automerge bundle and Replicache bundle are built once. Browser modules The core/Automerge bundle and Replicache bundle are built once. Browser modules
import the core through a content-addressed gateway URL, independent of package import the core through a content-addressed gateway URL, independent of package
identity. Each manifest covers the shared bytes it uses. The gateway retains its identity. Each manifest covers the shared bytes it uses. The gateway retains its
+3
View File
@@ -13,6 +13,9 @@ let
test -d node_modules test -d node_modules
mkdir -p "$out" mkdir -p "$out"
cp -a node_modules/. "$out/" cp -a node_modules/. "$out/"
# Node resolves installed packages directly. This generated index is for
# Yarn's linker, not a runtime input; do not export build-session state.
rm -f "$out/.yarn-state.yml"
runHook postInstall runHook postInstall
''; '';
}; };