mozilla / grcov

Rust tool to collect and aggregate code coverage data for multiple source files
Mozilla Public License 2.0
1.19k stars 150 forks source link

Raw profile version mismatch, no profile can be merged #1192

Open krutikavk opened 4 months ago

krutikavk commented 4 months ago

I am running grcov version 0.8.19. These commands are run while building a docker image.

# grcov . --binary-path ./target/debug/ -s . -t cobertura --branch --ignore "/usr/local/cargo/registry/src/*" --ignore "target/debug/build/*" --ignore-not-existing -o cobertura.xml
warning: /tmp/.tmp19Qt9s/your_name-44339-17502799998092809597_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-9158759217094327400_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-7501208917404945041_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-13270037394606933052_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-8743490592557869159_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-2375892149045421549_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-2872120391075039859_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-11749002186777617086_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-6781782906314919173_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-4914223165109260145_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-17508309240560236610_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-16656752675970716091_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-3032205103762253862_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-9100012188543526010_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-6197172914539107828_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-16188047588567888364_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-11169746539484885385_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-6221101367089580186_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-16536375745670583370_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-350401197832019317_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-5642246132295438438_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-4931560009387812366_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-14828543263419433666_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-12535907127121262262_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-5911279517987159209_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-11496417048161941008_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-629568452515060059_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-14792302154285757237_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-9574693037801601652_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-7684970126700556088_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-12167778314431746313_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-7447742854551523976_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44645-9996120070111668894_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-6236876619964006501_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
warning: /tmp/.tmp19Qt9s/your_name-44339-10219616926236159571_0_1.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10
PLEASE update this tool to version in the raw profile, or regenerate raw profile with expected version.
error: no profile can be merged
16:37:50 [ERROR] Error while executing llvm tools: Failure while running "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" "merge" "-f" "-" "-sparse" "-o" "/tmp/.tmp19Qt9s/1/grcov.profdata"

Here are rust, rustup, grcov versions:

# rustup --version
rustup 1.25.1 (bb60b1e89 2022-07-12)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.82.0-nightly (8e86c9567 2024-08-01)`
# grcov --version
grcov 0.8.19

Operating system is Debian GNU/Linux 11 (bullseye).

I am following all the steps mentioned in documentation. How to fix this error?

bobsaintcool commented 1 month ago

Same, I've also tried with grcov 0.8.20 from crate.io. Same result.

mrwsl commented 1 month ago

Basically, you have a mismatch between your system's LLVM version (the one you compile your code with, I guess) and the one that is shipped by rust. You can check rust's version by:

rustc --version --verbose
bobsaintcool commented 1 month ago
$ rustc --version --verbose
rustc 1.81.0 (eeb90cda1 2024-09-04)
binary: rustc
commit-hash: eeb90cda1969383f56a2637cbd3037bdf598841c
commit-date: 2024-09-04
host: x86_64-unknown-linux-gnu
release: 1.81.0
LLVM version: 18.1.7

It seems you are right, my LLVM is now 18.1.8:

pacman -Qi llvm
Name            : llvm
Version         : 18.1.8-4
Description     : Compiler infrastructure
Architecture    : x86_64
URL             : https://llvm.org/
Licenses        : Apache-2.0 WITH LLVM-exception
Groups          : None
Provides        : None
Depends On      : llvm-libs  perl
Optional Deps   : None
Required By     : None
Optional For    : diffoscope
Conflicts With  : None
Replaces        : None
Installed Size  : 108.32 MiB
Packager        : Evangelos Foutras <foutrelis@archlinux.org>
Build Date      : Wed Jul 17 19:01:26 2024
Install Date    : Mon Oct 14 17:56:45 2024
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature
theory commented 3 weeks ago

I'm seeing the same thing on macOS where I use Homebrew LLVM.

❯ rustc --version --verbose
rustc 1.82.0 (f6e511eec 2024-10-15)
binary: rustc
commit-hash: f6e511eec7342f59a25f7c0534f1dbea00d01b14
commit-date: 2024-10-15
host: aarch64-apple-darwin
release: 1.82.0
LLVM version: 19.1.1

❯ brew info llvm                                                      
==> llvm: stable 19.1.3 (bottled), HEAD [keg-only]
Next-gen compiler infrastructure
https://llvm.org/
Installed
/opt/homebrew/Cellar/llvm/19.1.3 (8,053 files, 1.9GB)
  Poured from bottle using the formulae.brew.sh API on 2024-11-06 at 10:53:46
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/l/llvm.rb
License: Apache-2.0 WITH LLVM-exception

How do I fix this?