Skip to content

Conversation

@pietroalbini
Copy link
Member

@pietroalbini pietroalbini commented Oct 31, 2025

#132977 introduced an allow-list of targets supporting file locking, but forgot to add illumos to it (which introduced support for it in ~2015). File::lock and friends are now stable, and the ecosystem is slowly replacing custom libc calls with the standard library. Crucially, in 1.91 both Cargo and bootstrap switched to File::lock, both breaking build directory locking.

This PR enables file locking on illumos. Fixes #146312.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Oct 31, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 31, 2025

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@pietroalbini
Copy link
Member Author

r? @tgross35

Currently testing this on my illumos VM, will report back once the tests pass.

@rustbot rustbot assigned tgross35 and unassigned Mark-Simulacrum Oct 31, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 31, 2025

tgross35 is currently at their maximum review capacity.
They may take a while to respond.

@pietroalbini
Copy link
Member Author

Ran the tests locally, I can confirm the changes work.

@ChrisDenton
Copy link
Member

This looks right to me and your tests pass so r=me if CI is happy.

@pietroalbini

This comment was marked as outdated.

rust-bors bot added a commit that referenced this pull request Oct 31, 2025
Enable file locking support in illumos
@rust-bors

This comment has been minimized.

@rust-bors

This comment was marked as outdated.

@pietroalbini

This comment was marked as outdated.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Oct 31, 2025
Enable file locking support in illumos

try-job: arm-android
@RalfJung
Copy link
Member

I figured we'd land Illumos first since as you said it is tier-2-with-host-tools so cargo has battle-tested this in the past. Then we can separately discuss what to do on Android. I pinged the target maintainers in #148325.

@pietroalbini

This comment was marked as outdated.

@RalfJung

This comment was marked as outdated.

@pietroalbini

This comment was marked as outdated.

@rust-bors

This comment was marked as outdated.

@pietroalbini
Copy link
Member Author

Ok, on second thought, let's just focus this PR on the illumos changes.

@bors r=ChrisDenton

@bors
Copy link
Collaborator

bors commented Oct 31, 2025

📌 Commit 3d9c69b has been approved by ChrisDenton

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 31, 2025
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Oct 31, 2025
@pietroalbini pietroalbini added beta-nominated Nominated for backporting to the compiler in the beta channel. stable-nominated Nominated for backporting to the compiler in the stable channel. labels Oct 31, 2025
@pietroalbini
Copy link
Member Author

Nominated for stable and beta backport.

File::lock was stabilized in Rust 1.89.0 with an allow-list of targets supporting it. illumos was excluded from that list, even though it does support the underlying syscalls to make it work since around 2015.

While normally adding a new feature (support for illumos in File::lock) would not be eligible for beta backport, let alone stable backport, the ecosystem is migrating from custom libc calls to the standard library API when file locking is required.

The most visible breakage is Cargo, which replaced its own file locking code with File::lock in Rust 1.91.0. When std returns "unsupported" from that API call, Cargo proceeds as if the build directory was locked, even though std never did such a thing. As a result of this, parallel Cargo invocations on illumos interfere with each other, instead of the usual behavior of one invocation waiting for the previous one to finish.

I am aware that the reason for the backport is a Cargo regression, not a standard library regression, but this seems the best fix for the problem. Approving the stable backport would be appreciated, as Cargo 1.91.0 on illumos (a tier 2 target) is misbehaving.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 31, 2025
…ChrisDenton

Enable file locking support in illumos

rust-lang#132977 introduced an allow-list of targets supporting file locking, but forgot to add illumos to it (which introduced support for it in ~2015). `File::lock` and friends are now stable, and the ecosystem is slowly replacing custom libc calls with the standard library. Crucially, in 1.91 both Cargo and bootstrap switched to `File::lock`, both breaking build directory locking.

This PR enables file locking on illumos. Fixes rust-lang#146312.
bors added a commit that referenced this pull request Oct 31, 2025
Rollup of 7 pull requests

Successful merges:

 - #139310 (add first HelenOS compilation targets)
 - #144420 (smart pointer (try_)map)
 - #145974 (Stabilize -Zno-jump-tables into -Cjump-tables=bool)
 - #147161 (implement VecDeque extend_from_within and prepend_from_within)
 - #147780 (Implement VecDeque::extract_if)
 - #148319 (docs: Fix argument names for `carrying_mul_add`)
 - #148322 (Enable file locking support in illumos)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 31, 2025
…ChrisDenton

Enable file locking support in illumos

rust-lang#132977 introduced an allow-list of targets supporting file locking, but forgot to add illumos to it (which introduced support for it in ~2015). `File::lock` and friends are now stable, and the ecosystem is slowly replacing custom libc calls with the standard library. Crucially, in 1.91 both Cargo and bootstrap switched to `File::lock`, both breaking build directory locking.

This PR enables file locking on illumos. Fixes rust-lang#146312.
bors added a commit that referenced this pull request Oct 31, 2025
Rollup of 9 pull requests

Successful merges:

 - #139310 (add first HelenOS compilation targets)
 - #147161 (implement VecDeque extend_from_within and prepend_from_within)
 - #147622 (`unicode_data` refactors)
 - #147780 (Implement VecDeque::extract_if)
 - #147942 (Enable regression labeling aliases)
 - #147986 (Use fstatat() in DirEntry::metadata on Apple platforms)
 - #148103 (cg_llvm: Pass `debuginfo_compression` through FFI as an enum)
 - #148319 (docs: Fix argument names for `carrying_mul_add`)
 - #148322 (Enable file locking support in illumos)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beta-nominated Nominated for backporting to the compiler in the beta channel. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. stable-nominated Nominated for backporting to the compiler in the stable channel. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No flock support on Illumos in std even though it is available on Illumos

7 participants