diff options
| author | Takayuki Maeda <takoyaki0316@gmail.com> | 2023-06-29 03:29:32 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-29 03:29:32 +0900 |
| commit | 376c944bd2ac9cdc5b4742301bbbef032d4ab2d3 (patch) | |
| tree | e97da3362c11a6f43d38774a042a8dbe21069361 /src | |
| parent | bad068856309b7d89cea50816c041eda1e118ca2 (diff) | |
| parent | 35cfac1e2b69c8bfe531c60e64ec9999cbd011ed (diff) | |
| download | rust-376c944bd2ac9cdc5b4742301bbbef032d4ab2d3.tar.gz rust-376c944bd2ac9cdc5b4742301bbbef032d4ab2d3.zip | |
Rollup merge of #113048 - psumbera:solaris-bootstrap-cfgs, r=ozkanonur
Fix build on Solaris where fd-lock cannot be used. This fixes build regression after https://github.com/rust-lang/rust/commit/e7e584b7d9d4eba8b9655b255840ef9caf9b40c0. Resolves #113085
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/bin/main.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/bootstrap/bin/main.rs b/src/bootstrap/bin/main.rs index 7ce4599c424..30dfa81c6f7 100644 --- a/src/bootstrap/bin/main.rs +++ b/src/bootstrap/bin/main.rs @@ -5,9 +5,11 @@ //! parent directory, and otherwise documentation can be found throughout the `build` //! directory in each respective module. -use std::fs::OpenOptions; +#[cfg(all(any(unix, windows), not(target_os = "solaris")))] use std::io::Write; -use std::{env, fs, process}; +#[cfg(all(any(unix, windows), not(target_os = "solaris")))] +use std::process; +use std::{env, fs}; #[cfg(all(any(unix, windows), not(target_os = "solaris")))] use bootstrap::t; @@ -32,7 +34,7 @@ fn main() { }; build_lock = - fd_lock::RwLock::new(t!(OpenOptions::new().write(true).create(true).open(&path))); + fd_lock::RwLock::new(t!(fs::OpenOptions::new().write(true).create(true).open(&path))); _build_lock_guard = match build_lock.try_write() { Ok(mut lock) => { t!(lock.write(&process::id().to_string().as_ref())); @@ -85,7 +87,7 @@ fn main() { // HACK: Since the commit script uses hard links, we can't actually tell if it was installed by x.py setup or not. // We could see if it's identical to src/etc/pre-push.sh, but pre-push may have been modified in the meantime. // Instead, look for this comment, which is almost certainly not in any custom hook. - if std::fs::read_to_string(pre_commit).map_or(false, |contents| { + if fs::read_to_string(pre_commit).map_or(false, |contents| { contents.contains("https://github.com/rust-lang/rust/issues/77620#issuecomment-705144570") }) { println!( |
