Skip to content

cargo test then cargo tarpaulin causes BorrowMut error and linking failure #9220

Closed
@xd009642

Description

@xd009642

So when running cargo test with default rust flags and then running cargo tarpaulin (version 0.18.0-alpha1) cargo can output the following error (it's called within tarpaulin)

error: Broken pipe (os error 32)
warning: build failed, waiting for other jobs to finish...
thread 'main' panicked at 'already borrowed: BorrowMutError', src/tools/cargo/src/cargo/util/config/mod.rs:307:20
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Mar 01 19:28:55.644 ERROR cargo_tarpaulin: Failed to compile tests! Error: signals: linking with `cc` failed: exit code: 1
Error: "Failed to compile tests! Error: signals: linking with `cc` failed: exit code: 1"

To recreate the error given an example project (https://github.com/Smithay/calloop) we do the following:

cargo install cargo-tarpaulin --version 0.18.0-alpha1
git clone --depth 1 https://github.com/Smithay/calloop 
cd calloop
cargo test
cargo tarpaulin

One salient note cargo tarpaulin changes the rust flags to RUSTFLAGS=" -C link-dead-code -C debuginfo=2 --cfg=tarpaulin " so I wonder if this is a case of incremental compilation going wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions