Files
devvm/testdata/nilaway-baseline.txt
w3cjandClaude Opus 5.5 dd46dd7a0f feat(tools): tool images build side by side
A first run built its tool images one after another, each paying a
build VM's boot (5.7 s on vz, 9.3 s on QEMU) before a download of a few
seconds to a minute. Share.Build now hands the images out to up to four
slots (buildAll), each slot's builds one after another in a build VM of
its own:

- slots: as many as the host's memory, less what the backend's running
  VMs have, and its CPUs give a build VM of 2 GiB and 2 CPUs each after
  keeping 6 GiB and 2 CPUs, at most backend.MaxToolSlots (4) and the
  number of images; one alone keeps base's size. A backend that can't
  list its VMs builds one at a time. A running VM's memory counts whole
  (7.5 GiB, not 7): TestBuildSlotsFit's running VMs fail when it isn't
  counted or is truncated.
- plan lowers the slots until the backend's disks have room:
  Floors.ForTools counts Tools once for each build VM at once, as on a
  disk without copy on write each is a whole copy of base.
- backend.ToolsSpec gets Slot, Slots, Size and Hold; Lima's slot VMs are
  the constants ToolsVM to ToolsVM4, sized with --cpus/--memory, and the
  first slot's build deletes what a killed run left in the slots this
  run doesn't use. Builds hold the share's lock, so one devvm uses the
  slots.
