You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using your shorter steps to reproduce, I get the same output:
# grep VERSION_CODENAME /etc/os-release && lcov --version
VERSION_CODENAME=trixie
Can't locate lcovutil.pm in @INC (you may need to install the lcovutil module) (@INC contains: /usr/local/lib/lcov /etc/perl /usr/local/lib/riscv64-linux-gnu/perl/5.36.0 /usr/local/share/perl/5.36.0 /usr/lib/riscv64-linux-gnu/perl5/5.36 /usr/share/perl5 /usr/lib/riscv64-linux-gnu/perl-base /usr/lib/riscv64-linux-gnu/perl/5.36 /usr/share/perl/5.36 /usr/local/lib/site_perl) at /usr/bin/lcov line 77.
BEGIN failed--compilation aborted at /usr/bin/lcov line 102.
Looks like as of the latest Debian Sid, lcov 2 is still broken, although it's now different from above:
apt update -y && apt upgrade -y && apt install -y lcov && lcov --version
...
Setting up lcov (2.0-3) ...
Can't locate Capture/Tiny.pm in @INC (you may need to install the Capture::Tiny module) (@INC contains: /usr/lib/lcov /etc/perl /usr/local/lib/aarch64-linux-gnu/perl/5.36.0 /usr/local/share/perl/5.36.0 /usr/lib/aarch64-linux-gnu/perl5/5.36 /usr/share/perl5 /usr/lib/aarch64-linux-gnu/perl-base /usr/lib/aarch64-linux-gnu/perl/5.36 /usr/share/perl/5.36 /usr/local/lib/site_perl) at /usr/lib/lcov/lcovutil.pm line 14.BEGIN failed--compilation aborted at /usr/lib/lcov/lcovutil.pm line 14.Compilation failed in require at /usr/bin/lcov line 77.BEGIN failed--compilation aborted at /usr/bin/lcov line 102.
Can't locate Capture/Tiny.pm in @inc (you may need to install the Capture::Tiny module)
Can be fixed by apt install libcapture-tiny-perl libdatetime-perl but it's still broken after that when trying to generate coverage.
e.g. from make cov_fuzz:
geninfo: ERROR: "/workdir/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/date_time/gregorian/greg_month.hpp":40: function _ZN5boost9gregorian9bad_monthD0Ev found on line but no corresponding 'line' coverage data point. Cannot derive function end line.
I have a branch using lcov 2.0 that seems to be working. Unfortunately the configuration flags required don't work with 1.16. Here are two .zips containing the output from make_cov using 2.0, and another output using 1.16, if anyone wants to compare the difference. 116_coverage.zip 201_coverage.zip
To work without --enable-lcov-branch-coverage, it should be:
--- a/configure.ac+++ b/configure.ac@@ -842,12 +842,14 @@ if test "$use_lcov" = "yes"; then
[AC_MSG_ERROR([lcov testing requested but --coverage linker flag does not work])])
AX_CHECK_COMPILE_FLAG([--coverage],[CORE_CXXFLAGS="$CORE_CXXFLAGS --coverage"],
[AC_MSG_ERROR([lcov testing requested but --coverage flag does not work])])
- CORE_CXXFLAGS="$CORE_CXXFLAGS -Og"+ CORE_CXXFLAGS="$CORE_CXXFLAGS -Og -fprofile-update=prefer-atomic"
fi
+LCOV_OPTS="--ignore mismatch"
if test "$use_lcov_branch" != "no"; then
- AC_SUBST(LCOV_OPTS, "$LCOV_OPTS --rc lcov_branch_coverage=1")+ LCOV_OPTS="$LCOV_OPTS --rc branch_coverage=1"
fi
+AC_SUBST(LCOV_OPTS, "$LCOV_OPTS")
dnl Check for endianness
AC_C_BIGENDIAN
Ubuntu support for 23.04 ended, so with vanilla Ubuntu, the only way to go back to lcov-1 is to use 22.04 LTS.
Not sure about which devs use Ubuntu and lcov, but it seems plausible that more are using 24.04 LTS, than 22.04 LTS, so it could make sense to switch to lcov-2 going forward?
Activity
maflcko commentedon Sep 13, 2023
No idea if this is an upstream packaging bug or something else in this codebase.
Would be good to fix it either way, or migrate to llvm coverage tools?
fanquake commentedon Sep 13, 2023
Seems to be the case, as just spinning up a fresh container and trying to run
lcov --versionfails. i.e:See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1043009. Not sure if there is an easy workaround here,
and it looks like the fixed version in debian:sid still doesn't work, it fails the same as above.Looks like this is because the currentdebian:siddocker image does not yet contain the 2.0-2 version.maflcko commentedon Sep 14, 2023
Closing for now, because this is an upstream issue
maflcko commentedon Sep 14, 2023
Using your shorter steps to reproduce, I get the same output:
fanquake commentedon Sep 26, 2023
Looks like as of the latest Debian Sid, lcov 2 is still broken, although it's now different from above:
dergoegge commentedon Nov 2, 2023
Can be fixed by
apt install libcapture-tiny-perl libdatetime-perlbut it's still broken after that when trying to generate coverage.e.g. from
make cov_fuzz:maflcko commentedon Jan 25, 2024
Same here. Is there an upstream bug report?
fanquake commentedon Mar 8, 2024
I have a branch using lcov
2.0that seems to be working. Unfortunately the configuration flags required don't work with1.16. Here are two .zips containing the output frommake_covusing 2.0, and another output using1.16, if anyone wants to compare the difference.116_coverage.zip
201_coverage.zip
maflcko commentedon Mar 11, 2024
Mind sharing it?
fanquake commentedon Mar 11, 2024
https://github.com/fanquake/bitcoin/tree/support_lcov_2.
You'll also likely need to
apt install libdatetime-format-dateparse-perl.fanquake commentedon Mar 26, 2024
This has been fixed in the latest lcov: https://changelogs.ubuntu.com/changelogs/pool/universe/l/lcov/lcov_2.0-4ubuntu2/changelog.
So now an invocation like above, replaced with my branch, "just works". i.e:
hebasto commentedon May 13, 2024
To work without
--enable-lcov-branch-coverage, it should be:maflcko commentedon May 24, 2024
Ubuntu support for 23.04 ended, so with vanilla Ubuntu, the only way to go back to lcov-1 is to use 22.04 LTS.
Not sure about which devs use Ubuntu and lcov, but it seems plausible that more are using 24.04 LTS, than 22.04 LTS, so it could make sense to switch to lcov-2 going forward?
hebasto commentedon May 25, 2024
FWIW, the hebasto#191 supports both LCOV versions for CMake.
Merge #30192: build: remove `--enable-lcov-branch-coverage`
fanquake commentedon Jun 3, 2024
@maflcko was #30192 enough to close this?