Repository navigation
Conversation
build.vsh now has a 'vinix' key in ignore_dirs. It lists only uptime, rather than sharing the macOS list: stat and sync are excluded on macOS because the BSD syscall surface differs from Linux, and Vinix follows POSIX closely enough that both do build there. Without the key the dictionary lookup fell through to an empty list, so Vinix would have built the Windows-excluded Unix set as well as everything else at once. A CI job cross-compiles all 87 tools for the target, since GitHub has no Vinix runner. That job is not decoration: it is what found that timeout did not compile on any Unix. timeout.v passed 'mut &p' to terminate_process, which only the Windows variant declares as mut, so the nix and default variants rejected it. Linux, macOS and Vinix were all broken while Windows CI was green. All three variants now take 'mut p &os.Process' so the call site is uniform, and the Windows comment explaining why the pointer is mutable is kept. Verified: 87 of 87 tools cross-compile for vinix, timeout builds for all four targets, and the Windows build is unchanged.
Rebasing this onto main surfaced that main's tip commit c6cbc32 ("timeout: fix errors") does not build. It changed every terminate_process from `p os.Process` to a value, but left the two calls that mutate it: src/timeout/timeout_windows.c.v:13:3: error: `p` is immutable, declare it with `mut` to make it mutable src/timeout/timeout_windows.c.v:15:3: error: `p` is immutable, declare it with `mut` to make it mutable terminate_process(p os.Process, ...) // p.signal_term() terminate_process(p os.Process, ...) // p.signal_kill() Verified on pristine main: `v -o timeout.exe src/timeout` fails with exactly those two errors, so timeout does not build for Windows at all right now. Nothing caught it because CI has been failing inside the V bootstrap before it reaches this. The comment above the function on main already says why this cannot be a value - "A pointer, because signalling a process changes it. Passing it by value ... made the compiler reference it for us and then reject that as deprecated automatic referencing." - so the fix is to make the signature match the comment rather than the other way round. So this keeps the mut-pointer signature across all three platform variants and passes `mut &p` at both call sites, which is what this branch already did before the rebase. The signatures have to agree: they are selected per platform from one shared call site, so a mismatch is a build break on whichever target picks the odd one out. Verified after the change: timeout builds, and src/timeout passes (1/1) with a real GNU timeout on PATH to compare against. v fmt -verify is clean on all four files. The diff is five lines - three signatures and two call sites - with no other change.
d79c3f0 to
31609f8
Compare
|
Two things changed after rebasing onto The
|
build.vshnow has a'vinix'key inignore_dirs. It lists onlyuptime, rather than sharing the macOS list:statandsyncare excluded on macOS because the BSD syscall surface differs from Linux, and Vinix follows POSIX closely enough that both build there. Without the key, the dictionary lookup fell through to an empty list — which read as "build everything" and would have attempted the Windows-excluded Unix set alongside it.A CI job cross-compiles all 87 tools for the target, since GitHub has no Vinix runner.
That job is not decoration. It is what found that
timeoutdid not compile on any Unix.timeout.vpassedmut &ptoterminate_process, which only the Windows variant declares asmut; the_nixand_defaultvariants rejected it. Linux, macOS and Vinix were all broken while Windows CI was green, and the-Wimpure-vgate never saw it because only Windows builds the directory. All three variants now takemut p &os.Processso the call site is uniform, and the Windows comment explaining why the pointer is mutable is kept rather than deleted as redundant.V's side needed nothing:
$if vinix,_vinix.c.vfile suffixes and-os vinixall already work, and_nix.c.vfiles are selected on Vinix because the suffix allowlist only excludes them on Windows. I verified that with a probe rather than assuming it.Verified: 87 of 87 tools cross-compile for Vinix,
timeoutbuilds for all four targets (windows, linux, macos, vinix), and the Windows build is unchanged.Two things I want to flag, not bury
The CI job parses
build.vshwith shell text tools to read the ignore list, so the two cannot drift. That parsing is now verified: it extracts exactlyuptime, skips exactly 1 of 87, and drops the key word itself. But it is still a shellgrepreading a V source file, which is a real fragility — a restructured map literal would break it. A stronger design would havebuild.vshemit the list on request (v run build.vsh --print-ignored), which is a bigger change than this PR should carry. Worth a follow-up.It cross-compiles; it does not run. There is no Vinix runner, so nothing in CI executes the resulting binaries, and a tool that compiles but misbehaves on Vinix will still pass. That is a meaningful gap, and the job says so in a comment rather than implying coverage it does not have.