This is an archive of the discontinued LLVM Phabricator instance.

Don't append the working directory to absolute paths
ClosedPublic

Authored by aprantl on Nov 11 2021, 2:35 PM.

Details

Summary

This fixes a bug that happens when using -fdebug-prefix-map to remap an absolute path to a relative path. Since the path was absolute before remapping, it is safe to assume that concatenating the remapped working directory would be wrong.

Diff Detail

Event Timeline

aprantl requested review of this revision.Nov 11 2021, 2:35 PM
aprantl created this revision.
kastiglione accepted this revision.Dec 23 2021, 1:31 PM
This revision is now accepted and ready to land.Dec 23 2021, 1:31 PM

@thakis - I think you folks over in Chrome land implemented/use -fdebug-prefix-map (or do you use -fdebug-compilation-dir?) so might be interested in this change.

This revision was landed with ongoing or failed builds.Feb 25 2022, 1:04 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 25 2022, 1:04 PM
keith added a subscriber: keith.Feb 25 2022, 2:59 PM

Breaks tests on Linux and Mac, e.g. http://45.33.8.238/linux/69643/step_7.txt and http://45.33.8.238/win/53984/step_7.txt

Please take a look and revert for now if it takes a while to fix.

@thakis - I think you folks over in Chrome land implemented/use -fdebug-prefix-map (or do you use -fdebug-compilation-dir?) so might be interested in this change.

We're using fdebug-compilation-dir. With fdebug-prefix-map, your command line flags are machine-specific, which makes builds not universally deterministic (per https://blog.llvm.org/2019/11/deterministic-builds-with-clang-and-lld.html)