Skip to content
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

0.2.44 breaks fairly recent compiler #1136

Closed
przygienda opened this issue Nov 22, 2018 · 6 comments
Closed

0.2.44 breaks fairly recent compiler #1136

przygienda opened this issue Nov 22, 2018 · 6 comments

Comments

@przygienda
Copy link

error[E0432]: unresolved import `core::ffi::c_void`
    --> /b/prz/PVT_RIFT_184/obj//cargo_home/registry/src/github.com-1ecc6299db9ec823/libc-0.2.44/src/unix/mod.rs:1151:17
     |
1151 |         pub use core::ffi::c_void;
     |                 ^^^^^^^^^^^^^^^^^ no `c_void` in `ffi`

error[E0432]: unresolved import `core::ffi::c_void`
    --> /b/prz/PVT_RIFT_184/obj//cargo_home/registry/src/github.com-1ecc6299db9ec823/libc-0.2.44/src/unix/mod.rs:1151:17
     |
1151 |         pub use core::ffi::c_void;
     |                 ^^^^^^^^^^^^^^^^^ no `c_void` in `ffi`

error[E0641]: cannot cast to a pointer of an unknown kind
   --> /b/prz/PVT_RIFT_184/obj//cargo_home/registry/src/github.com-1ecc6299db9ec823/libc-0.2.44/src/unix/bsd/freebsdlike/mod.rs:864:56
    |
864 | pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = 0 as *mut _;
    |                                                        ^^^^^------
    |                                                             |
    |                                                             help: consider giving more type information
    |
    = note: The type information given here is insufficient to check whether the pointer cast is valid

error[E0641]: cannot cast to a pointer of an unknown kind
   --> /b/prz/PVT_RIFT_184/obj//cargo_home/registry/src/github.com-1ecc6299db9ec823/libc-0.2.44/src/unix/bsd/freebsdlike/mod.rs:865:54
    |
865 | pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = 0 as *mut _;
    |                                                      ^^^^^------
    |                                                           |
    |                                                           help: consider giving more type information
    |
    = note: The type information given here is insufficient to check whether the pointer cast is valid

error[E0641]: cannot cast to a pointer of an unknown kind
   --> /b/prz/PVT_RIFT_184/obj//cargo_home/registry/src/github.com-1ecc6299db9ec823/libc-0.2.44/src/unix/bsd/freebsdlike/mod.rs:866:58
    |
866 | pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = 0 as *mut _;
    |                                                          ^^^^^------
    |                                                               |
    |                                                               help: consider giving more type information
    |
    = note: The type information given here is insufficient to check whether the pointer cast is valid
@gnzlbg
Copy link
Contributor

gnzlbg commented Nov 22, 2018

Damn, we recently lowered the required Rust version for core::ffi::c_void, maybe that was one version too low. Which Rust version are you using? rustc --version

@gnzlbg
Copy link
Contributor

gnzlbg commented Nov 22, 2018

So I've added a build bot to check that everything still works with 1.30.0 (#1138), so that does not appear to be the case.

It would be very helpful to know which compiler version you are using, which target are you targeting (are you using your own libcore ?), and ideally a minimum working example that reproduces the issue.

@przygienda
Copy link
Author

.../rustc --version
rustc 1.30.0-nightly (f7202e40f 2018-08-27)

@przygienda
Copy link
Author

linux cross-compiling into a BSD variant ...

@gnzlbg
Copy link
Contributor

gnzlbg commented Nov 22, 2018

I see. So this breakage is intended. That nightly is both too new - part of the 1.30 cycle - and too old: older than the first nightly in the 1.30 cycle that had core::ffi::c_void type. So when libc checks for Rust version >= 1.30 that returns true for your nightly (the reason is that we only support "the latest nightly", and Rust stable 1.30 has more features than your nightly).

We could patch the build.rs to detect whether its a nightly, and its date, and only enable c_void in new enough nightlies (I don't think this is worth doing but if you send a PR I don't really mind merging it). Alternatively, you can just override the libc version to one that works (e.g. 0.2.43), or upgrade your toolchain to a newer nightly version: this PR of Sept 17 moved c_void into libcore, the next nightly toolchain might be new enough.

@gnzlbg
Copy link
Contributor

gnzlbg commented Nov 22, 2018

I'm closing this as it is probably "INVALID"/"WONT FIX".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants