Skip to content

Commit 31aa239

Browse files
authored
Rollup merge of rust-lang#119413 - onur-ozkan:bump-fd-lock, r=Mark-Simulacrum
solaris support on bootstrap lock With yoshuawuyts/fd-lock#48, `fd-lock` now supports Solaris. Therefore we no longer need to conditionally handle the bootstrap locks.
2 parents b594dfa + 48309f4 commit 31aa239

File tree

3 files changed

+57
-69
lines changed

3 files changed

+57
-69
lines changed

src/bootstrap/Cargo.lock

+32-32
Original file line numberDiff line numberDiff line change
@@ -246,19 +246,19 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
246246

247247
[[package]]
248248
name = "errno"
249-
version = "0.3.5"
249+
version = "0.3.8"
250250
source = "registry+https://github.com/rust-lang/crates.io-index"
251-
checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860"
251+
checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245"
252252
dependencies = [
253253
"libc",
254254
"windows-sys",
255255
]
256256

257257
[[package]]
258258
name = "fd-lock"
259-
version = "3.0.13"
259+
version = "4.0.2"
260260
source = "registry+https://github.com/rust-lang/crates.io-index"
261-
checksum = "ef033ed5e9bad94e55838ca0ca906db0e043f517adda0c8b79c7a8c66c93c1b5"
261+
checksum = "7e5768da2206272c81ef0b5e951a41862938a6070da63bcea197899942d3b947"
262262
dependencies = [
263263
"cfg-if",
264264
"rustix",
@@ -369,9 +369,9 @@ checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c"
369369

370370
[[package]]
371371
name = "linux-raw-sys"
372-
version = "0.4.10"
372+
version = "0.4.12"
373373
source = "registry+https://github.com/rust-lang/crates.io-index"
374-
checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f"
374+
checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456"
375375

376376
[[package]]
377377
name = "log"
@@ -530,9 +530,9 @@ checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64"
530530

531531
[[package]]
532532
name = "rustix"
533-
version = "0.38.19"
533+
version = "0.38.28"
534534
source = "registry+https://github.com/rust-lang/crates.io-index"
535-
checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed"
535+
checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316"
536536
dependencies = [
537537
"bitflags 2.4.1",
538538
"errno",
@@ -620,9 +620,9 @@ dependencies = [
620620

621621
[[package]]
622622
name = "sysinfo"
623-
version = "0.30.1"
623+
version = "0.30.3"
624624
source = "registry+https://github.com/rust-lang/crates.io-index"
625-
checksum = "01e979b637815805abbdeea72e4b6d9374dd0efce6524cc65c31e14911dbc671"
625+
checksum = "ba2dbd2894d23b2d78dae768d85e323b557ac3ac71a5d917a31536d8f77ebada"
626626
dependencies = [
627627
"cfg-if",
628628
"core-foundation-sys",
@@ -733,37 +733,37 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
733733

734734
[[package]]
735735
name = "windows"
736-
version = "0.51.1"
736+
version = "0.52.0"
737737
source = "registry+https://github.com/rust-lang/crates.io-index"
738-
checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9"
738+
checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be"
739739
dependencies = [
740740
"windows-core",
741741
"windows-targets",
742742
]
743743

744744
[[package]]
745745
name = "windows-core"
746-
version = "0.51.1"
746+
version = "0.52.0"
747747
source = "registry+https://github.com/rust-lang/crates.io-index"
748-
checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64"
748+
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
749749
dependencies = [
750750
"windows-targets",
751751
]
752752

753753
[[package]]
754754
name = "windows-sys"
755-
version = "0.48.0"
755+
version = "0.52.0"
756756
source = "registry+https://github.com/rust-lang/crates.io-index"
757-
checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
757+
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
758758
dependencies = [
759759
"windows-targets",
760760
]
761761

762762
[[package]]
763763
name = "windows-targets"
764-
version = "0.48.5"
764+
version = "0.52.0"
765765
source = "registry+https://github.com/rust-lang/crates.io-index"
766-
checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
766+
checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd"
767767
dependencies = [
768768
"windows_aarch64_gnullvm",
769769
"windows_aarch64_msvc",
@@ -776,45 +776,45 @@ dependencies = [
776776

777777
[[package]]
778778
name = "windows_aarch64_gnullvm"
779-
version = "0.48.5"
779+
version = "0.52.0"
780780
source = "registry+https://github.com/rust-lang/crates.io-index"
781-
checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
781+
checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea"
782782

783783
[[package]]
784784
name = "windows_aarch64_msvc"
785-
version = "0.48.5"
785+
version = "0.52.0"
786786
source = "registry+https://github.com/rust-lang/crates.io-index"
787-
checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
787+
checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef"
788788

789789
[[package]]
790790
name = "windows_i686_gnu"
791-
version = "0.48.5"
791+
version = "0.52.0"
792792
source = "registry+https://github.com/rust-lang/crates.io-index"
793-
checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
793+
checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313"
794794

795795
[[package]]
796796
name = "windows_i686_msvc"
797-
version = "0.48.5"
797+
version = "0.52.0"
798798
source = "registry+https://github.com/rust-lang/crates.io-index"
799-
checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
799+
checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a"
800800

801801
[[package]]
802802
name = "windows_x86_64_gnu"
803-
version = "0.48.5"
803+
version = "0.52.0"
804804
source = "registry+https://github.com/rust-lang/crates.io-index"
805-
checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
805+
checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd"
806806

807807
[[package]]
808808
name = "windows_x86_64_gnullvm"
809-
version = "0.48.5"
809+
version = "0.52.0"
810810
source = "registry+https://github.com/rust-lang/crates.io-index"
811-
checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
811+
checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e"
812812

813813
[[package]]
814814
name = "windows_x86_64_msvc"
815-
version = "0.48.5"
815+
version = "0.52.0"
816816
source = "registry+https://github.com/rust-lang/crates.io-index"
817-
checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
817+
checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04"
818818

819819
[[package]]
820820
name = "xattr"

src/bootstrap/Cargo.toml

+2-5
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ cc = "1.0.69"
3838
clap = { version = "4.4.7", default-features = false, features = ["std", "usage", "help", "derive", "error-context"] }
3939
clap_complete = "4.4.3"
4040
cmake = "0.1.38"
41+
fd-lock = "4.0"
4142
filetime = "0.2"
4243
home = "0.5.4"
4344
ignore = "0.4.10"
@@ -61,15 +62,11 @@ xz2 = "0.1"
6162
# Dependencies needed by the build-metrics feature
6263
sysinfo = { version = "0.30", optional = true }
6364

64-
# Solaris doesn't support flock() and thus fd-lock is not option now
65-
[target.'cfg(not(target_os = "solaris"))'.dependencies]
66-
fd-lock = "3.0.13"
67-
6865
[target.'cfg(windows)'.dependencies.junction]
6966
version = "1.0.0"
7067

7168
[target.'cfg(windows)'.dependencies.windows]
72-
version = "0.51.1"
69+
version = "0.52"
7370
features = [
7471
"Win32_Foundation",
7572
"Win32_Security",

src/bootstrap/src/bin/main.rs

+23-32
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//! directory in each respective module.
77
88
use std::io::Write;
9-
#[cfg(all(any(unix, windows), not(target_os = "solaris")))]
109
use std::process;
1110
use std::{
1211
env,
@@ -22,43 +21,35 @@ fn main() {
2221
let args = env::args().skip(1).collect::<Vec<_>>();
2322
let config = Config::parse(&args);
2423

25-
#[cfg(all(any(unix, windows), not(target_os = "solaris")))]
2624
let mut build_lock;
27-
#[cfg(all(any(unix, windows), not(target_os = "solaris")))]
2825
let _build_lock_guard;
2926

3027
if !config.bypass_bootstrap_lock {
3128
// Display PID of process holding the lock
3229
// PID will be stored in a lock file
33-
#[cfg(all(any(unix, windows), not(target_os = "solaris")))]
34-
{
35-
let path = config.out.join("lock");
36-
let pid = match fs::read_to_string(&path) {
37-
Ok(contents) => contents,
38-
Err(_) => String::new(),
39-
};
40-
41-
build_lock = fd_lock::RwLock::new(t!(fs::OpenOptions::new()
42-
.write(true)
43-
.create(true)
44-
.open(&path)));
45-
_build_lock_guard = match build_lock.try_write() {
46-
Ok(mut lock) => {
47-
t!(lock.write(&process::id().to_string().as_ref()));
48-
lock
49-
}
50-
err => {
51-
drop(err);
52-
println!("WARNING: build directory locked by process {pid}, waiting for lock");
53-
let mut lock = t!(build_lock.write());
54-
t!(lock.write(&process::id().to_string().as_ref()));
55-
lock
56-
}
57-
};
58-
}
59-
60-
#[cfg(any(not(any(unix, windows)), target_os = "solaris"))]
61-
println!("WARNING: file locking not supported for target, not locking build directory");
30+
let lock_path = config.out.join("lock");
31+
let pid = match fs::read_to_string(&lock_path) {
32+
Ok(contents) => contents,
33+
Err(_) => String::new(),
34+
};
35+
36+
build_lock = fd_lock::RwLock::new(t!(fs::OpenOptions::new()
37+
.write(true)
38+
.create(true)
39+
.open(&lock_path)));
40+
_build_lock_guard = match build_lock.try_write() {
41+
Ok(mut lock) => {
42+
t!(lock.write(&process::id().to_string().as_ref()));
43+
lock
44+
}
45+
err => {
46+
drop(err);
47+
println!("WARNING: build directory locked by process {pid}, waiting for lock");
48+
let mut lock = t!(build_lock.write());
49+
t!(lock.write(&process::id().to_string().as_ref()));
50+
lock
51+
}
52+
};
6253
}
6354

6455
// check_version warnings are not printed during setup

0 commit comments

Comments
 (0)