about summary refs log tree commit diff
diff options
context:
space:
mode:
authorclubby789 <jamie@hill-daniel.co.uk>2025-01-24 16:56:00 +0000
committerclubby789 <jamie@hill-daniel.co.uk>2025-01-24 16:56:00 +0000
commit571f3ed0c49353a6ceec040bb406a4b364b3766f (patch)
tree534c2197b5f463d7b5534f46b268633ac4c87bb5
parent8231e8599e238ff4e717639bd68c6abb8579fe8d (diff)
downloadrust-571f3ed0c49353a6ceec040bb406a4b364b3766f.tar.gz
rust-571f3ed0c49353a6ceec040bb406a4b364b3766f.zip
bootstrap: Handle bootstrap lockfile race condition better
-rw-r--r--src/bootstrap/src/bin/main.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bootstrap/src/bin/main.rs b/src/bootstrap/src/bin/main.rs
index b6552774195..8ebd6b8aa54 100644
--- a/src/bootstrap/src/bin/main.rs
+++ b/src/bootstrap/src/bin/main.rs
@@ -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");