mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Rollup merge of #136009 - clubby789:pidfile-race, r=jieyouxu
bootstrap: Handle bootstrap lockfile race condition better Fixes #135972 Tested by: - Starting one build - In another terminal, `echo -n '' > build/lock` - Attempt to invoke bootstrap a second time
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user