On Wed, Oct 30, 2024 at 5:26 PM Peter Geoghegan <p...@bowt.ie> wrote:
> I use Debian unstable for most of my day to day work. Apparently
> Debian unstable has exactly the same version of lcov as Ubuntu 24.04.
>
> I've also been unable to generate coverage reports for some time (at
> least on Debian, with LCOV version 2.0-1).

I found a temporary workaround. I'm now once again able to produce
html coverage reports on my Debian unstable workstation. Here's what I
did:

I found that a local installation of lcov 1.16 worked. I cloned the
lcov git repo, and checked out the tag 'v1.16'. I then installed this
older lcov version to a directory under my home directory.

It was also necessary to convince the build system to use my
known-good version of lcov. I had to use autoconf here, since (if I'm
not mistaken) only autoconf will accept specific instructions as to
which gcov, lcov, and genhtml to use (via environment variables). I
also used a relatively old version of GCC, taken from the "gcc-11"
package (not sure if that part was really necessary).

I adding something along these lines to the zsh function that runs
"configure" for me, to automate the process going forward:

  export CC="gcc-11"  # Provided by gcc-11 package
  export GCOV="gcov-11" # Provided by gcc-11 package
  export LCOV="/home/pg/.../lcov"  # Provided by local lcov 1.16 installation
  export GENHTML="/home/pg/.../genhtml"  # Provided by local lcov 1.16
installation

>From here I ran the standard, documented procedure: I ran configure
(through the zsh function), built Postgres in the usual way, ran the
tests in the usual way, and finally ran "make coverage-html". The
final html report looks very similar to the one from
coverage.postgresql.org.

(There were some geninfo warnings about certain files not having any
coverage whatsoever, but I'm pretty sure that that's normal.)

-- 
Peter Geoghegan


Reply via email to