- A failed build's VM goes in the run's cleanup, which runs after the
  build let go of the share's lock: it deletes the VM only once it has
  the lock again (ToolsSpec.Hold, Env.holdShare's TryLockFile), and
  leaves it while another devvm holds it (a build, gc or the daily
  refresh) (TestBuildToolsCleanupHolds, TestBuildHoldsShareForCleanup).
  The next tools build deletes what it finds in the slots, and so does
  devvm gc, which holds the share's lock: backend.Images'
  DeleteToolsLeft, Lima's deleting the slots' build VMs that are there
  and no other VM, which gc asks of every backend first, without
  asking, a backend that can't being a run log line. It returns what
  it deleted, which gc names in one line (tools_build_vms_deleted), and
  gc then never says nothing_to_clean or nothing_deleted
  (gc_tools_build.txtar, TestDeleteToolsLeft in lima and vm, the fake's
  ToolsLeft). The cli skill's judgment.md names this exception to "gc
  --force deletes exactly what gc lists". The conformance suite's
  delete-tools-left checks that it deletes no other VM, not even the
  project VM of a folder named tools (devvm-tools-<hash>), and no image
  (TestConformanceFinds: deletesAllVMs, deletesImage, deletesByPrefix).
  The share's lock
  is the data folder's, so devvms with their own data folders and one
  Lima home don't exclude each other's builds: the docs say not to build
  tools or run gc in two at once (a lock per build VM in the Lima home
  would close it, but it would replace Hold and needs e2e).
- Side by side, one status line covers the builds
  (building_tools_together), and their commands' lines in the run log
  are tagged with their tool (msg.WithLogTag): the UI's LoggedCmd
  prefixes them and shows no status line of its own. Every write starts
  with the tag, as does every line in it, one ended by "\r" included,
  so no build can pass a line off as another's (TestTaggedWrites), and
  a tool's lines are found after another's "\r" (taggedLines splits
  there, a progress bar's updates staying one line: TestTaggedLines). The
  first failure cancels the others and is what Build returns, tagged
  (backend.LoggedIn), so ErrorLogged shows that tool's lines' end.
- A test build's DEVVM_TOOL_SLOTS caps the slots; the CLI tests set 1,
  so the stub's calls keep their order, and tools_side_by_side.txtar
  sets 3, with an interrupt that leaves no build VM. The stub keeps each
  build VM's folder by its name, and the fake backend's BuildTools runs
  its builds outside its lock, as a real backend's would, passing
  ToolsBuild its context.

Docs: images.md's Building tools and Free space, ports-size.md,
space.md, images.md (using) and gc's help (the build VMs gc deletes),
settings.md (one Lima home for two data folders), extending.md,
testing.md and tests.md; the cli skill's judgment.md; the CHANGELOG's
first highlight and the release page's A faster first run.

New messages: building_tools_together, tools_build_vms_deleted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-29 22:57:15 -07:00

71 lines
14 KiB
Plaintext

# nilaway's findings triaged as false positives, which mise run nilaway (scripts/nilaway.sh)
# doesn't report as new. Each line is a group, then the finding's key: its file and its trace,
# without line or column numbers. There's a line for each finding, so a key two findings share
# is here twice. The groups:
# checked the value is used only once its error was checked, in a way nilaway doesn't follow
# bounds a slice indexed only within its length, sliced where nil is safe, or a variadic
# parameter every caller passes
# mapkey a map read with a key from the same map, or after its ok
# nilsafe a method that checks for a nil receiver, or values that are set together
nilsafe internal/agentlogin/logins.go: - fetch/fetch.go: literal `nil` returned from `Transport()` in position 0 - agentlogin/logins.go: result 0 of `Transport()` accessed field `Proxy`
checked internal/backend/lima/cloudimage.go: - lima/cloudimage.go: result 0 of `Lstat()` lacking guarding; called `Mode()` via the assignment(s): - `os.Lstat(...)` to `fi` at lima/cloudimage.go
checked internal/build/build.go: - build/build.go: result 0 of `Stat()` lacking guarding; called `Mode()` via the assignment(s): - `os.Stat(...)` to `fi` at build/build.go
checked internal/build/features.go: - build/features.go: result 0 of `Stat()` lacking guarding; called `Mode()` via the assignment(s): - `fs.Stat(...)` to `fi` at build/features.go
bounds internal/build/images.go: - build/images.go: unassigned variable `labels` sliced into
bounds internal/build/recipe.go: - image/name.go: literal `nil` returned from `Layers()` in position 0 - build/recipe.go: result 0 of `Layers()` sliced into via the assignment(s): - `name.Layers()` to `layers` at build/recipe.go
bounds internal/cli/agentlogin.go: - agents/agents.go: unassigned variable `out` returned from `Select()` in position 0 - cli/agentlogin.go: result 0 of `Select()` sliced into via the assignment(s): - `agents.Select(...)` to `keyed` at cli/agentlogin.go
checked internal/cli/build.go: - cli/build.go: result 0 of `builder()` lacking guarding; accessed field `Backend` via the assignment(s): - `a.builder()` to `b` at cli/build.go
mapkey internal/cli/space.go: - cli/space.go: deep read from local variable `byKey` lacking guarding; dereferenced
bounds internal/devcontainer/devcontainer.go: - devcontainer/devcontainer.go: literal `nil` returned from `Find()` in position 1 - vm/devcontainer.go: result 1 of `Find()` returned from `find()` in position 1 - vm/devcontainer.go: result 1 of `find()` passed as arg `data` to `Parse()` via the assignment(s): - `e.find(dir)` to `data` at vm/devcontainer.go - devcontainer/devcontainer.go: function parameter `data` passed as arg `data` to `decode()` - devcontainer/devcontainer.go: function parameter `data` passed as arg `data` to `position()` - devcontainer/devcontainer.go: function parameter `data` sliced into
checked internal/gitprotect/gitprotect.go: - gitprotect/gitprotect.go: result 0 of `Lstat()` lacking guarding; called `Mode()` via the assignment(s): - `os.Lstat(...)` to `fi` at gitprotect/gitprotect.go
checked internal/gitprotect/gitprotect.go: - gitprotect/gitprotect.go: result 0 of `Stat()` lacking guarding; called `IsDir()` via the assignment(s): - `os.Stat(...)` to `fi` at gitprotect/gitprotect.go
checked internal/gitprotect/gitprotect.go: - gitprotect/gitprotect.go: result 0 of `Stat()` lacking guarding; called `Mode()` via the assignment(s): - `os.Stat(...)` to `fi` at gitprotect/gitprotect.go
checked internal/gitprotect/strict.go: - gitprotect/strict.go: result 0 of `Lstat()` lacking guarding; called `Mode()` via the assignment(s): - `os.Lstat(cfg)` to `fi` at gitprotect/strict.go
bounds internal/platform/clipboard_tool.go: - platform/clipboard_tool.go: read directly from variadic parameter `dirs` sliced into
bounds internal/ports/ports.go: - backend/ports.go: unassigned variable `out` returned from `ParsePortRanges()` in position 0 - ports/ports.go: result 0 of `ParsePortRanges()` sliced into via the assignment(s): - `backend.ParsePortRanges(e)` to `rs` at ports/ports.go
nilsafe internal/safefile/safefile.go: - vm/paste.go: unassigned variable `f` used as receiver to call `ReadAll()` - safefile/safefile.go: read by method receiver `f` accessed field `Info`
checked internal/secrets/secrets.go: - secrets/secrets.go: result 0 of `Lstat()` lacking guarding; called `Mode()` via the assignment(s): - `os.Lstat(...)` to `fi` at secrets/secrets.go
bounds internal/secrets/secrets.go: - secrets/secrets.go: unassigned variable `olds` sliced into
bounds internal/secrets/yours.go: - secrets/yours.go: literal `nil` returned from `List()` in position 0 - secrets/yours.go: result 0 of `List()` passed as arg `list` to `Find()` via the assignment(s): - `y.List()` to `cs` at secrets/yours.go - secrets/yours.go: function parameter `list` sliced into
bounds internal/secrets/yours.go: - secrets/yours.go: literal `nil` returned from `List()` in position 0 - vm/secret.go: result 0 of `List()` passed as arg `list` to `Find()` via the assignment(s): - `yours.List()` to `cs` at vm/secret.go - secrets/yours.go: function parameter `list` sliced into
nilsafe internal/settings/companyproxy.go: - build/build.go: literal `nil` returned from `proxy()` in position 0 - build/build.go: result 0 of `proxy()` passed as arg `cp` to `NewLookup()` - from/from.go: function parameter `cp` used as receiver to call `Route()` - settings/companyproxy.go: read by method receiver `c` accessed field `route`
mapkey internal/settings/config.go: - settings/passkeys.go: index of a map of type `passKeys` lacking guarding; used as receiver to call `refusal()` - settings/config.go: read by method receiver `l` accessed field `bad`
checked internal/settings/mirror.go: - settings/mirror.go: result 0 of `Parse()` lacking guarding; accessed field `Scheme` via the assignment(s): - `url.Parse(s)` to `u` at settings/mirror.go
bounds internal/sshagent/sshagent.go: - sshagent/keys.go: literal `nil` returned from `added()` in position 0 - sshagent/sshagent.go: result 0 of `added()` sliced into via the assignment(s): - `a.added()` to `keys` at sshagent/sshagent.go
bounds internal/sshagent/sshagent.go: - sshagent/sshagent.go: read directly from variadic parameter `argv` sliced into
checked internal/state/vm.go: - vm/finder.go: result 0 of `ReadHash()` lacking guarding; returned from `state()` in position 1 via the assignment(s): - `state.ReadHash(...)` to `st` at vm/finder.go - vm/finder.go: result 1 of `state()` used as receiver to call `Exists()` via the assignment(s): - `e.state(...)` to `st` at vm/finder.go - state/vm.go: read by method receiver `v` accessed field `exists`
checked internal/state/vm.go: - vm/finder.go: result 0 of `ReadHash()` lacking guarding; used as receiver to call `Name()` via the assignment(s): - `state.ReadHash(...)` to `st` at vm/finder.go - state/vm.go: read by method receiver `v` accessed field `name`
checked internal/tools/mise.go: - tools/mise.go: result 0 of `Lstat()` lacking guarding; called `Mode()` via the assignment(s): - `os.Lstat(...)` to `fi` at tools/mise.go
bounds internal/tools/mise.go: - tools/mise.go: unassigned variable `vs` sliced into
bounds internal/tools/tools.go: - tools/tools.go: result 0 of `ParseToolFile()` lacking guarding; returned from `split()` in position 0 via the assignment(s): - `image.ParseToolFile(f)` to `tool` at tools/tools.go, - `append(...)` to `tools` at tools/tools.go - tools/tools.go: result 0 of `split()` sliced into via the assignment(s): - `split(...)` to `tools` at tools/tools.go
checked internal/tools/tools.go: - tools/tools.go: result 0 of `Stat()` lacking guarding; called `ModTime()` via the assignment(s): - `os.Stat(...)` to `fi` at tools/tools.go
bounds internal/tools/tools.go: - tools/tools.go: result 1 of `ParseToolFile()` lacking guarding; returned from `split()` in position 1 via the assignment(s): - `image.ParseToolFile(f)` to `v` at tools/tools.go, - `append(...)` to `versions` at tools/tools.go - tools/tools.go: result 1 of `split()` sliced into via the assignment(s): - `split(...)` to `versions` at tools/tools.go
checked internal/trust/ca.go: - trust/ca.go: result 0 of `GenerateKey()` lacking guarding; accessed field `PublicKey` via the assignment(s): - `ecdsa.GenerateKey(...)` to `key` at trust/ca.go
bounds internal/ui/pick.go: - ui/pick.go: unassigned variable `out` returned from `lines()` in position 0 - ui/pick.go: result 0 of `lines()` sliced into via the assignment(s): - `p.lines()` to `all` at ui/pick.go
bounds internal/ui/status.go: - ui/status.go: unassigned variable `lines` sliced into
bounds internal/ui/table.go: - ui/table.go: unassigned variable `widths` sliced into
mapkey internal/vm/agentlinks.go: - vm/agentlinks.go: deep read from local variable `owner` lacking guarding; passed as arg `h` to `copy()` - vm/agentlinks.go: function parameter `h` accessed field `roots`
bounds internal/vm/agentlinks.go: - vm/agentlinks.go: unassigned variable `roots` returned from `linkRoots()` in position 0 - vm/agentlinks.go: result 0 of `linkRoots()` sliced into via the assignment(s): - `im.linkRoots()` to `roots` at vm/agentlinks.go
mapkey internal/vm/agentsave.go: - vm/agentsave.go: deep read from field `entries` lacking guarding; accessed field `data` via the assignment(s): - `sv.s.entries[n]` to `e` at vm/agentsave.go
mapkey internal/vm/agentsave.go: - vm/agentsave.go: deep read from field `entries` lacking guarding; accessed field `exec` via the assignment(s): - `sv.s.entries[n]` to `e` at vm/agentsave.go
mapkey internal/vm/agentsave.go: - vm/agentsave.go: deep read from field `entries` lacking guarding; accessed field `folder` via the assignment(s): - `sv.s.entries[n]` to `e` at vm/agentsave.go
mapkey internal/vm/agentsave.go: - vm/agentsave.go: deep read from field `entries` lacking guarding; accessed field `kind` via the assignment(s): - `sv.s.entries[n]` to `e` at vm/agentsave.go
mapkey internal/vm/agentsave.go: - vm/agentsave.go: deep read from field `entries` lacking guarding; accessed field `kind` via the assignment(s): - `sv.s.entries[n]` to `e` at vm/agentsave.go
mapkey internal/vm/agentsave.go: - vm/agentsave.go: deep read from field `entries` lacking guarding; accessed field `link` via the assignment(s): - `sv.s.entries[n]` to `e` at vm/agentsave.go
mapkey internal/vm/agentsave.go: - vm/agentsave.go: deep read from field `entries` lacking guarding; accessed field `top` via the assignment(s): - `sv.s.entries[n]` to `e` at vm/agentsave.go
mapkey internal/vm/agentsave.go: - vm/agentsave.go: deep read from field `entries` lacking guarding; accessed field `top` via the assignment(s): - `sv.s.entries[n]` to `e` at vm/agentsave.go
mapkey internal/vm/agentsave.go: - vm/agentsave.go: deep read from field `entries` lacking guarding; passed as arg `e` to `file()` via the assignment(s): - `sv.s.entries[n]` to `e` at vm/agentsave.go - vm/agentsave.go: function parameter `e` accessed field `data`
checked internal/vm/agentsave.go: - vm/agentsave.go: result 0 of `Lstat()` lacking guarding; called `Mode()` via the assignment(s): - `os.Lstat(...)` to `fi` at vm/agentsave.go
checked internal/vm/clonelfs.go: - vm/clonelfs.go: result 0 of `Lstat()` lacking guarding; called `Mode()` via the assignment(s): - `r.Lstat(...)` to `fi` at vm/clonelfs.go
checked internal/vm/cloneseed.go: - vm/cloneseed.go: result 0 of `StdoutPipe()` lacking guarding; called `Close()` via the assignment(s): - `cmd.StdoutPipe()` to `pack` at vm/cloneseed.go
nilsafe internal/vm/cloneseed.go: - vm/cloneseed.go: unassigned variable `pack` called `Close()`
nilsafe internal/vm/finder.go: - vm/finder.go: literal `nil` returned from `resolveFolder()` in position 1 - vm/finder.go: result 1 of `resolveFolder()` returned from `folders()` in position 0 via the assignment(s): - `resolveFolder(...)` to `p` at vm/finder.go - vm/finder.go: result 0 of `folders()` passed as arg `t` to `check()` via the assignment(s): - `e.folders(...)` to `t` at vm/finder.go - vm/finder.go: function parameter `t` accessed field `f`
nilsafe internal/vm/finder.go: - vm/finder.go: literal `nil` returned from `resolveFolder()` in position 1 - vm/finder.go: result 1 of `resolveFolder()` returned from `folders()` in position 0 via the assignment(s): - `resolveFolder(...)` to `p` at vm/finder.go - vm/finder.go: result 0 of `folders()` passed as arg `t` to `check()` via the assignment(s): - `e.folders(...)` to `t` at vm/finder.go - vm/finder.go: function parameter `t` accessed field `f`
mapkey internal/vm/leftovers.go: - backend/registry.go: deep read from field `byName` lacking guarding; returned from `Lookup()` in position 0 via the assignment(s): - `r.byName[...]` to `b` at backend/registry.go - vm/leftovers.go: result 0 of `Lookup()` called `Name()` via the assignment(s): - `e.Registry.Lookup(...)` to `b` at vm/leftovers.go
mapkey internal/vm/leftovers.go: - backend/registry.go: deep read from field `byName` lacking guarding; returned from `Lookup()` in position 0 via the assignment(s): - `r.byName[...]` to `b` at backend/registry.go - vm/leftovers.go: result 0 of `Lookup()` passed as arg `b` to `gone()` via the assignment(s): - `e.Registry.Lookup(...)` to `b` at vm/leftovers.go - vm/leftovers.go: function parameter `b` called `Inspect()`
bounds internal/vm/linediff.go: - vm/linediff.go: literal `nil` returned from `splitLines()` in position 0 - vm/linediff.go: result 0 of `splitLines()` passed as arg `b` to `diffOps()` via the assignment(s): - `splitLines(...)` to `b` at vm/linediff.go - vm/linediff.go: function parameter `b` sliced into
bounds internal/vm/linkrun.go: - vm/linkrun.go: result 0 of `Read()` lacking guarding; sliced into via the assignment(s): - `safefile.Read(...)` to `data` at vm/linkrun.go
bounds internal/vm/sshagent.go: - vm/sshagent.go: read directly from variadic parameter `args` sliced into
bounds internal/vm/up.go: - netpolicy/tier.go: unassigned variable `out` returned from `Choices()` in position 0 - vm/up.go: result 0 of `Choices()` sliced into
bounds internal/vm/workspace.go: - vm/workspace.go: unassigned variable `out` sliced into