Skip to content

Commit 5dc2acd

Browse files
Only process local files with gcov
The 23.11 release of NixOS has caused GCC to mangle __FILE__ names withing the nix-store. See <NixOS/nixpkgs#255192>. This causes gcov to fail with file-not-found errors: (DEBUG) Running gcov: 'gcov /build/source/rsort.gcda --branch-counts --branch-probabilities --demangled-names --hash-filenames --object-directory /build/source' in '/build/source' (ERROR) GCOV produced the following errors processing /build/source/rsort.gcda: Cannot open source file /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-glibc-2.38-27-dev/include/bits/string_fortified.h To work around this issue we add the --relative-only flag to gcov instucting it to not consider files with absoulte paths, thus excluding header files in the nix-store. Note: these files were already filtered out by gcovr, so the resulting documentation hasn't really changed.
1 parent 5e79763 commit 5dc2acd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Simplicity.C.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{ lib, stdenv, gcovr ? null, wideMultiply ? null, withCoverage ? false
22
, production ? false
3-
, gcov-executable ? if stdenv.cc.isGNU then "gcov" else
3+
, gcov-executable ? if stdenv.cc.isGNU then "gcov -r" else
44
if stdenv.cc.isClang then "${stdenv.cc.cc.libllvm}/bin/llvm-cov gcov"
55
else null
66
, doCheck ? true

0 commit comments

Comments
 (0)