[all-commits] [llvm/llvm-project] 817b3a: [test] Use abspath instead of realpath sometimes

Jordan Rupprecht via All-commits all-commits at lists.llvm.org
Tue Aug 4 08:22:33 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 817b3a6fe3a4452eb61a2503c8beaa7267ca0351
      https://github.com/llvm/llvm-project/commit/817b3a6fe3a4452eb61a2503c8beaa7267ca0351
  Author: Jordan Rupprecht <rupprecht at google.com>
  Date:   2020-08-04 (Tue, 04 Aug 2020)

  Changed paths:
    M lldb/packages/Python/lldbsuite/test/dotest.py

  Log Message:
  -----------
  [test] Use abspath instead of realpath sometimes

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"

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D85175




More information about the All-commits mailing list