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

Could not install the package #415

Closed
Quadriphobs1 opened this issue May 2, 2020 · 8 comments
Closed

Could not install the package #415

Quadriphobs1 opened this issue May 2, 2020 · 8 comments

Comments

@Quadriphobs1
Copy link

When running the command on a fresh install I get the error

cargo install cargo-tarpaulin
error: cannot find macro `trace` in this scope
  --> /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cargo-tarpaulin-0.12.3/src/process_handling/mac.rs:10:9
   |
10 |         trace!("Can't initialise posix_spawnattr_t");
   |         ^^^^^

error: cannot find macro `trace` in this scope
  --> /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cargo-tarpaulin-0.12.3/src/process_handling/mac.rs:17:9
   |
17 |         trace!("Failed to set spawn flags");
   |         ^^^^^

error[E0433]: failed to resolve: use of undeclared type or module `Options`
  --> /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cargo-tarpaulin-0.12.3/src/ptrace_control.rs:13:28
   |
13 |     let options: Options = Options::PTRACE_O_TRACESYSGOOD
   |                            ^^^^^^^ use of undeclared type or module `Options`

error[E0433]: failed to resolve: use of undeclared type or module `Options`
  --> /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cargo-tarpaulin-0.12.3/src/ptrace_control.rs:14:11
   |
14 |         | Options::PTRACE_O_TRACEEXEC
   |           ^^^^^^^ use of undeclared type or module `Options`

error[E0433]: failed to resolve: use of undeclared type or module `Options`
  --> /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cargo-tarpaulin-0.12.3/src/ptrace_control.rs:15:11
   |
15 |         | Options::PTRACE_O_TRACEEXIT
   |           ^^^^^^^ use of undeclared type or module `Options`

error[E0433]: failed to resolve: use of undeclared type or module `Options`
  --> /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cargo-tarpaulin-0.12.3/src/ptrace_control.rs:16:11
   |
16 |         | Options::PTRACE_O_TRACECLONE
   |           ^^^^^^^ use of undeclared type or module `Options`

error[E0433]: failed to resolve: use of undeclared type or module `Options`
  --> /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cargo-tarpaulin-0.12.3/src/ptrace_control.rs:17:11
   |
17 |         | Options::PTRACE_O_TRACEFORK
   |           ^^^^^^^ use of undeclared type or module `Options`

error[E0433]: failed to resolve: use of undeclared type or module `Options`
  --> /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cargo-tarpaulin-0.12.3/src/ptrace_control.rs:18:11
   |
18 |         | Options::PTRACE_O_TRACEVFORK;
   |           ^^^^^^^ use of undeclared type or module `Options`

error[E0412]: cannot find type `ProcessInfo` in this scope
  --> /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cargo-tarpaulin-0.12.3/src/breakpoint.rs:77:37
   |
