Skip to content

Cargo will lose inter-process file locking on Solaris on with 1.98-nightly #17084

@weihanglo

Description

@weihanglo

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)

  1. Accept the regression and treat Solaris like other Unixes without flock(2). Cargo will silently lock nothing on Solaris.
  2. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-filesystemArea: issues with filesystemsA-jobserverArea: jobserver, concurrency, parallelismC-bugCategory: bugO-solarisOS: Oracle Solarisregression-from-stable-to-nightlyRegression in nightly that previously worked in stable.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions