gc --tools prints gc_tools_recent (count, tools) for the current shared
tool images no VM has that it keeps because they were built in the last
hour, after the same filters as the ones it deletes (TOOL names,
--backend, skipped backends): with gc's list, or in place of
nothing_to_clean. Plain gc never prints it.
--force, only with --tools (gc_force_needs_tools otherwise), also
deletes those and skips gc's prompt; gc still lists what it deletes.
Tools a VM's state lists stay, the share's lock is held from before the
List, and no other category widens. Retention's Idle keeps the hour.
The being-made signal: tools.Making, an flock on making.lock in devvm's
data folder (platform.LockFileShared, platform.TryLockFile). up's create
(every backend, --clone, devcontainers), devvm update and adding a layer
in place hold it shared from before they pick tools until the VM's state
lists them; gc --tools --force takes it exclusively without waiting,
after the share's lock, and holds it through its deletions, else fails
with gc_force_making and deletes nothing. The OS releases it when the
process ends, and its descriptor is close-on-exec.
Tests: TestLockFileShared, TestLockFileKilled (a killed child releases
it), TestMaking, TestNoVM's recent ones, TestGCAsks, gc_tools.txtar.
Docs: using/images.md, using/space.md, internals/images.md, the CLI
reference.
Co-Authored-By: Claude Opus 5.5 <[email protected]>