fix: shared flock guard for rustup to prevent parallel build races#21222
Open
fix: shared flock guard for rustup to prevent parallel build races#21222
Conversation
charlielye
approved these changes
Mar 6, 2026
ludamad
approved these changes
Mar 6, 2026
ludamad
approved these changes
Mar 6, 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.
Summary
Noir and avm-transpiler builds run in parallel via Make and both trigger rustup to install/use the Rust toolchain from the shared
RUSTUP_HOMEat/opt/rust/rustup. When the toolchain isn't cached (e.g. on noir sync branches), both try to install simultaneously, causing:"the 'cargo' binary is not applicable to the toolchain")f4507cc891)This PR adds a shared flock at
/tmp/rustup.lockacross all three scripts that interact with rustup:noir/bootstrap.sh— wrapsinstall_deps(cargo-binstall, just install-rust-tools)avm-transpiler/bootstrap.sh— updates existing local lock (/tmp/rustup-avm-transpiler.lock) to shared pathbootstrap.sh— wraps the CI-onlyrustup toolchain installincheck_toolchainsThe build image Dockerfile already installs Rust 1.89.0 correctly — this guard prevents races when the toolchain needs runtime installation or when rustup operations overlap.
Context: #20985
ClaudeBox log: http://ci.aztec-labs.com/a103561d07144777-2