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

backtrace 0.3.11 fails to compile on Rust versions < 1.30.0. backtrace 0.3.10 did. #136

Closed
paul-tcell opened this issue Dec 11, 2018 · 19 comments

Comments

@paul-tcell
Copy link

here's the errors with rust 1.29.2:

error[E0308]: mismatched types
   --> /home/paul/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.11/src/symbolize/libbacktrace.rs:156:60
    |
156 |         STATE = bt::backtrace_create_state(ptr::null(), 0, error_cb,
    |                                                            ^^^^^^^^ expected enum `std::os::raw::c_void`, found enum `libc::c_void`
    |
    = note: expected type `extern "C" fn(*mut std::os::raw::c_void, *const i8, i32)`
               found type `extern "C" fn(*mut libc::c_void, *const i8, i32) {symbolize::libbacktrace::error_cb}`

   Compiling phf_generator v0.7.23
error[E0308]: mismatched types
   --> /home/paul/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.11/src/symbolize/libbacktrace.rs:172:36
    |
172 |                                    pcinfo_cb, error_cb,
    |                                    ^^^^^^^^^ expected enum `std::os::raw::c_void`, found enum `libc::c_void`
    |
    = note: expected type `extern "C" fn(*mut std::os::raw::c_void, usize, *const i8, i32, *const i8) -> i32`
               found type `extern "C" fn(*mut libc::c_void, usize, *const i8, i32, *const i8) -> i32 {symbolize::libbacktrace::pcinfo_cb}`

error[E0308]: mismatched types
   --> /home/paul/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.11/src/symbolize/libbacktrace.rs:172:47
    |
172 |                                    pcinfo_cb, error_cb,
    |                                               ^^^^^^^^ expected enum `std::os::raw::c_void`, found enum `libc::c_void`
    |
    = note: expected type `extern "C" fn(*mut std::os::raw::c_void, *const i8, i32)`
               found type `extern "C" fn(*mut libc::c_void, *const i8, i32) {symbolize::libbacktrace::error_cb}`

   Compiling uuid v0.7.1
error[E0308]: mismatched types
   --> /home/paul/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.11/src/symbolize/libbacktrace.rs:176:31
    |
176 |                               syminfo_cb, error_cb,
    |                               ^^^^^^^^^^ expected enum `std::os::raw::c_void`, found enum `libc::c_void`
    |
    = note: expected type `extern "C" fn(*mut std::os::raw::c_void, usize, *const i8, usize, usize)`
               found type `extern "C" fn(*mut libc::c_void, usize, *const i8, usize, usize) {symbolize::libbacktrace::syminfo_cb}`

error[E0308]: mismatched types
   --> /home/paul/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.11/src/symbolize/libbacktrace.rs:176:43
    |
176 |                               syminfo_cb, error_cb,
    |                                           ^^^^^^^^ expected enum `std::os::raw::c_void`, found enum `libc::c_void`
    |
    = note: expected type `extern "C" fn(*mut std::os::raw::c_void, *const i8, i32)`
               found type `extern "C" fn(*mut libc::c_void, *const i8, i32) {symbolize::libbacktrace::error_cb}`

error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0308`.
@alexcrichton
Copy link
Member

Ah ok, makes sense with Rust 1.29! I personally try to support the latest stable and previous stable, but further back I don't do so myself but am willing to review PRs for!

@nacardin
Copy link

nacardin commented Dec 12, 2018

0.3.11 is also failing to compile on stable 1.31.0

Compiling backtrace v0.3.11
error[E0308]: mismatched types
   --> /home/nacardin/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.11/src/symbolize/libbacktrace.rs:156:60
    |
156 |         STATE = bt::backtrace_create_state(ptr::null(), 0, error_cb,
    |                                                            ^^^^^^^^ expected enum `core::ffi::c_void`, found enum `libc::c_void`
    |
    = note: expected type `extern "C" fn(*mut core::ffi::c_void, *const i8, i32)`
               found type `extern "C" fn(*mut libc::c_void, *const i8, i32) {symbolize::libbacktrace::error_cb}`

Edit: Targeting git commit 1ff8f06 instead of crates.io 0.3.11 fixes the issue for me

@alexcrichton
Copy link
Member

@nacardin where did you get the 1.31.0 compiler from? Tha's working locally for me with the 1.31.0 compiler

@ccakes
Copy link

ccakes commented Dec 12, 2018

I'm getting the same errors on 1.31.0 under CentOS 7 built using this Dockerfile. Hope a bit more info helps

[root@8650b8634778 app]# rustup show
Default host: x86_64-unknown-linux-gnu

stable-x86_64-unknown-linux-gnu (default)
rustc 1.31.0 (abe02cefd 2018-12-04)
Click for build log
[root@8650b8634778 app]# cargo build --release --target=x86_64-unknown-linux-gnu
   Compiling backtrace v0.3.11
   Compiling synstructure v0.10.1
error[E0308]: mismatched types
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.11/src/symbolize/libbacktrace.rs:156:60
    |
156 |         STATE = bt::backtrace_create_state(ptr::null(), 0, error_cb,
    |                                                            ^^^^^^^^ expected enum `core::ffi::c_void`, found enum `libc::c_void`
    |
    = note: expected type `extern "C" fn(*mut core::ffi::c_void, *const i8, i32)`
               found type `extern "C" fn(*mut libc::c_void, *const i8, i32) {symbolize::libbacktrace::error_cb}`

error[E0308]: mismatched types
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.11/src/symbolize/libbacktrace.rs:172:36
    |
172 |                                    pcinfo_cb, error_cb,
    |                                    ^^^^^^^^^ expected enum `core::ffi::c_void`, found enum `libc::c_void`
    |
    = note: expected type `extern "C" fn(*mut core::ffi::c_void, usize, *const i8, i32, *const i8) -> i32`
               found type `extern "C" fn(*mut libc::c_void, usize, *const i8, i32, *const i8) -> i32 {symbolize::libbacktrace::pcinfo_cb}`

error[E0308]: mismatched types
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.11/src/symbolize/libbacktrace.rs:172:47
    |
172 |                                    pcinfo_cb, error_cb,
    |                                               ^^^^^^^^ expected enum `core::ffi::c_void`, found enum `libc::c_void`
    |
    = note: expected type `extern "C" fn(*mut core::ffi::c_void, *const i8, i32)`
               found type `extern "C" fn(*mut libc::c_void, *const i8, i32) {symbolize::libbacktrace::error_cb}`

error[E0308]: mismatched types
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.11/src/symbolize/libbacktrace.rs:176:31
    |
176 |                               syminfo_cb, error_cb,
    |                               ^^^^^^^^^^ expected enum `core::ffi::c_void`, found enum `libc::c_void`
    |
    = note: expected type `extern "C" fn(*mut core::ffi::c_void, usize, *const i8, usize, usize)`
               found type `extern "C" fn(*mut libc::c_void, usize, *const i8, usize, usize) {symbolize::libbacktrace::syminfo_cb}`

error[E0308]: mismatched types
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.11/src/symbolize/libbacktrace.rs:176:43
    |
176 |                               syminfo_cb, error_cb,
    |                                           ^^^^^^^^ expected enum `core::ffi::c_void`, found enum `libc::c_void`
    |
    = note: expected type `extern "C" fn(*mut core::ffi::c_void, *const i8, i32)`
               found type `extern "C" fn(*mut libc::c_void, *const i8, i32) {symbolize::libbacktrace::error_cb}`

error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0308`.
error: Could not compile `backtrace`.
warning: build failed, waiting for other jobs to finish...
error: build failed
[root@8650b8634778 app]#

@vlisivka
Copy link

Same problem:

Rust (latest version via rustup):

stable-x86_64-unknown-linux-gnu (default)
rustc 1.31.0 (abe02cefd 2018-12-04)

Target: armv7-unknown-linux-gnueabihf, x86_64-unknown-linux-gnu

OS: Fedora 28

   Compiling backtrace v0.3.11                                                                                                                    
error[E0308]: mismatched types                                                                                                                    
   --> /home/vlisivka/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.11/src/symbolize/libbacktrace.rs:156:60                       
    |                                                                                                                                             
156 |         STATE = bt::backtrace_create_state(ptr::null(), 0, error_cb,                                                                        
    |                                                            ^^^^^^^^ expected enum `core::ffi::c_void`, found enum `libc::c_void`            
    |                                                                                                                                             
    = note: expected type `extern "C" fn(*mut core::ffi::c_void, *const u8, i32)`                                                                 
               found type `extern "C" fn(*mut libc::c_void, *const u8, i32) {symbolize::libbacktrace::error_cb}`                                  
                                                                                                                                                  
error[E0308]: mismatched types                                                                                                                    
   --> /home/vlisivka/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.11/src/symbolize/libbacktrace.rs:172:36                       
    |                                                                                                                                             
172 |                                    pcinfo_cb, error_cb,                                                                                     
    |                                    ^^^^^^^^^ expected enum `core::ffi::c_void`, found enum `libc::c_void`                                   
    |                                                                                                                                             
    = note: expected type `extern "C" fn(*mut core::ffi::c_void, usize, *const u8, i32, *const u8) -> i32`                                        
               found type `extern "C" fn(*mut libc::c_void, usize, *const u8, i32, *const u8) -> i32 {symbolize::libbacktrace::pcinfo_cb}`        
                                                                                                                                                  
error[E0308]: mismatched types                                                                                                                    
   --> /home/vlisivka/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.11/src/symbolize/libbacktrace.rs:172:47                       
    |                                                                                                                                             
172 |                                    pcinfo_cb, error_cb,                                                                                     
    |                                               ^^^^^^^^ expected enum `core::ffi::c_void`, found enum `libc::c_void`                         
    |                                                                                                                                             
    = note: expected type `extern "C" fn(*mut core::ffi::c_void, *const u8, i32)`                                                                 
               found type `extern "C" fn(*mut libc::c_void, *const u8, i32) {symbolize::libbacktrace::error_cb}`                                  
                                                                                                                                                  
error[E0308]: mismatched types                                                                                                                    
   --> /home/vlisivka/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.11/src/symbolize/libbacktrace.rs:176:31                       
    |                                                                                                                                             
176 |                               syminfo_cb, error_cb,                                                                                         
    |                               ^^^^^^^^^^ expected enum `core::ffi::c_void`, found enum `libc::c_void`                                       
    |                                                                                                                                             
    = note: expected type `extern "C" fn(*mut core::ffi::c_void, usize, *const u8, usize, usize)`                                                 
               found type `extern "C" fn(*mut libc::c_void, usize, *const u8, usize, usize) {symbolize::libbacktrace::syminfo_cb}`                
                                                                                                                                                  
error[E0308]: mismatched types                                                                                                                    
   --> /home/vlisivka/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.11/src/symbolize/libbacktrace.rs:176:43                       
    |                                                                                                                                             
176 |                               syminfo_cb, error_cb,                                                                                         
    |                                           ^^^^^^^^ expected enum `core::ffi::c_void`, found enum `libc::c_void`                             
    |                                                                                                                                             
    = note: expected type `extern "C" fn(*mut core::ffi::c_void, *const u8, i32)`                                                                 
               found type `extern "C" fn(*mut libc::c_void, *const u8, i32) {symbolize::libbacktrace::error_cb}`                                  
                                                                                                                                                  
error: aborting due to 5 previous errors                                                                                                          
                                                                                                                                                  
For more information about this error, try `rustc --explain E0308`.                                                                               
error: Could not compile `backtrace`.                                                                                                             

@silwol
Copy link

silwol commented Dec 12, 2018

Is it possible that this happens when not using the latest version of the libc crate? It sounds to me as if this would happen with libc crate versions before rust-lang/libc#180 got merged.

@vlisivka
Copy link

Yes, command cargo update -p libc --precise 0.2.45 fixes the problem.

@alexcrichton
Copy link
Member

Oops a mistake on my part! I've increased the version requirement of libc now

@vlisivka
Copy link

And latest version of rustc is required for latest version of libc.

@harishbm34
Copy link

harishbm34 commented Dec 12, 2018 via email

@alexcrichton
Copy link
Member

@vlisivka can you post any build errors you're getting? I don't think that's the case

@harishbm34 can you also post build errors you're getting? I'm unable to reproduce locally

@vlisivka
Copy link

@alexcrichton I already posted my error log. I have nothing to add.

@paul-tcell
Copy link
Author

builds for me with 1.31.0 on ubuntu and centos 6. Did you guys do a cargo update ? 🙂

@harishbm34
Copy link

harishbm34 commented Dec 12, 2018

@alexcrichton : I am trying to build on macOS Mojave and the rustc version :
rustc 1.31.0 (abe02cefd 2018-12-04)

Getting the same mentioned error.

Compiling semver-parser v0.7.0
Compiling libc v0.2.45 (Highlighted to show that it is picking latest version of libc)
Compiling rand_core v0.3.0
Compiling void v1.0.2
Compiling nodrop v0.1.13
Compiling cfg-if v0.1.6
Compiling stable_deref_trait v1.1.1
Compiling memoffset v0.2.1
Compiling cc v1.0.26
Compiling scopeguard v0.3.3
Compiling lazy_static v1.2.0
Compiling pkg-config v0.3.14
Compiling byteorder v1.2.7
Compiling typenum v1.10.0
Compiling futures v0.1.25
Compiling proc-macro2 v0.4.24
Compiling serde v1.0.82
Compiling lazycell v1.2.1
Compiling crunchy v0.1.6
Compiling heapsize v0.4.2
Compiling slab v0.4.1
Compiling openssl v0.10.15
Compiling version_check v0.1.5
Compiling matches v0.1.8
Compiling unicode-xid v0.1.0
Compiling foreign-types-shared v0.1.1
Compiling unicode-normalization v0.1.7
Compiling bitflags v1.0.4
Compiling lazy_static v0.2.11
Compiling httparse v1.3.3
Compiling etcommon-hexutil v0.2.4
Compiling byte-tools v0.2.0
Compiling native-tls v0.2.2
Compiling fnv v1.0.6
Compiling rustc-hex v2.0.1
Compiling ryu v0.2.7
Compiling gcc v0.3.55
Compiling itoa v0.4.3
Compiling elastic-array-plus v0.10.0
Compiling indexmap v1.0.2
Compiling odds v0.2.26
Compiling openssl-probe v0.1.2
Compiling rustc-demangle v0.1.9
Compiling try-lock v0.2.2
Compiling percent-encoding v1.0.1
Compiling string v0.1.2
Compiling safemem v0.3.0
Compiling num-traits v0.2.6
Compiling num-integer v0.1.39
Compiling language-tags v0.2.2
Compiling typeable v0.1.2
Compiling traitobject v0.1.0
Compiling scoped-tls v0.1.2
Compiling rustc-serialize v0.3.24
Compiling fake-simd v0.1.2
Compiling slab v0.3.0
Compiling sha1 v0.6.0
Compiling bitflags v0.9.1
Compiling rustc-hex v1.0.0
Compiling ed25519 v0.0.0
Compiling unicode-width v0.1.5
Compiling vec_map v0.8.1
Compiling strsim v0.7.0
Compiling ansi_term v0.11.0
Compiling rand_core v0.2.2
Compiling rand_hc v0.1.0
Compiling rand_isaac v0.1.1
Compiling rand_xorshift v0.1.0
Compiling unreachable v1.0.0
Compiling arrayvec v0.4.8
Compiling crossbeam-utils v0.6.3
Compiling log v0.4.6
Compiling owning_ref v0.4.0
Compiling semver v0.9.0
Compiling base64 v0.10.0
Compiling openssl-sys v0.9.39
Compiling backtrace-sys v0.1.24
Compiling eth-secp256k1 v0.5.7 (https://github.com/paritytech/rust-secp256k1#ccc06e74)
Compiling tokio-executor v0.1.5
Compiling unicode-bidi v0.3.4
Compiling foreign-types v0.3.2
Compiling unicase v1.4.2
Compiling secp256k1-plus v0.5.7
Compiling rust-crypto v0.2.36
Compiling etcommon-rlp v0.2.4
Compiling arrayvec v0.3.25
Compiling base64 v0.9.3
Compiling tokio-timer v0.1.2
Compiling textwrap v0.10.0
Compiling smallvec v0.6.7
Compiling crossbeam-epoch v0.6.1
Compiling lock_api v0.1.5
Compiling log v0.3.9
Compiling want v0.0.6
Compiling rustc_version v0.2.3
Compiling tokio-current-thread v0.1.4
Compiling tokio-timer v0.2.8
Compiling idna v0.1.5
Compiling iovec v0.1.2
Compiling rand v0.5.5
Compiling net2 v0.2.33
Compiling num_cpus v1.9.0
Compiling rand v0.4.3
Compiling time v0.1.40
Compiling atty v0.2.11
Compiling mime v0.2.6
Compiling crossbeam-deque v0.6.2
Compiling generic-array v0.8.3
Compiling parking_lot_core v0.3.1
Compiling rand_pcg v0.1.1
Compiling rand_chacha v0.1.0
Compiling rand v0.6.1
Compiling parking_lot_core v0.4.0
Compiling tiny-keccak v1.4.2
Compiling quote v0.6.10
Compiling ethereum-types-serialize v0.2.1
Compiling uint v0.4.1
Compiling serde_json v1.0.33
Compiling bytes v0.4.11
Compiling mio v0.6.16
Compiling futures-cpupool v0.1.8
Compiling url v1.7.2
Compiling fixed-hash v0.2.5
Compiling rand v0.3.22
Compiling clap v2.32.0
Compiling block-buffer v0.2.0
Compiling digest v0.6.2
Compiling backtrace v0.3.12
**error[E0308]: mismatched types
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.12/src/symbolize/libbacktrace.rs:156:60
|
156 | STATE = bt::backtrace_create_state(ptr::null(), 0, error_cb,
| ^^^^^^^^ expected enum std::os::raw::c_void, found enum libc::c_void
|
= note: expected type extern "C" fn(*mut std::os::raw::c_void, *const i8, i32)
found type extern "C" fn(*mut libc::c_void, *const i8, i32) {symbolize::libbacktrace::error_cb}

error[E0308]: mismatched types
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.12/src/symbolize/libbacktrace.rs:172:36
|
172 | pcinfo_cb, error_cb,
| ^^^^^^^^^ expected enum std::os::raw::c_void, found enum libc::c_void
|
= note: expected type extern "C" fn(*mut std::os::raw::c_void, usize, *const i8, i32, *const i8) -> i32
found type extern "C" fn(*mut libc::c_void, usize, *const i8, i32, *const i8) -> i32 {symbolize::libbacktrace::pcinfo_cb}

error[E0308]: mismatched types
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.12/src/symbolize/libbacktrace.rs:172:47
|
172 | pcinfo_cb, error_cb,
| ^^^^^^^^ expected enum std::os::raw::c_void, found enum libc::c_void
|
= note: expected type extern "C" fn(*mut std::os::raw::c_void, *const i8, i32)
found type extern "C" fn(*mut libc::c_void, *const i8, i32) {symbolize::libbacktrace::error_cb}

error[E0308]: mismatched types
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.12/src/symbolize/libbacktrace.rs:176:31
|
176 | syminfo_cb, error_cb,
| ^^^^^^^^^^ expected enum std::os::raw::c_void, found enum libc::c_void
|
= note: expected type extern "C" fn(*mut std::os::raw::c_void, usize, *const i8, usize, usize)
found type extern "C" fn(*mut libc::c_void, usize, *const i8, usize, usize) {symbolize::libbacktrace::syminfo_cb}

error[E0308]: mismatched types
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.12/src/symbolize/libbacktrace.rs:176:43
|
176 | syminfo_cb, error_cb,
| ^^^^^^^^ expected enum std::os::raw::c_void, found enum libc::c_void
|
= note: expected type extern "C" fn(*mut std::os::raw::c_void, *const i8, i32)
found type extern "C" fn(*mut libc::c_void, *const i8, i32) {symbolize::libbacktrace::error_cb}

error: aborting due to 5 previous errors**

For more information about this error, try rustc --explain E0308.
error: Could not compile backtrace.
warning: build failed, waiting for other jobs to finish...
error: build failed
make[1]: *** [Makefile:11: build] Error 101
make[1]: Leaving directory '/go/src/github.com/gallactic/sputnikvm-ffi/c'
make: *** [Makefile:34: deps] Error 2

@alexcrichton
Copy link
Member

Hm well ok, if y'all can give any more info to help reproduce I can help track this down, otherwise with all the info here I can't reproduce or help track it down so this'll go unfixed...

@harishbm34
Copy link

@alexcrichton : Will you be able to look into my issue which I have posted above.

@alexcrichton
Copy link
Member

@harishbm34 it unfortunately looks the same as all the others, where I can't reproduce it locally.

@harishbm34
Copy link

harishbm34 commented Dec 13, 2018 via email

@vitalyd
Copy link

vitalyd commented Dec 14, 2018

I had a similar problem (with rustc 1.31), but in the context of building backtrace-rs from Bazel using vendored versions of the crates. libc 0.2.45 does indeed solve the issue, but one needs to ensure the --cfg=core_cvoid is passed when compiling it. In my case, this wasn't happening because libc has a custom build.rs that does this, but that wasn't carried over to our Bazel build.

Not sure if this helps, but wanted to mention this in case it does.

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

8 participants