-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
std: Remove rust_builtin C support library #30175
Conversation
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
@alexcrichton Can you link me to the libc changes this pulls in? I'm curious what was involved. |
So far (although this is likely to grow to be a longer list) it required 2 changes: (the latter of which I now realize still needs to land...) |
😍 |
a60b4ab
to
b40f355
Compare
@alexcrichton thanks to Cc me. currently, it breaks at least openbsd. I have manually applied the patch (so I could also had done mistakes).
I can't check deeper today, but I will take a look tomorrow. |
Thanks @semarie! I've added the imports for |
@alexcrichton I think I would like the source to explicitly separate the cases where the cast is needed there, via cfg with a FIXME - it seems like it must be a bug right? |
It's a bad thing if these functions ever truncate values for I think we should either fake the |
9bc397c
to
977d0bd
Compare
I've pushed a commit to remove the cast, and I just started updating the That's a little controversial to me, however, as the types in |
And to make my concerns a little more concrete, here's what I'm thinking:
Overall I would propose a plan that looks like:
This will separate us from the C names as well as how they may change depending on how C code is compiled, and it means that we are no longer providing types that are "FFI compatible" as it doesn't always work out. For now we can probably leave the basic integer definitions (e.g. |
977d0bd
to
408d523
Compare
👍 for hiding these and going all 64-bit. Keeping fundamental C types ( |
408d523
to
b7b2fae
Compare
re-r? @brson I'd like to move forward on this rather than wait for dealing with questions about other types in play here. Along those lines this patch now preserves the same behavior we have today. |
☔ The latest upstream changes (presumably #30325) made this pull request unmergeable. Please resolve the merge conflicts. |
b7b2fae
to
33d0292
Compare
☔ The latest upstream changes (presumably #30381) made this pull request unmergeable. Please resolve the merge conflicts. |
33d0292
to
87f5ee1
Compare
☔ The latest upstream changes (presumably #30454) made this pull request unmergeable. Please resolve the merge conflicts. |
87f5ee1
to
a8cb016
Compare
r=me |
⌛ Testing commit 606369f with merge 1e47505... |
💔 Test failed - auto-linux-64-x-android-t |
606369f
to
b1e0f1a
Compare
@bors: r=brson b1e0f1a |
⌛ Testing commit b1e0f1a with merge 727d7a0... |
💔 Test failed - auto-linux-64-x-android-t |
All these definitions can now be written in Rust, so do so!
b1e0f1a
to
2f42ac4
Compare
All these definitions can now be written in Rust, so do so!
The corresopnding C file was removed in rust-lang#30175 and looks like I forgot to remove the header as well.
The corresopnding C file was removed in rust-lang#30175 and looks like I forgot to remove the header as well.
When #30643 lands, i'll take a close look at the BSD builds and fix anything up that is needed. |
FYI, this did end up breaking Android. It broke rust-errno (https://github.com/lfairy/rust-errno), and getting a fix landed for that is currently blocking Servo's rustup. Maybe we should just backport the symbol removed here ( |
@larsbergstrom you can probably fix it temporarily by adding this to any crate: #[cfg(target_os = "android")]
#[no_mangle]
pub unsafe extern fn __errno_location() -> *mut i32 {
extern { fn __errno() -> *mut i32; }
__errno()
} |
@alexcrichton Yeah, thanks! I was thinking of doing just that. Otherwise, we might have to fork errno, add a submodule for it, add a |
@alexcrichton @semarie when #31230 and rust-lang/libc#157 land, the BSD builds should be green. |
All these definitions can now be written in Rust, so do so!