Skip to content

Cargo 1.91.0 doesn't lock the build directory on illumos #16184

@pietroalbini

Description

@pietroalbini

Cargo 1.91.0 (in #15935) switched from implementing its own build directory locking code to the recent File::lock family of functions in the standard library. It did so while maintaining the code (#4116) that ignores file locking if the API returns "unsupported".

Unfortunately the standard library's implementation of locking was not fully equivalent to Cargo's. Cargo used flock on every platform except for Solaris (which used a custom implementation), while the standard library uses flock on a set of allowlisted targets, the same custom implementation in Solaris, and returns "unsupported" for other platforms.

Turns out that due to an oversight illumos was not included in the allowlist of platforms supporting flock. This means build directory locking is ignored by Cargo 1.91.0 on illumos even if the underlying filesystem supports it.

The standard library missing illumos is tracked in rust-lang/rust#146312, and a fix adding illumos to the standard library's allowlist is in rust-lang/rust#148322.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-filesystemArea: issues with filesystemsC-bugCategory: bugS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.regression-from-stable-to-stableRegression in stable that worked in a previous stable release.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions