Skip to content

Commit

Permalink
Unrolled build for rust-lang#136009
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#136009 - clubby789:pidfile-race, r=jieyouxu

bootstrap: Handle bootstrap lockfile race condition better

Fixes rust-lang#135972

Tested by:
- Starting one build
- In another terminal, `echo -n '' > build/lock`
- Attempt to invoke bootstrap a second time
  • Loading branch information
rust-timer authored Jan 25, 2025
2 parents 6365178 + 571f3ed commit 04db663
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/bootstrap/src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ fn main() {
}
err => {
drop(err);
if let Ok(pid) = pid {
// #135972: We can reach this point when the lock has been taken,
// but the locker has not yet written its PID to the file
if let Some(pid) = pid.ok().filter(|pid| !pid.is_empty()) {
println!("WARNING: build directory locked by process {pid}, waiting for lock");
} else {
println!("WARNING: build directory locked, waiting for lock");
Expand Down

0 comments on commit 04db663

Please sign in to comment.