xd009642 / tarpaulin

A code coverage tool for Rust projects
https://crates.io/crates/cargo-tarpaulin
Apache License 2.0
2.5k stars 180 forks source link

Failure to build on Debian testing on arm64 VM (M2 MacBook) #1135

Closed xfbs closed 1 year ago

xfbs commented 1 year ago

When trying to install it with

cargo install cargo-tarpaulin

On Debian unstable, I get the following error:

error[E0412]: cannot find type `Persona` in this scope
  --> /home/patrick/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-tarpaulin-0.22.0/src/process_handling/linux.rs:24:26
   |
24 | const ADDR_NO_RANDOMIZE: Persona = 0x004_0000;
   |                          ^^^^^^^ not found in this scope

error[E0412]: cannot find type `Persona` in this scope
  --> /home/patrick/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-tarpaulin-0.22.0/src/process_handling/linux.rs:25:20
   |
25 | const GET_PERSONA: Persona = 0xFFFF_FFFF;
   |                    ^^^^^^^ not found in this scope

error[E0412]: cannot find type `Persona` in this scope
  --> /home/patrick/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-tarpaulin-0.22.0/src/process_handling/linux.rs:74:25
   |
74 | fn personality(persona: Persona) -> nix::Result<c_int> {
   |                         ^^^^^^^ not found in this scope

error[E0425]: cannot find value `INT` in this scope
  --> /home/patrick/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-tarpaulin-0.22.0/src/process_handling/breakpoint.rs:60:21
   |
60 |         intdata |= (INT << self.shift) as i64;
   |                     ^^^ not found in this scope

Using Rust 1.65:

$ rustc --version
rustc 1.65.0 (897e37553 2022-11-02)

I'm assuming the expected behaviour is that it should build correctly.

xd009642 commented 1 year ago

Ah so this should be fixed in the develop branch, let me cut a new release so you can get it via cargo install easily

xfbs commented 1 year ago

Thanks for the quick reply!

The initial issue seems to have been resolved, however now I get a different error:

error[E0412]: cannot find type `ProcessInfo` in this scope
  --> /home/patrick/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-tarpaulin-0.23.0/src/event_log.rs:57:57
   |
55 | impl TraceEvent {
   |     - help: you might be missing a type parameter: `<ProcessInfo>`
56 |     #[cfg(target_os = "linux")]
57 |     pub(crate) fn new_from_action(action: &TracerAction<ProcessInfo>) -> Self {
   |                                                         ^^^^^^^^^^^ not found in this scope

For more information about this error, try `rustc --explain E0412`.
error: could not compile `cargo-tarpaulin` due to previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-tarpaulin v0.23.0`, intermediate artifacts can be found at `/tmp/cargo-installT6G3PX`

I get the same error by cloning the repo and building the master branch:

error[E0412]: cannot find type `ProcessInfo` in this scope
  --> src/event_log.rs:57:57
   |
55 | impl TraceEvent {
   |     - help: you might be missing a type parameter: `<ProcessInfo>`
56 |     #[cfg(target_os = "linux")]
57 |     pub(crate) fn new_from_action(action: &TracerAction<ProcessInfo>) -> Self {
   |                                                         ^^^^^^^^^^^ not found in this scope

warning: unused import: `TraceMap`
 --> src/event_log.rs:7:31
  |
7 | use crate::traces::{Location, TraceMap};
  |                               ^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

For more information about this error, try `rustc --explain E0412`.
warning: `cargo-tarpaulin` (lib) generated 1 warning
error: could not compile `cargo-tarpaulin` due to previous error; 1 warning emitted

I'm guessing this is because I'm on arm64 and it doesn't support ptrace?

xd009642 commented 1 year ago

ah I'm an idiot who forgot to fix one of the cfg's, I'll do that and a new patch release

xd009642 commented 1 year ago

Okay CI is triggered for the patch release, hopefully 0.23.1 will work for you and be up on crates.io in 10-20 minutes

xd009642 commented 1 year ago

Going to close this as another release is out and people have tested on m1 and aarch64 windows so confident this is now sorted. Let me know if you have any other issues though