cargo-llvm-cov icon indicating copy to clipboard operation
cargo-llvm-cov copied to clipboard

Recompiles workspace crates every time

Open Eugeny opened this issue 3 years ago • 5 comments

Currently, running cargo llvm-cov run recompiles the workspace crates every time, making merging multiple runs with --no-report and --no-run --html unfeasible.

Eugeny avatar Jul 24 '22 11:07 Eugeny

Could you provide an example to reproduce this?

Also, old results will be removed unless you pass --no-report to cargo llvm-cov run.

cargo llvm-cov run --no-report -- a
cargo llvm-cov run --no-report -- b
cargo llvm-cov --no-run --html

taiki-e avatar Jul 24 '22 12:07 taiki-e

I've got the repro ready and then tried putting --no-report after run, and it worked! Shame on me.

Might still be unexpected behaviour however, that:

  • --no-report before run is silently ignored and
  • --no-report affects whether a rebuild happens

Eugeny avatar Jul 24 '22 12:07 Eugeny

  • --no-report before run is silently ignored and

This is https://github.com/taiki-e/cargo-llvm-cov/issues/151, and will be fixed by https://github.com/taiki-e/cargo-llvm-cov/pull/197

  • --no-report affects whether a rebuild happens

readme example describes cargo llvm-cov clean as a command to remove artifacts.

taiki-e avatar Jul 30 '22 07:07 taiki-e

This is https://github.com/taiki-e/cargo-llvm-cov/issues/151, and will be fixed by https://github.com/taiki-e/cargo-llvm-cov/pull/197

:+1:

readme example describes cargo llvm-cov clean as a command to remove artifacts.

Sorry if I wasn't clear - I've already figured out how to do / not do a rebuild, but it's still unexpected for a new user that adding --no-report will also change the build behaviour (and not just whether a report is generated)

Eugeny avatar Jul 30 '22 14:07 Eugeny

I've already figured out how to do / not do a rebuild, but it's still unexpected for a new user that adding --no-report will also change the build behaviour (and not just whether a report is generated)

Indeed. Adding a document to mention it seems like a good idea.

taiki-e avatar Jul 30 '22 14:07 taiki-e

I see that the workspace's bin crates are recompiled everytime as well. I can reproduce with the provided repro repo. My usage:

while :; do cargo llvm-cov --all-targets --all-features --locked --frozen; done

# Note: plain cargo test call does not recompile things:
while :; do cargo test --all-targets --all-features --locked --frozen; done

Please advise.

fenollp avatar Sep 06 '22 13:09 fenollp

@fenollp adding --no-report should help. In my cases, I've ended up running it once and then running the compiled binary multiple times directly during my integration tests.

Eugeny avatar Sep 06 '22 14:09 Eugeny

Added --no-clean flag as a workaround for this. See #214 for more.

taiki-e avatar Sep 06 '22 15:09 taiki-e