about summary refs log tree commit diff
path: root/src/bootstrap/bin
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-03-13 21:55:36 +0100
committerGitHub <noreply@github.com>2023-03-13 21:55:36 +0100
commitb4c7fc4ea16cd0fd0589f064530cb3213ebcb048 (patch)
tree3411c7488bf4dd810cbdc3ee26a01bf878079b85 /src/bootstrap/bin
parent96f4497f464b8aafa672b7954f908c262f6f39f1 (diff)
parent04dfedb3e9d11710594aca52f874892cbbbd50ad (diff)
downloadrust-b4c7fc4ea16cd0fd0589f064530cb3213ebcb048.tar.gz
rust-b4c7fc4ea16cd0fd0589f064530cb3213ebcb048.zip
Rollup merge of #108607 - psumbera:solaris-no-flock-bootstrap, r=albertlarsan68
Don't use fd-lock on Solaris in bootstrap

...as Solaris is missing flock()

fixes #103630
Diffstat (limited to 'src/bootstrap/bin')
-rw-r--r--src/bootstrap/bin/main.rs17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/bootstrap/bin/main.rs b/src/bootstrap/bin/main.rs
index b345bf9fb83..912d875e445 100644
--- a/src/bootstrap/bin/main.rs
+++ b/src/bootstrap/bin/main.rs
@@ -7,15 +7,18 @@
 
 use std::env;
 
-use bootstrap::{t, Build, Config, Subcommand, VERSION};
+#[cfg(all(any(unix, windows), not(target_os = "solaris")))]
+use bootstrap::t;
+use bootstrap::{Build, Config, Subcommand, VERSION};
 
 fn main() {
     let args = env::args().skip(1).collect::<Vec<_>>();
     let config = Config::parse(&args);
 
-    let mut build_lock;
-    let _build_lock_guard;
-    if cfg!(any(unix, windows)) {
+    #[cfg(all(any(unix, windows), not(target_os = "solaris")))]
+    {
+        let mut build_lock;
+        let _build_lock_guard;
         let path = config.out.join("lock");
         build_lock = fd_lock::RwLock::new(t!(std::fs::File::create(&path)));
         _build_lock_guard = match build_lock.try_write() {
@@ -30,9 +33,9 @@ fn main() {
                 t!(build_lock.write())
             }
         };
-    } else {
-        println!("warning: file locking not supported for target, not locking build directory");
     }
+    #[cfg(any(not(any(unix, windows)), target_os = "solaris"))]
+    println!("warning: file locking not supported for target, not locking build directory");
 
     // check_version warnings are not printed during setup
     let changelog_suggestion =
@@ -125,7 +128,7 @@ fn get_lock_owner(f: &std::path::Path) -> Option<u64> {
     })
 }
 
-#[cfg(not(target_os = "linux"))]
+#[cfg(not(any(target_os = "linux", target_os = "solaris")))]
 fn get_lock_owner(_: &std::path::Path) -> Option<u64> {
     // FIXME: Implement on other OS's
     None