-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add passwd/group APIs needed for nix-rust/nix#864 #934
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
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
The build is failing on some platforms due to automatically generated tests, I'm not sure how to fix that... |
Don't worry about this that much. This is what CI is for :) |
@@ -388,6 +389,10 @@ extern { | |||
pub fn getpwent() -> *mut passwd; | |||
pub fn setpwent(); | |||
pub fn endpwent(); | |||
pub fn setgrent(); |
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.
setgrent is not available in freebsd (or it looks like this is the case), you are going to have to put it in the folders of all bsd targets except for the freebsd one :/
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.
setgrent is available in FreeBSD. What gives you the impression it isn't?
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.
setgrent is available in FreeBSD. What gives you the impression it isn't?
Indeed, this buildbot: https://travis-ci.org/rust-lang/libc/jobs/347737123#L1402
Says that the pointer types are incompatible. It looks like its signature was changed in: freebsd/freebsd-src@786c392
from int setgrent()
to void setgrent()
. That commit was 2 years ago, but it might be that we are testing against a FreeBSD release that is older as the release where that commit was included.
You might want to change the signature to int setgrent()
and see if that fixes the build. If so, please open an issue about updating the FreeBSD version. Ideally we would do that in a different PR, and then update everything that breaks (like making setgrent
void setgrent()
).
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.
If it turns out to be the case that changing the signature to int setgrent()
fixes this issue, what you can also do is change it back afterwards to void setgrent()
and whitelist the function here: https://github.com/rust-lang/libc/blob/master/libc-test/build.rs#L606
By adding a match arm like this:
// FIXME: need to upgrade FreeBSD version. Issue: rust-lang/libc/xxxxxx
"setgrent" if freebsd => true,
This basically disables testing for the setgrent
function for FreeBSD.
Thanks! Looks like CI is failing though? |
@alexcrichton The build is now passing :) |
lgtm |
Thanks! I think lockfile may need another update though? |
@alexcrichton Done |
@bors: r+ |
📌 Commit d058e0c has been approved by |
Add passwd/group APIs needed for nix-rust/nix#864 Hope I did this right. I only added platforms I could personally test. . . cc: @gnzlbg
☀️ Test successful - status-appveyor, status-travis |
@ctrlcctrlv nice thanks :) I don't know if nix-rust has some more open issues on libc for missing interfaces (they used to have some at least), but now you guys should be able to quickly add to libc whatever you find its missing :) |
Sorry, accidentally forgot this when submitting rust-lang#934..
Hope I did this right. I only added platforms I could personally test. . .
cc: @gnzlbg