Skip to content

Add path remapping with -coverage-prefix-map to coverage data #32416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

keith
Copy link
Member

@keith keith commented Jun 16, 2020

Previously the path to covered files in the __LLVM_COV / __llvm_covmap
section were absolute. This made remote builds with coverage information
difficult because all machines would have to have the same build root.
This change uses the values for -coverage-prefix-map to remap files in
the coverage info to relative paths. These paths work correctly with
llvm-cov when it is run from the same source directory as the
compilation, or from a different directory using the -path-equivalence
argument.

This is analogous to this change in clang https://reviews.llvm.org/D81122

@keith keith requested a review from a team as a code owner June 16, 2020 21:53
Previously the path to covered files in the __LLVM_COV / __llvm_covmap
section were absolute. This made remote builds with coverage information
difficult because all machines would have to have the same build root.
This change uses the values for `-coverage-prefix-map` to remap files in
the coverage info to relative paths. These paths work correctly with
llvm-cov when it is run from the same source directory as the
compilation, or from a different directory using the `-path-equivalence`
argument.

This is analogous to this change in clang https://reviews.llvm.org/D81122
@keith keith force-pushed the ks/cp-coverage-relative branch from 94ec20f to c7d7b1e Compare June 17, 2020 21:18
@varungandhi-apple
Copy link
Contributor

Previous history for context:

  1. Original patch: Add path remapping with -coverage-prefix-map to coverage data #32175
  2. Windows fix: Fix coverage test on Windows #32434
  3. Further cleanup: Improve coverage test naming #32443

@varungandhi-apple
Copy link
Contributor

@swift-ci test

@varungandhi-apple varungandhi-apple merged commit 89edca6 into swiftlang:release/5.3 Sep 11, 2020
@keith
Copy link
Member Author

keith commented Sep 11, 2020

Thanks!!

@keith keith deleted the ks/cp-coverage-relative branch February 4, 2022 17:16
@AnthonyLatsis AnthonyLatsis added swift 5.3 🍒 release cherry pick Flag: Release branch cherry picks labels Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants