Skip to content

Bug 2033336 - Build absolute paths relative to full GCNO path when available. - #1519

Merged
marco-c merged 2 commits into
mozilla:masterfrom
nicolas-guichard:push-pvlzyyqpussp
Sep 9, 2026
Merged

Bug 2033336 - Build absolute paths relative to full GCNO path when available.#1519
marco-c merged 2 commits into
mozilla:masterfrom
nicolas-guichard:push-pvlzyyqpussp

Conversation

@nicolas-guichard

@nicolas-guichard nicolas-guichard commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Bugzilla URL: https://bugzilla.mozilla.org/show_bug.cgi?id=2033336

When building Firefox with unified build, the GCNO files embed paths relative to the GCNO file itself.

For instance when building media/libopus, the build system generates obj-x86_64-pc-linux-gnu/media/libopus/Unified_c_media_libopus0.c, which includes ../../../media/libopus/celt/bands.c, and the GCNO ends up with the path ./../../../media/libopus/celt/bands.c.

Grcov needs to convert that back to the full path to $srcdir/media/ libopus/celt/bands.c.

Try run with this fix along with a fix for bug 2070023: https://treeherder.mozilla.org/jobs?repo=try&revision=843bcb9b6e9bc83f8d7dac2eb45f72259e06af42

@nicolas-guichard nicolas-guichard changed the title [Bug 2033336](https://bugzilla.mozilla.org/show_bug.cgi?id=2033336) - Build absolute paths relative to full GCNO path when available. Bug 2033336 - Build absolute paths relative to full GCNO path when available. Sep 8, 2026
@nicolas-guichard

Copy link
Copy Markdown
Contributor Author

The failure on nightly is caused by rust-lang/rust#161517 and unrelated to my changes.

@nicolas-guichard
nicolas-guichard force-pushed the push-pvlzyyqpussp branch 3 times, most recently from f8f2b94 to a1efc08 Compare September 8, 2026 21:01
@marco-c

marco-c commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

@nicolas-guichard could you rebase?

rust-lang/rust#161517 (part of 2026-09-07)
changed the coverage output slightly, this accepts both versions.
…malize_path fails.

When building Firefox with unified build, the GCNO files embed paths
relative to the GCNO file itself.

For instance when building media/libopus, the build system generates
obj-x86_64-pc-linux-gnu/media/libopus/Unified_c_media_libopus0.c, which
includes ../../../media/libopus/celt/bands.c, and the GCNO ends up with
the path ./../../../media/libopus/celt/bands.c.

Grcov needs to convert this back to the full path to $srcdir/media/
libopus/celt/bands.c or it fails later on when get_abs_path calls
normalize_path.
Comment thread src/llvm_tools.rs
@marco-c

marco-c commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Path handling has always been a pain... At some point we might want to simplify all of it.

BTW, I hope this change won't increase memory too much when dealing with a lot of files.

@marco-c
marco-c merged commit f79547d into mozilla:master Sep 9, 2026
10 checks passed
@nicolas-guichard
nicolas-guichard deleted the push-pvlzyyqpussp branch September 9, 2026 09:56
lando-worker Bot pushed a commit to mozilla-firefox/firefox that referenced this pull request Sep 11, 2026
This new grcov release includes a bugfix for GCNOs pointing to C++
files outside the objdir with relative paths, as we typically get when
building with unified sources.

See mozilla/grcov#1519 for details.

Differential Revision: https://phabricator.services.mozilla.com/D325306
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants