Skip to content

gh-151001: fix coverage-lcov target for lcov v2.x#151008

Open
Aniketsy wants to merge 2 commits into
python:mainfrom
Aniketsy:fix-151001
Open

gh-151001: fix coverage-lcov target for lcov v2.x#151008
Aniketsy wants to merge 2 commits into
python:mainfrom
Aniketsy:fix-151001

Conversation

@Aniketsy
Copy link
Copy Markdown
Contributor

@Aniketsy Aniketsy commented Jun 6, 2026

@Aniketsy Aniketsy changed the title gh- 151001: fix coverage-lcov target for lcov v2.x gh-151001: fix coverage-lcov target for lcov v2.x Jun 6, 2026
Comment thread Makefile.pre.in
--directory $(abs_builddir) \
--base-directory $(realpath $(abs_builddir)) \
--path $(realpath $(abs_srcdir)) \
--ignore-errors negative \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

geninfo: ERROR: Unexpected negative count '-1' for branch 1 of /mnt/d/cpython/cpython/Modules/getpath.c:944.
        Perhaps you need to compile with '-fprofile-update=atomic
        (use "geninfo --ignore-errors negative ..." to bypass this error)
make: *** [Makefile:1070: coverage-lcov] Error 1

i added after getting error ..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, but it looks off, as in diff it looks like --ignore-errors negative \ is added as replacement, should add this below one line, Do you have any suggestion for me ? thanks

Comment thread Makefile.pre.in
@lcov $(COVERAGE_LCOV_OPTIONS) --capture \
--directory $(abs_builddir) \
--base-directory $(realpath $(abs_builddir)) \
--path $(realpath $(abs_srcdir)) \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this argument was needed before?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--path was added in 2013 (commit 49e52f9) with --base-directory, but the commit message doesn't explain its specific purpose but further it was changed, and now means "Strip PATH from tracefile when applying diff"

(.venv) aniket@DESKTOP-074O80J:/mnt/d/cpython/cpython$ lcov --help | grep path
  -b, --base-directory DIR        Use DIR as base directory for relative paths
      --path PATH                 Strip PATH from tracefile when applying diff
      --list-full-path            Print full path during a list operation

@skirpichev
Copy link
Copy Markdown
Member

Please add news.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"make coverage-lcov" doesn't work with lcov v2.x

2 participants