Files
devvm/testdata/script
w3cjandClaude Opus 5.5 f4388d79ae fix(tools): each shared tool image builds in a VM of its own
A tools build ran every tool of a batch in one VM with a shared work
folder and output folder, and a tool image's key hashes only its own
tool's inputs, so one tool's installer (as root, through sudo) could
write into another tool's image: through the work folder, a process
left running until the next tool's mkfs.erofs, or by replacing mise or
mkfs.erofs. A fresh folder per tool and killing its processes wouldn't
stop root, so Share.Build now builds each tool in a throwaway VM and an
output folder of its own (buildOne, moveIn), one after another, and only
that tool's image and its .glibc are read from that folder.
shared-tools/build.sh takes exactly one TOOL VERSION FILE.

Measured on Fedora 43 (bare-metal x86_64, Lima with QEMU and KVM), node,
pnpm and bun: about 16 s in one VM, about 34 s in three (two runs each,
the same), so about 9 s for each extra tool, once per tool version.

Tests: TestBuildOneVMEach (node's build writes every tool's file in its
folder; each image holds its own tool's), TestBuild's one call per tool,
TestUpTools' calls, tools.txtar's VM per tool.

Docs: internals/images.md (building tools), internals/design.md's
shared tools (a VM for each tool, the cost).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 22:43:23 -07:00
..