On Wed, Jan 21, 2026 at 08:59:45PM -0500, Andres Freund wrote: > I have the following .lcovrc in my postgres source dir: > > ignore_errors=inconsistent,gcov,range > check_data_consistency=0 > stop_on_error=0 > genhtml_hierarchical=1 > genhtml_show_navigation=1 > parallel=16 > geninfo_gcov_tool=/usr/bin/gcov-15 > > (assuming you build with gcc 15) > > With that meson coverage information works (i.e. ninja coverage-html) for both > lcov 2.0 and 2.4 as long as the build directory is outside of the source > directory. Both on Debian Sid and macos.
Thanks for sharing. Yes, I have a matching gcc version at 15.2 currently. I have been playing with this area of the configuration for some time without finding the correct combination before giving up, and these suggestions are actually helping for meson. So now I can get a report offline. Yeah at least it's one thing working. Hmm. configure with and without VPATH still burp at me on HEAD. If I tweak the lcov commands in src/Makefile.global.in like in the attached patch then the non-VPATH build can work, where I remove the srcdir part (aka reverting c3d9a66024a9). For the VPATH build, this patch does not work at all, it generates an incomplete report, ignoring entirely contrib/, with its base index.html starting inside src/, missing a bunch of subdirectories. I can live with this custom patch for now, just wondering if anybody else sees what I am seeing for a few months now. Thoughts? At least two out of the three methods are working with the attached instead of one out of three. Not sure what to do with VPATH, but well. -- Michael
From db627eb90cf625249a670300e295cff1c69c0a88 Mon Sep 17 00:00:00 2001 From: Michael Paquier <[email protected]> Date: Thu, 22 Jan 2026 14:32:45 +0900 Subject: [PATCH] Tweak lcov commands This fixes coverage reports for non-VPATH builds, generates incorrect reports with VPATH builds. --- src/Makefile.global.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Makefile.global.in b/src/Makefile.global.in index 947a2d79e291..d066ed162034 100644 --- a/src/Makefile.global.in +++ b/src/Makefile.global.in @@ -1061,12 +1061,12 @@ LCOVFLAGS = -q --no-external all_gcno_files = $(shell find . -name '*.gcno' -print) lcov_base.info: $(all_gcno_files) - $(LCOV) $(LCOVFLAGS) -c -i -d . -d $(srcdir) -o $@ + $(LCOV) $(LCOVFLAGS) -c -i -d . -o $@ all_gcda_files = $(shell find . -name '*.gcda' -print) lcov_test.info: $(all_gcda_files) - $(LCOV) $(LCOVFLAGS) -c -d . -d $(srcdir) -o $@ + $(LCOV) $(LCOVFLAGS) -c -d . -o $@ # hook for clean-up -- 2.51.0
signature.asc
Description: PGP signature
