-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
flock: Use fcntl constants directly from libc crate on Unix targets #57121
Conversation
r? @varkor (rust_highfive has picked a reviewer for you, use r? to override) |
This also requires two small fixes in the libc crate: rust-lang/libc#1186 |
liblibc is a submodule in rust tree, so you will have to update the submodule after the referenced PR lands and before this can/should land. |
Thanks for the heads-up! I will open a PR for that, too. |
Would be fine to just have it all be in the same PR (i.e. this PR), unless you’re in a hurry to land this regardless of whether the |
You mean this PR and the one for updating |
I think it would be most straightforward just to update the submodule in this PR, seeing as how they're directly related. |
And I'm just trying to find out how to do that properly. I have updated a submodule in a PR before. Care to explain? |
Oh, it seems that we have recently stopped using the submodule approach and are now pulling the dependency in via cargo from crates.io instead... Which essentially means that all you need to do is to update the relevant cc @alexcrichton liblibc probably needs a new release, right? |
Ah, right. I was already wondering why |
@alexcrichton Oh, before you release. I think @karcherm has two fixes for sparc64 in |
One of the patches @glaubitz is talking about is [https://github.com/rust-lang/libc/pull/1187]. I'm unsure whether it should be merged or not. The second one is work in progress to enable reliable stack overflow detection on sparc64. It is not ready yet, but possibly in a couple of hours. |
@alexcrichton I would suggest to do a new We can do another release once @karcherm has pushed his fixes. |
Bump version to 0.2.46 New release required for rust-lang/rust#57121
Bump version to 0.2.46 New release required for rust-lang/rust#57121
Bump version to 0.2.46 New release required for rust-lang/rust#57121
I'm trying to update the
I made a fresh checkout to make sure my repo isn't corrupted but that didn't help. Anyone got an idea what's wrong? |
Hm I think you may need to make sure to use the nightly cargo to update libc, but you can also just update one of the version requirements in this repository and then |
@alexcrichton Updating Should be all set now :). |
☔ The latest upstream changes (presumably #57263) made this pull request unmergeable. Please resolve the merge conflicts. |
@@ -16,6 +16,12 @@ cfg_if! { | |||
use std::os::unix::prelude::*; | |||
use libc; | |||
|
|||
pub const F_RDLCK: libc::c_short = libc::F_RDLCK as libc::c_short; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it necessary to have these as constants here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I'll push an updated version in a second.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed :).
Since the values for the fcntl constants can vary from architecture to architecture, it is better to use the values defined in the libc crate instead of assigning literals in the flock code which would make the assumption that all architectures use the same values. Fixes rust-lang#57007
@bors r+ |
📌 Commit 1c4823e has been approved by |
flock: Use fcntl constants directly from libc crate on Unix targets Since the values for the fcntl constants can vary from architecture to architecture, it is better to use the values defined in the libc crate instead of assigning literals in the flock code which would make the assumption that all architectures use the same values. Fixes #57007
☀️ Test successful - status-appveyor, status-travis |
Since the values for the fcntl constants can vary from architecture
to architecture, it is better to use the values defined in the libc
crate instead of assigning literals in the flock code which would
make the assumption that all architectures use the same values.
Fixes #57007