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

report fails with: Profile uses raw profile format version = 10; expected version = 9 #379

Open
jayvdb opened this issue Aug 4, 2024 · 4 comments
Labels
C-question Category: A question

Comments

@jayvdb
Copy link

jayvdb commented Aug 4, 2024

In my workflow, this succeeds, and the expected results are uploaded into our deepsource tracker. (#375 still happens; I'll see if I can dig up some details that I can add to that)

cargo-llvm-cov llvm-cov --version
cargo-llvm-cov 0.6.11
cargo +nightly llvm-cov test --no-clean --include-build-script --branch --cobertura --output-path coverage.xml --workspace --no-fail-fast --all-features

But this fails in the same workflow with the same version of cargo-llvm-cov and all other binaries

> cargo llvm-cov report
warning: /__w/<project name>/<project name>/target/llvm-cov-target/<project name>-10069-7949258829508643699_0.profraw: raw profile version mismatch: Profile uses raw profile format version = 10; expected version = 9
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /__w/<project name>/<project name>/target/llvm-cov-target/<project name>-10475-7279976441539901951_0.profraw: raw profile version mismatch: Profile uses raw profile format version = 10; expected version = 9
...
error: no profile can be merged
error: failed to merge profile data: process didn't exit successfully: `/work/home/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata merge -sparse -f /__w/<project name>/<project name>/target/llvm-cov-target/<project name>-profraw-list -o /__w/<project name>/<project name>/target/llvm-cov-target/<project name>.profdata` (exit status: 1)
@taiki-e
Copy link
Owner

taiki-e commented Aug 4, 2024

cargo +nightly llvm-cov test --no-clean

cargo llvm-cov report

The first appears to be using nightly and the second perhaps stable.

The LLVM version used by the compiler that actually generates the profarw files and the LLVM tool that reads them (in this case, the LLVM tool included in the rustc that called report) must be compatible.
In particular, LLVM 19 (prerelease version, used in recent nightly rustc) and 18 (used in the latest stable rustc), LLVM 18 and 17 (or earlier) are incompatible.

@taiki-e taiki-e added the C-question Category: A question label Aug 4, 2024
@jayvdb
Copy link
Author

jayvdb commented Aug 4, 2024

Yup, changing it to cargo +nightly llvm-cov report fixed this problem.

Happy for this issue to be closed, unless there is some way for cargo-llvm-cov to handle this better.

@theory
Copy link

theory commented Nov 15, 2024

I'm seeing this issue since upgrading to rust 1.82.0, but in reverse:

raw profile version mismatch: Profile uses raw profile format version = 9; expected version = 10

I do not have nightly installed. What thing do I need to upgrade to get things back in sync?

uname -a
Darwin Hopper 24.1.0 Darwin Kernel Version 24.1.0: Thu Oct 10 21:03:15 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6000 arm64cargo -V
cargo 1.82.0 (8f40fc59f 2024-08-21)brew --version
Homebrew 4.4.4-76-g40f4ab2llvm-gcc --version
Apple clang version 16.0.0 (clang-1600.0.26.4)
Target: arm64-apple-darwin24.1.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/binbrew info llvm
==> llvm: stable 19.1.3 (bottled), HEAD [keg-only]

@theory
Copy link

theory commented Nov 15, 2024

Ah-hah, I figured it out: I needed to add the brew-installed llvm to my path. It includes both llvm and clang, the same version. Once I did that and cleaned out my build it started working again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-question Category: A question
Projects
None yet
Development

No branches or pull requests

3 participants