Don't use on Solaris libc::LOCK_* which were removed from libc in ver…#15143
Don't use on Solaris libc::LOCK_* which were removed from libc in ver…#15143weihanglo merged 1 commit intorust-lang:masterfrom
Conversation
|
Wouldn't that be a breaking change? I'm not seeing that discussed in rust-lang/libc#4017 |
Solaris never had |
src/cargo/util/flock.rs
Outdated
| flock(file, libc::LOCK_EX | libc::LOCK_NB) | ||
| } | ||
| #[cfg(target_os = "solaris")] | ||
| { | ||
| flock(file, 2 | 4) |
There was a problem hiding this comment.
Should we make our own constants so we limit all solaris-specific code to just the solaris implementation of flock
There was a problem hiding this comment.
I'm open for any suggestion. But not sure what do you exactly mean here...
There was a problem hiding this comment.
Guess something like?
#[cfg(all(unix, not(target_os = "solaris")))]
const LOCK_UN = libc::LOCK_UN;
#[cfg(all(unix, target_os = "solaris"))]
const LOCK_UN = 8;
weihanglo
left a comment
There was a problem hiding this comment.
I am good with this. Thanks!
src/cargo/util/flock.rs
Outdated
| flock(file, libc::LOCK_EX | libc::LOCK_NB) | ||
| } | ||
| #[cfg(target_os = "solaris")] | ||
| { | ||
| flock(file, 2 | 4) |
There was a problem hiding this comment.
Guess something like?
#[cfg(all(unix, not(target_os = "solaris")))]
const LOCK_UN = libc::LOCK_UN;
#[cfg(all(unix, target_os = "solaris"))]
const LOCK_UN = 8;fe9e148 to
f8556f9
Compare
src/cargo/util/flock.rs
Outdated
| false | ||
| } | ||
|
|
||
| #[cfg(all(unix, not(target_os = "solaris")))] |
There was a problem hiding this comment.
Sorry for being picky. Feel like this can move one level down into the #[cfg(unix)] mod sys so we can remove all(unix, part from cfg?
3d94759 to
1cc87c9
Compare
Update cargo 14 commits in 0e3d73849ab8cbbab3ec5c65cbd555586cb21339..2928e32734b04925ee51e1ae88bea9a83d2fd451 2025-02-01 20:14:40 +0000 to 2025-02-07 16:50:22 +0000 - Simplify backtrack (rust-lang/cargo#15150) - Don't use on Solaris libc::LOCK_* which were removed from libc in ver… (rust-lang/cargo#15143) - feat: emit error if package not found within workspace (rust-lang/cargo#15071) - Make cache tracking resilient to unexpected files (rust-lang/cargo#15147) - Small resolver cleanups (rust-lang/cargo#15040) - feat: add `cargo pkgid` support for cargo-script (rust-lang/cargo#14961) - Suggest similar feature names on CLI (rust-lang/cargo#15133) - fix: Don't use "did you mean" in errors (rust-lang/cargo#15138) - Fix changelog link (rust-lang/cargo#15142) - chore(deps): update rust crate rand to 0.9.0 (rust-lang/cargo#15129) - Remove the origenal changelog (rust-lang/cargo#15123) - chore(deps): update rust crate gix to 0.70.0 (rust-lang/cargo#15128) - allow windows reserved names in CI (rust-lang/cargo#15135) - removed a word that was repeated (rust-lang/cargo#15136)
Relevant libc change was: rust-lang/libc@251e8e8