Problem
Cargo will lose inter-process file locking on Solaris starting with 1.98-nightly tomorrow.
std::fs::File::lock and friends were emulated on Solaris via fcntl from 1.91 (rust-lang/rust#146269) but
removed in 1.98 (rust-lang/rust#157509) because the emulation is process-scoped instead of handle-scoped. It
cannot honor the documented semantics of File::lock. On Solaris these will return ErrorKind::Unsupported.
Solaris had working cargo locking from 2022-12 (#11439) through 1.97. This is a regression on a tier-2 target.
Possible Solution(s)
- Accept the regression and treat Solaris like other Unixes without
flock(2). Cargo will silently lock nothing on Solaris.
- Re-add a Solaris-only
fcntl shim in Cargo, with the caveat that it is process-scoped and every call site must avoid opening the same lock path twice in one process.
Notes
Version
The upcoming nightly (2026-06-07 I guess)
Problem
Cargo will lose inter-process file locking on Solaris starting with 1.98-nightly tomorrow.
std::fs::File::lockand friends were emulated on Solaris viafcntlfrom 1.91 (rust-lang/rust#146269) butremoved in 1.98 (rust-lang/rust#157509) because the emulation is process-scoped instead of handle-scoped. It
cannot honor the documented semantics of
File::lock. On Solaris these will returnErrorKind::Unsupported.Solaris had working cargo locking from 2022-12 (#11439) through 1.97. This is a regression on a tier-2 target.
Possible Solution(s)
flock(2). Cargo will silently lock nothing on Solaris.fcntlshim in Cargo, with the caveat that it is process-scoped and every call site must avoid opening the same lock path twice in one process.Notes
File::lock(probably) behaves incorrectly on Solaris rust#157390Version
The upcoming nightly (2026-06-07 I guess)