Repository navigation
timeout: take the process by mutable pointer, so the Windows build works again - #263
Merged
Merged
Conversation
…rks again main does not build timeout. The tip commit c6cbc32 ("timeout: fix errors") changed every terminate_process to take the process by 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 fn terminate_process(p os.Process, ...) { if sig_num == 15 { p.signal_term() } else { p.signal_kill() } } Reproduced on c6cbc32: `v -o timeout.exe src/timeout` fails with exactly those two errors, so the Windows build of timeout is broken on main. CI has been failing inside the V bootstrap before it reaches any of this, which is why it went unnoticed. The comment already sitting above that function says why a value cannot work - "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 signature is what has to move back, not the comment. All three platform variants have to agree, because timeout.v calls whichever one the target selects from a single shared call site. So all three take `mut p &os.Process` and both call sites pass `mut &p`, which is what the tree had before c6cbc32 and is the only combination of those two choices that compiles. 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.
dy-tea
approved these changes
Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
maindoes not buildtimeout. This is the one-line cause and its fix.The break
The tip commit
c6cbc320b6("timeout: fix errors") changed everyterminate_processto take the process by value, but left the two callsthat mutate it:
Reproduced on
c6cbc320b6:v -o timeout.exe src/timeoutfails with exactlythose two errors. The Windows build of
timeoutis broken onmain.Why it went unnoticed
CI has been failing inside the V compiler's own bootstrap before it compiles
any of this repository, on every job, since early October. Every PR in the
repo shows red, which is what upstream issues
vlang/v#30551,
#30598 and
#30753 track. So there has been no
green signal to catch this.
The fix
The comment already sitting above that function says why a value cannot
work:
So the signature is what has to move back, not the comment. All three
platform variants take
mut p &os.Process, and both call sites passmut &p— which is what the tree had before
c6cbc320b6, and the only combination ofthose two choices that compiles.
The three variants have to agree, because
timeout.vcalls whichever one thetarget selects from a single shared call site. A mismatch is a build break on
exactly whichever platform picks the odd one out, which is the failure mode
the
vinix-cross-buildjob in #250 is meant to catch.Verification
v -o timeout.exe src/timeoutbuilds onc6cbc320b6+ this commit, anddoes not build on
c6cbc320b6alone.src/timeoutpasses 1/1 with a real GNUtimeoutonPATHto compareagainst.
v fmt -verifyclean on all four files.Note for review
This is deliberately minimal and lands ahead of #250, which was written
against the pre-
c6cbc320b6tree and carries the same signature fix. Oncethis merges, #250's
src/timeoutcommit rebases away and that PR is leftcarrying only the Vinix build target.