May I use an already generated artifact from cargo build to run cargo-llvm-cov without recompiling again?

70 views Asked by At

Context

I have a Rust project with a CI set as follow:

  1. Job 1 rust_build: I build the project and cache the generated artifacts.
  2. Job 2 rust_test: I download the cache (hence, the artifacts in the target/ dir), then I run cargo llvm-cov to run tests and generate a report.

Problem

My problem is that the rust_test job retriggers a full compilation, I hoped to leverage the already generated artifacts from rust_build previous job and spare me a huge time.

Attempts

  1. I tried to copy generated artifacts into target/llvm-cov-target
  2. I also tried to set-up the CARGO_LLVM_COV_TARGET_DIR environment variable directly to target/ that contains all artifacts from previous cargo build (See Environment variables - cargo-llvm-cov), without success.

I may be missing the whole point, maybe cargo llvm-cov needs to recompile to work properly but I couldn't find anything.

Is there a solution to use already compiled artifacts to spare some compilation time with cargo-llvm-cov?

0

There are 0 answers