This is an archive of the discontinued LLVM Phabricator instance.

[test] Use abspath instead of realpath sometimes
ClosedPublic

Authored by rupprecht on Aug 3 2020, 5:41 PM.

Details

Summary

In these two cases, use of os.path.realpath is problematic:

  • The name of the compiler is significant [1] . For testing purposes, we might provide a compiler called "clang" which is actually a symlink to some build script (which does some flag processing before invoking the real clang). The destination the symlink may not be called "clang", but we still want it to be treated as such.
  • When using a build system that puts build artifacts in an arbitrary build location, and later creates a symlink for it (e.g. creates a "<lldb root>/lldbsuite/test/dotest.py" symlinks that points to "/build/artifact/<hash>/dotest.py"), looking at the realpath will not match the "test" convention required here.

[1] See Makefile.rules in the lldb tree, e.g. we use different flags if the compiler is named "clang"

Diff Detail

Event Timeline

rupprecht created this revision.Aug 3 2020, 5:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2020, 5:41 PM
rupprecht requested review of this revision.Aug 3 2020, 5:41 PM
JDevlieghere accepted this revision.Aug 3 2020, 6:35 PM
This revision is now accepted and ready to land.Aug 3 2020, 6:35 PM
This revision was automatically updated to reflect the committed changes.