-
Notifications
You must be signed in to change notification settings - Fork 665
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
libc: re-export libc properly #288
Conversation
That is confusing. We just added the We need to figure out how to properly reexport a library in bea/nightly. |
Agreed. |
// Re-exports | ||
pub use exports::libc; |
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.
can you not do
extern crate libc;
pub use libc;
? I think I've done that before...
99d6a00
to
139044c
Compare
Ok, I believe what is present now should result in the correct behavior prior to the recent changes coming out of rust-lang/rust#26775 and should also have the same behavior for beta/nightly. |
Looks good here, assuming it works. I'll let @fiveop take another look though. |
☔ The latest upstream changes (presumably #294) made this pull request unmergeable. Please resolve the merge conflicts. |
With rust 1.7, the following warning was being emitted by the compiler: warning: `pub extern crate` does not work as expected and should not be used. Likely to become an error. Prefer `extern crate` and `pub use`. Based on rust-lang/rust#26775 it appears that the warning in 1.7 which was to be escalated to an error is going away but in older versions of rust it is still the case that `pub extern crate` will not work as expected. Instead, we use a somewhat creative hack to export the libc root as a module in nix. Down the line, it may make sense to either eliminate the need to export libc (by chaning the ioctl macros) or to move toward deprecated older versions of rustc. Signed-off-by: Paul Osborne <osbpau@gmail.com>
139044c
to
f590b35
Compare
@homu r+ |
📌 Commit f590b35 has been approved by |
libc: re-export libc properly With rust 1.7, the following warning was being emitted by the compiler: warning: `pub extern crate` does not work as expected and should not be used. Likely to become an error. Prefer `extern crate` and `pub use`. Based on rust-lang/rust#26775 it appears that this change is the current best approach for properly exporting the libc dependency so it may be used outside of nix. Signed-off-by: Paul Osborne <osbpau@gmail.com>
☀️ Test successful - status |
With rust 1.7, the following warning was being emitted by the compiler:
Based on rust-lang/rust#26775 it appears that
this change is the current best approach for properly exporting the
libc dependency so it may be used outside of nix.
Signed-off-by: Paul Osborne osbpau@gmail.com