public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: Andres Freund <[email protected]>
Cc: Aleksander Alekseev <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: jian he <[email protected]>
Cc: Peter Geoghegan <[email protected]>
Subject: Re: Having problems generating a code coverage report
Date: Thu, 22 Jan 2026 14:35:40 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <bxrbuxmpin6a3gunynde7c67ircaud5sxmjgid5kpidyzic55a@tqsmafqk6wah>
References: <CAH2-WzkTDv1PGhyssyHaV1smSEUNktDV3ACfwZsL-iE2=9hOVA@mail.gmail.com>
	<[email protected]>
	<CAJ7c6TPYPF93+yWi=ThKiOsnhqLpeTmctMrJWz3xRQobGSY6BA@mail.gmail.com>
	<CACJufxG+vX_pfPNJTo1WXP_QzGO1KXrVa0yYMkpBqL8nJvQ-VA@mail.gmail.com>
	<CAJ7c6TMhH2DK6uAGekrn5Xbd5PcPMkTfN4Ot2EfBkuRB3QVy7g@mail.gmail.com>
	<CAJ7c6TNg-4Lc4rXkM3SA95LCUef5QPvfiTAOAe58=8g6oenzuw@mail.gmail.com>
	<CAJ7c6TOkAMyHuNPWnF5S9ciOtB52reNgcv50XtyQNb2gY_DYyA@mail.gmail.com>
	<nqql77bmqixd232hrb6paw47evj6ramp6omsatwoofuzflcwak@j6t2wru3iqfd>
	<[email protected]>
	<bxrbuxmpin6a3gunynde7c67ircaud5sxmjgid5kpidyzic55a@tqsmafqk6wah>

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


Attachments:

  [text/x-diff] 0001-Tweak-lcov-commands.patch (992B, ../[email protected]/2-0001-Tweak-lcov-commands.patch)
  download | inline diff:
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



  [application/pgp-signature] signature.asc (833B, ../[email protected]/3-signature.asc)
  download

view thread (12+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Having problems generating a code coverage report
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox