Every tool image build (tools.Share.Build) runs for a devvm that holds
the making lock shared from before it picks a VM's tools until the VM's
state lists them, and holds the share's lock while it builds and moves
images in. gc --tool-images takes the share's lock first, then tries the
making lock alone, so it waits for a build in progress and keeps every
current tool image no VM has while a VM is being made. The age rule
added nothing, so gc --tool-images now deletes current tool images no VM
lists however recently they were built.
- tools: Share.NoVM keeps only the state and record checks;
NoVMRecent and builtRecent go.
- cli: gc loses --recent; gcPlan.making holds what it keeps while a VM
is being made (showMaking).
- msg: gc_tools_recent, gc_recent_needs_tools and gc_recent_making go.
- tests: gc_tools.txtar checks a new tool image goes, and that gc waits
for a tool build in progress and keeps every image while that VM is
made (the limactl stub's shell-waits-on); gc.txtar checks gc's package
cache cleanup (a stale set, its file, an unnamed file, an old
.taken-* folder, a new one kept).
- docs: using/images.md, using/space.md, internals/images.md, the cli
skill's judgment.md and the gc reference.
Co-Authored-By: Claude Opus 5.5 <[email protected]>