chore: Fix gcov lib coverage build failure on macOS - #6350
Merged
bthomee merged 4 commits intoFeb 12, 2026
Merged
Conversation
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
pratikmankawde
marked this pull request as draft
February 11, 2026 14:54
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #6350 +/- ##
=======================================
Coverage 79.9% 79.9%
=======================================
Files 840 840
Lines 65508 65508
Branches 7254 7252 -2
=======================================
Hits 52346 52346
Misses 13162 13162 🚀 New features to boost your workflow:
|
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
pratikmankawde
marked this pull request as ready for review
February 11, 2026 17:14
…tionally-links-gcov-breaks-macosapple-clang
mathbunnyru
approved these changes
Feb 12, 2026
mathbunnyru
left a comment
Contributor
There was a problem hiding this comment.
Great change and description 👍
And probably the longest branch name I've seen in a while 😂
gcov lib coverage build failure on macOS
bthomee
deleted the
pratik/6349-fix-codecoveragecmake-unconditionally-links-gcov-breaks-macosapple-clang
branch
February 12, 2026 11:11
beartec-jpg
pushed a commit
to beartec-jpg/FalconLedger
that referenced
this pull request
Jun 1, 2026
For coverage builds, we try to link against the `gcov` library (specific to the environment). But as macOS doesn't have this library and thus doesn't have the coverage tools to generate reports, the coverage builds on that platform were failing on linking. We actually don't need to explicitly force this linking, as the `CodeCoverage` file already has correct detection logic (currently on lines 177-193), which is invoked when the `--coverage` flag is provided: * AppleClang: Uses `xcrun -f llvm-cov` to set `GCOV_TOOL="llvm-cov gcov"`. * Clang: Finds `llvm-cov` to set `GCOV_TOOL="llvm-cov gcov"`. * GCC: Finds `gcov` to set `GCOV_TOOL="gcov"`. The `GCOV_TOOL` is then passed to `gcovr` on line 416, so the correct tool is used for processing coverage data. This change therefore removes the `gcov` suffix from lines 473 and 475 in the `CodeCoverage.cmake` file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
High Level Overview of Change
Coverage builds on MacOS were failing on linking. This PR fixes the linking option.
This CI run shows that the build succeeds. MacOS image doesn't have coverage tools to generate reports hence the CI job fails.
https://github.com/XRPLF/rippled/actions/runs/21911026127/job/63264800263?pr=6350
Context of Change
For coverage builds, we try to link against the
gcovlibrary (specific to the environment). But Apple doesn't have this library. So, we don't need to explicitly force this linking. CodeCoverage.cmake:472-473I removed the gcov suffix from both lines. The --coverage flag already:
On GCC: Automatically links against libgcov.a
On Clang/Apple Clang: Automatically links against the LLVM profile runtime
Why It Now Works on All Three Compilers
The file already had correct detection logic (lines 177-193):
Apple Clang: Uses xcrun -f llvm-cov → sets GCOV_TOOL="llvm-cov gcov"
Regular Clang: Finds llvm-cov → sets GCOV_TOOL="llvm-cov gcov"
GCC: Finds gcov → sets GCOV_TOOL="gcov"
The GCOV_TOOL is then passed to gcovr at line 416, so the correct tool is used for processing coverage data.
The fix ensures the linker flags are correct for all three compiler types.
Fixes #6349.
Type of Change
.gitignore, formatting, dropping support for older tooling)