27 | impl Breakpoint {
   |     - help: you might be missing a type parameter: `<ProcessInfo>`
...
77 |     ) -> Result<(bool, TracerAction<ProcessInfo>)> {
   |                                     ^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `posix_spawn_attr_init` in this scope
    --> /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cargo-tarpaulin-0.12.3/src/process_handling/mac.rs:8:19
     |
8    |     let mut res = posix_spawn_attr_init(&mut attr);
     |                   ^^^^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `posix_spawnattr_init`
     | 
    ::: /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/libc-0.2.69/src/unix/bsd/apple/mod.rs:3623:5
     |
3623 |     pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
     |     --------------------------------------------------------------------- similarly named function `posix_spawnattr_init` defined here

error[E0425]: cannot find function `nullptr` in module `ptr`
  --> /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cargo-tarpaulin-0.12.3/src/process_handling/mac.rs:29:14
   |
29 |         ptr::nullptr(),
   |              ^^^^^^^ not found in `ptr`

error[E0412]: cannot find type `Options` in this scope
   --> /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cargo-tarpaulin-0.12.3/src/ptrace_control.rs:13:18
    |
13  |       let options: Options = Options::PTRACE_O_TRACESYSGOOD
    |                    ^^^^^^^ help: an enum with a similar name exists: `Option`

error[E0425]: cannot find function `setoptions` in this scope
  --> /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cargo-tarpaulin-0.12.3/src/ptrace_control.rs:19:5
   |
19 |     setoptions(pid, options)
   |     ^^^^^^^^^^ help: a local variable with a similar name exists: `options`

error[E0425]: cannot find function `ptrace` in this scope
  --> /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cargo-tarpaulin-0.12.3/src/ptrace_control.rs:63:9
   |
63 |         ptrace(
   |         ^^^^^^ not found in this scope
   |
help: possible candidate is found in another module, you can import it into scope
   |
1  | use libc::ptrace;
   |

error[E0425]: cannot find function `getevent` in this scope
  --> /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cargo-tarpaulin-0.12.3/src/ptrace_control.rs:77:5
   |
77 |     getevent(pid)
   |     ^^^^^^^^ not found in this scope

error[E0425]: cannot find function `limit_affinity` in this scope
   --> /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cargo-tarpaulin-0.12.3/src/lib.rs:130:21
    |
130 |     if let Err(e) = limit_affinity() {
    |                     ^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `create_state_machine` in this scope
   --> /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cargo-tarpaulin-0.12.3/src/lib.rs:164:37
    |
164 |         let (mut state, mut data) = create_state_machine(test, &mut traces, config);
    |                                     ^^^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `execute` in this scope
   --> /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cargo-tarpaulin-0.12.3/src/lib.rs:222:5
    |
222 |     execute(exec_path, &argv, envars.as_slice())
    |     ^^^^^^^
    | 
   ::: /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/nix-0.17.0/src/unistd.rs:734:1
    |
734 | pub fn execve(path: &CStr, args: &[&CStr], env: &[&CStr]) -> Result<Void> {
    | ------------------------------------------------------------------------- similarly named function `execve` defined here
    |
help: a function with a similar name exists
    |
222 |     execve(exec_path, &argv, envars.as_slice())
    |     ^^^^^^
help: possible candidate is found in another module, you can import it into scope
    |
1   | use crate::process_handling::mac::execute;
    |

error[E0308]: mismatched types
  --> /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cargo-tarpaulin-0.12.3/src/ptrace_control.rs:36:5
   |
35 | pub fn read_address(pid: Pid, address: u64) -> Result<c_long> {
   |                                                -------------- expected `std::result::Result<i64, nix::Error>` because of return type
36 |     read(pid, address as AddressType)
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i64`, found `i32`
   |
   = note: expected enum `std::result::Result<i64, _>`
              found enum `std::result::Result<i32, _>`

error[E0308]: mismatched types
  --> /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cargo-tarpaulin-0.12.3/src/ptrace_control.rs:40:40
   |
40 |     write(pid, address as AddressType, data as *mut c_void)
   |                                        ^^^^^^^^^^^^^^^^^^^ expected `i32`, found *-ptr
   |
   = note:     expected type `i32`
           found raw pointer `*mut core::ffi::c_void`

error[E0599]: no variant or associated item named `PTRACE_PEEKUSER` found for enum `nix::sys::ptrace::bsd::Request` in the current scope
  --> /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cargo-tarpaulin-0.12.3/src/ptrace_control.rs:48:22
   |
48 |             Request::PTRACE_PEEKUSER as RequestType,
   |                      ^^^^^^^^^^^^^^^ variant or associated item not found in `nix::sys::ptrace::bsd::Request`

error[E0308]: mismatched types
  --> /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cargo-tarpaulin-0.12.3/src/ptrace_control.rs:50:13
   |
50 |             RIP as *mut c_void,
   |             ^^^^^^^^^^^^^^^^^^ expected `i8`, found enum `core::ffi::c_void`
   |
   = note: expected raw pointer `*mut i8`
              found raw pointer `*mut core::ffi::c_void`

error[E0308]: mismatched types
  --> /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cargo-tarpaulin-0.12.3/src/ptrace_control.rs:51:13
   |
51 |             ptr::null_mut() as *mut c_void,
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found *-ptr
   |
   = note:     expected type `i32`
           found raw pointer `*mut core::ffi::c_void`

error[E0308]: mismatched types
  --> /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cargo-tarpaulin-0.12.3/src/ptrace_control.rs:55:61
   |
55 |         Ok(..) | Err(Error::Sys(Errno::UnknownErrno)) => Ok(ret),
   |                                                             ^^^
   |                                                             |
   |                                                             expected `i64`, found `i32`
   |                                                             help: you can convert an `i32` to `i64`: `ret.into()`

error[E0308]: `match` arms have incompatible types
  --> /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cargo-tarpaulin-0.12.3/src/ptrace_control.rs:56:26
   |
54 | /     match Errno::result(ret) {
55 | |         Ok(..) | Err(Error::Sys(Errno::UnknownErrno)) => Ok(ret),
   | |                                                          ------- this is found to be of type `std::result::Result<i64, nix::Error>`
56 | |         err @ Err(..) => err,
   | |                          ^^^ expected `i64`, found `i32`
57 | |     }
   | |_____- `match` arms have incompatible types
   |
   = note: expected enum `std::result::Result<i64, _>`
              found enum `std::result::Result<i32, _>`

error[E0599]: no variant or associated item named `PTRACE_POKEUSER` found for enum `nix::sys::ptrace::bsd::Request` in the current scope
  --> /Users/phobia/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cargo-tarpaulin-0.12.3/src/ptrace_control.rs:64:22
   |
64 |             Request::PTRACE_POKEUSER,
   |                      ^^^^^^^^^^^^^^^ variant or associated item not found in `nix::sys::ptrace::bsd::Request`

error: aborting due to 26 previous errors

Some errors have detailed explanations: E0308, E0412, E0425, E0433, E0599.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `cargo-tarpaulin`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-tarpaulin v0.12.3`, intermediate artifacts can be found at `/var/folders/tz/n03kt79s3kq3y92jbyhfj53m0000gn/T/cargo-installrFzgKP`

Caused by:
  build failed
@pato
Copy link

pato commented May 2, 2020

can confirm I am encountering this error as well using cargo --version cargo 1.43.0 (3532cf738 2020-03-17)

the error happens while Compiling cargo-tarpaulin v0.12.3

@Quadriphobs1
Copy link
Author

For now, I am using

docker run --security-opt seccomp=unconfined -v "${PWD}:/volume" xd009642/tarpaulin:develop-nightly bash -c 'cargo build && cargo tarpaulin -o Lcov'

@xd009642
Copy link
Owner

xd009642 commented May 2, 2020

Looking at the stack trace are you trying to install for mac? If so Mac support isn't yet developed so it won't work

@Quadriphobs1
Copy link
Author

Ohhhh, yeah its mac...

@xd009642
Copy link
Owner

xd009642 commented May 2, 2020

There's a tracking issue for OSX support, it's definitely an area I'd appreciate some help with though I need to put more time into it! #152

@pato
Copy link

pato commented May 2, 2020

completely glossed over the fact that macOS is not supported! thanks for the info! will probably do in docker or CI then.

interesting, thanks for pointing to the state of macOS support I'll check it out!

@pato
Copy link

pato commented May 2, 2020

plus I have coverage working with CLion + Rust plugin on my Mac so I know it must be possible :)

@xd009642
Copy link
Owner

xd009642 commented May 3, 2020

@pato that's probably with kcov, it has mac support!

I'm going to close this as the issue seems solved for you both 😄

@xd009642 xd009642 closed this as completed May 3, 2020
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

3 participants