Repository navigation
fix(cli): bound concurrent target checks - #673
Merged
Merged
Conversation
houko
force-pushed
the
fix/check-target-jobs
branch
from
November 18, 2026 10:52
2f337d6 to
e67fb95
Compare
houko
force-pushed
the
fix/check-target-jobs
branch
2 times, most recently
from
November 18, 2026 19:13
39ac4bf to
53f44fe
Compare
Collaborator
Author
|
Reviewed. All four points of #652's Acceptance are met: |
…by -p The check lock was an O_EXCL file that a killed or crashed check left behind, so every later check in the module waited forever; it is now flock (LockFileEx on Windows) on .nsgo/check.lock at the module's root, released with the process, and the waiting note names the holder's pid once. -jobs defaulted to half the CPUs for both target concurrency and go vet -p, which ran up to NumCPU²/4 compile workers for -target all and halved the plain check's own vet; without -jobs a check now vets one target at a time with go's default, as before. The worker bound is passed as vet arguments rather than through a context value, -jobs below 0 is refused, and the test command's -target help that the branch had reverted is restored. Tests cover the skipped host vet, the -jobs bounds, the lock's wait and a stale lock file; contributing (en, zh), the skill, AGENTS.md and the tool's architecture describe the result.
houko
force-pushed
the
fix/check-target-jobs
branch
from
November 18, 2026 23:06
53f44fe to
75394ca
Compare
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.
Summary
Implements #652.
check -targetvets only the requested targets; the host vet and, in NSGo's repository, the dev-client vets belong to the plaincheck(whichtest.ymlstill runs).-jobs nvets up to n targets at once and passes-p nto everygo vetthe check runs. Without it a check vets one target at a time with go's own-p, as before, so the default never runs more compilers than it used to;-jobsbelow 0 is refused..nsgo/check.lockat the module's root (flock,LockFileExon Windows). A waiting check prints once which pid it waits for; a crashed or killed check's lock is released with its process, and an interrupted wait returns.AGENTS.mdanddocs/architecture/tool.mddescribe the local check strategy: name every touched target in onecheck -target a,b -jobs nrather than starting several checks.Verification
go build ./...;go vet ./cmd/nsgofor windows amd64/386/arm64, linux arm64, android arm64, js/wasm and freebsd;go build ./cmd/nsgofor solaris (no-lock fallback).go tool nsgo check,go tool nsgo check -target all -jobs 4(Linux, 75 s; Apple mobile targets skipped there) andgo tool nsgo check -target ios,ios_simulator,tvos,tvos_simulator,watchos,watchos_simulator -jobs 3on macOS.go tool nsgo test ./cmd/nsgo(310 passed, 14 skipped) andgo tool nsgo test -run 'Layer|Skills|Doc' .; the new check tests also on macOS and Windows.-jobsbounds both concurrent targets and-p, the default runs one target at a time without-p, a second check waits and names the holder, and a stale lock file holds no later check.nsgo.exe checkprocesses in one module; the second printedanother nsgo check (pid 4700) is checking .; waiting for itand ran after the first.Closes #652