Conversation
Several agents share this checkout on a memory-constrained Mac, and Cargo's own lock is per target directory, so builds into different target dirs ran concurrently and needed manual coordination. scripts/dev-cargo.sh and scripts/dev-test.sh (through the shared codewhale_dev_cache_exec_cargo) now run Cargo under an exclusive flock on <cache root>/build.lock. A waiting build prints the holder's pid, directory and command. Cargo runs as a child of the lock holder, never via exec, so a daemon it starts (an sccache server) cannot inherit the descriptor and pin the lock. Nested runs skip it through CODEWHALE_BUILD_LOCK_HELD; CODEWHALE_BUILD_LOCK=0 opts out. Advisory only; documented in docs/BUILD_PERFORMANCE.md. Evidence: two concurrent holders serialized (the second waited 2s, named the first, then ran and propagated exit status 7); a nested call skipped the lock; codewhale_dev_cache_exec_cargo --version ran under it and recorded the holder. scripts/dev-cache.test.sh: all 22 checks passed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The self-hosted macOS runner is also the developer machine, and its trusted Test job runs Cargo directly, so it still built concurrently with local agents (observed: `cargo run -p codewhale-tui -- eval` from the runner beside local work). The Test job now holds the same machine lock from before the first test build to the end of the job, on the self-hosted runner only and only when the runner's `.env` sets CODEWHALE_BUILD_LOCK_FILE; otherwise it logs that it builds unlocked. The holder is a background process released by an always() step, and the runner kills orphans at job end, so a cancelled or crashed job cannot pin the lock. The job exports CODEWHALE_BUILD_LOCK_HELD so scripts inside it do not wait on their own lock. dev-cargo.sh accepts the same CODEWHALE_BUILD_LOCK_FILE override. Evidence: the step script extracted from ci.yml was run locally against a contended lock: it waited for a running holder (3 s), then a second build waited while it held the lock and ran once the hold file was removed; with the variable unset it exits 0 without locking. YAML parses; dev-cache.sh passes `sh -n`. Hosted acceptance needs a self-hosted run after the runner's .env is set and the runner restarted. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
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.
No-Issue: local multi-agent build coordination for 0.10.1 dogfooding; no public issue.
Several agents share this checkout on a memory-constrained Mac, and
Cargo's own lock is per target directory, so builds into different
target dirs ran concurrently and needed manual coordination.
scripts/dev-cargo.sh and scripts/dev-test.sh (through the shared
codewhale_dev_cache_exec_cargo) now run Cargo under an exclusive flock
on /build.lock. A waiting build prints the holder's pid,
directory and command. Cargo runs as a child of the lock holder, never
via exec, so a daemon it starts (an sccache server) cannot inherit the
descriptor and pin the lock. Nested runs skip it through
CODEWHALE_BUILD_LOCK_HELD; CODEWHALE_BUILD_LOCK=0 opts out. Advisory
only; documented in docs/BUILD_PERFORMANCE.md.
Evidence: two concurrent holders serialized (the second waited 2s,
named the first, then ran and propagated exit status 7); a nested call
skipped the lock; codewhale_dev_cache_exec_cargo --version ran under it
and recorded the holder. scripts/dev-cache.test.sh: all 22 checks
passed.
🤖 Generated with Claude Code