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

Cargo-coverage will blow up if cargo build wasn't ran once #36

Open
roblabla opened this issue Mar 20, 2018 · 1 comment
Open

Cargo-coverage will blow up if cargo build wasn't ran once #36

roblabla opened this issue Mar 20, 2018 · 1 comment

Comments

@roblabla
Copy link
Owner

How to reproduce:

roblabla@roblab ~/tmp $ cargo new meh
     Created library `meh` project
roblabla@roblab ~/tmp $ cd meh/
roblabla@roblab ~/tmp/meh $ cargo coverage

Trace:

roblabla@roblab ~/tmp/meh $ env RUST_BACKTRACE=1 cargo coverage
Downloading kcov
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', libcore/result.rs:945:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at libstd/sys_common/backtrace.rs:59
             at libstd/panicking.rs:207
   3: std::panicking::default_hook
             at libstd/panicking.rs:223
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:402
   5: std::panicking::begin_panic_fmt
             at libstd/panicking.rs:349
   6: rust_begin_unwind
             at libstd/panicking.rs:325
   7: core::panicking::panic_fmt
             at libcore/panicking.rs:72
   8: core::result::unwrap_failed
             at /checkout/src/libcore/macros.rs:26
   9: <core::result::Result<T, E>>::unwrap
             at /checkout/src/libcore/result.rs:782
  10: cargo_travis::build_kcov
             at /home/roblabla/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-travis-0.0.9/src/lib.rs:141
  11: cargo_coverage::execute
             at src/bin/cargo-coverage.rs:107
  12: cargo::call_main_without_stdin
             at /home/roblabla/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-0.22.0/src/cargo/lib.rs:128
  13: cargo_coverage::main::{{closure}}
             at src/bin/cargo-coverage.rs:194
  14: cargo_coverage::main
             at src/bin/cargo-coverage.rs:185
  15: std::rt::lang_start::{{closure}}
             at /checkout/src/libstd/rt.rs:74
  16: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:306
  17: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:102
  18: std::rt::lang_start_internal
             at libstd/panicking.rs:285
             at libstd/panic.rs:361
             at libstd/rt.rs:58
  19: std::rt::lang_start
             at /checkout/src/libstd/rt.rs:74
  20: main
  21: __libc_start_main
  22: _start
@JP-Ellis
Copy link

JP-Ellis commented Sep 3, 2019

Cargo coverage also fails if $CARGO_TARGET_DIR is anything else than the default as the ./target directory need not exist. For example, I have CARGO_TARGET_DIR=$HOME/.cache/cargo.

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