-
Notifications
You must be signed in to change notification settings - Fork 13.7k
feat(std): emulate flock for solaris via fcntl #146269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
+70
−0
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rustbot has assigned @Mark-Simulacrum. Use |
This comment was marked as outdated.
This comment was marked as outdated.
rust-bors bot
added a commit
that referenced
this pull request
Sep 6, 2025
feat(std): emulate flock for solaris via fcntl try-job: `*-solaris`
This comment has been minimized.
This comment has been minimized.
cc @psumbera |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
104932c
to
95e73a2
Compare
This comment was marked as outdated.
This comment was marked as outdated.
rust-bors bot
added a commit
that referenced
this pull request
Sep 6, 2025
feat(std): emulate flock for solaris via fcntl try-job: `*-solaris`
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
95e73a2
to
a179e30
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
rust-bors bot
added a commit
that referenced
this pull request
Sep 6, 2025
feat(std): emulate flock for solaris via fcntl try-job: `*-solaris`
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
a179e30
to
cc98540
Compare
@bors try |
This comment has been minimized.
This comment has been minimized.
rust-bors bot
added a commit
that referenced
this pull request
Sep 7, 2025
feat(std): emulate flock for solaris via fcntl try-job: `*-solaris`
@rustbot ready This should be good for review :) |
Upstream Solaris flock emulation to libstd from cargo. This is borrowed from https://github.com/rust-lang/cargo/blob/3b379fcc541b39321a7758552d37e5e0cc4277b9/src/cargo/util/flock.rs#L502-L536 which was implemented by an Oracle employee. The code has been in cargo since 2022-12. Python's `fcntl.flock` emulates like this as well: https://github.com/python/cpython/blob/c919d02edecfe9d75fe374756fb8aa1db8d95f55/Modules/fcntlmodule.c#L337-L400 We did the same thing in https://github.com/rust-lang/rust/blob/0d0f4eac8b98133e5da6d3604d86a8f3b5a67844/compiler/rustc_data_structures/src/flock/unix.rs#L13-L39
cc98540
to
01edb24
Compare
@bors r+ |
rust-timer
added a commit
that referenced
this pull request
Sep 7, 2025
Rollup merge of #146269 - weihanglo:solaris-flock, r=Mark-Simulacrum feat(std): emulate flock for solaris via fcntl Upstream Solaris flock emulation to libstd from cargo. This is borrowed from https://github.com/rust-lang/cargo/blob/3b379fcc541b39321a7758552d37e5e0cc4277b9/src/cargo/util/flock.rs#L502-L536 which was implemented by an Oracle employee. The code has been in cargo since 2022-12. Python's `fcntl.flock` emulates like this as well: https://github.com/python/cpython/blob/c919d02edecfe9d75fe374756fb8aa1db8d95f55/Modules/fcntlmodule.c#L337-L400 We did the same thing in https://github.com/rust-lang/rust/blob/0d0f4eac8b98133e5da6d3604d86a8f3b5a67844/compiler/rustc_data_structures/src/flock/unix.rs#L13-L39 However, should we just always falls back to fcntl for all Unix, instead of "unsupported"? try-job: `*-solaris`
github-merge-queue bot
pushed a commit
to rust-lang/cargo
that referenced
this pull request
Sep 8, 2025
### What does this PR try to resolve? Replace flock with std flock. ### How to test and review this PR? Given we've supported Oracle since 2022-12 and don't want to break people, this is blocked on std supporting flock emulation via fcntl rust-lang/rust#146269
github-actions bot
pushed a commit
to model-checking/verify-rust-std
that referenced
this pull request
Sep 10, 2025
…mulacrum feat(std): emulate flock for solaris via fcntl Upstream Solaris flock emulation to libstd from cargo. This is borrowed from https://github.com/rust-lang/cargo/blob/3b379fcc541b39321a7758552d37e5e0cc4277b9/src/cargo/util/flock.rs#L502-L536 which was implemented by an Oracle employee. The code has been in cargo since 2022-12. Python's `fcntl.flock` emulates like this as well: https://github.com/python/cpython/blob/c919d02edecfe9d75fe374756fb8aa1db8d95f55/Modules/fcntlmodule.c#L337-L400 We did the same thing in https://github.com/rust-lang/rust/blob/0d0f4eac8b98133e5da6d3604d86a8f3b5a67844/compiler/rustc_data_structures/src/flock/unix.rs#L13-L39 However, should we just always falls back to fcntl for all Unix, instead of "unsupported"? try-job: `*-solaris`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Upstream Solaris flock emulation to libstd from cargo.
This is borrowed from
https://github.com/rust-lang/cargo/blob/3b379fcc541b39321a7758552d37e5e0cc4277b9/src/cargo/util/flock.rs#L502-L536 which was implemented by an Oracle employee.
The code has been in cargo since 2022-12.
Python's
fcntl.flock
emulates like this as well: https://github.com/python/cpython/blob/c919d02edecfe9d75fe374756fb8aa1db8d95f55/Modules/fcntlmodule.c#L337-L400We did the same thing in
rust/compiler/rustc_data_structures/src/flock/unix.rs
Lines 13 to 39 in 0d0f4ea
However, should we just always falls back to fcntl for all Unix, instead of "unsupported"?
try-job:
*-solaris