[PATCH] D115486: [lit] Support relative path arguments

Geoffrey Martin-Noble via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 9 17:34:53 PST 2021


GMNGeoffrey updated this revision to Diff 393347.
GMNGeoffrey added a comment.

Return absolute paths from `which`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115486/new/

https://reviews.llvm.org/D115486

Files:
  llvm/utils/lit/lit/cl_arguments.py
  llvm/utils/lit/lit/util.py


Index: llvm/utils/lit/lit/util.py
===================================================================
--- llvm/utils/lit/lit/util.py
+++ llvm/utils/lit/lit/util.py
@@ -232,7 +232,7 @@
         for ext in pathext:
             p = os.path.join(path, command + ext)
             if os.path.exists(p) and not os.path.isdir(p):
-                return os.path.normcase(os.path.normpath(p))
+                return os.path.normcase(os.path.abspath(p))
 
     return None
 
Index: llvm/utils/lit/lit/cl_arguments.py
===================================================================
--- llvm/utils/lit/lit/cl_arguments.py
+++ llvm/utils/lit/lit/cl_arguments.py
@@ -237,6 +237,10 @@
 
     opts.reports = filter(None, [opts.output, opts.xunit_xml_output, opts.resultdb_output, opts.time_trace_output])
 
+    # Convert path arguments to absolute paths, so they can be referenced
+    # anywhere.
+    opts.path = [os.path.abspath(p) for p in opts.path]
+
     return opts
 
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115486.393347.patch
Type: text/x-patch
Size: 970 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211210/968b8fa7/attachment.bin>


More information about the llvm-commits mailing list