tikv / pprof-rs

A Rust CPU profiler implemented with the help of backtrace-rs
Apache License 2.0
1.3k stars 99 forks source link

cross compiling failed #54

Closed cyrixSpec closed 3 years ago

cyrixSpec commented 3 years ago

Hi there, I tried to cross-compile rummqtt and got the following output.

roker/target/armv7-unknown-linux-gnueabihf/release/deps/libthiserror-eef2e33c746f6e56.rmeta --cap-lints allow`
error[E0308]: mismatched types
   --> /home/xx/.cargo/registry/src/github.com-1ecc6299db9ec823/pprof-0.4.1/src/profiler.rs:143:47
    |
143 |             write_thread_name(current_thread, &mut name);
    |                                               ^^^^^^^^^ expected slice `[u8]`, found array `[i8; 16]`
    |
    = note: expected mutable reference `&mut [u8]`
               found mutable reference `&mut [i8; 16]`

error[E0606]: casting `&mut [i8; 16]` as `*mut [u8]` is invalid
   --> /home/fwa/.cargo/registry/src/github.com-1ecc6299db9ec823/pprof-0.4.1/src/profiler.rs:141:28
    |
141 |             let name_ptr = &mut name as *mut [libc::c_char] as *mut libc::c_char;
    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0308, E0606.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `pprof`

Can you verify this? Thanks in advance.

YangKeao commented 3 years ago

It has been fixed in v0.4.2. Thanks for your report :beers: