[lld] r316635 - [lit] Respect LLVM_LIT_TOOLS_DIR when looking for 'tar' on Windows.

Igor Kudrin via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 25 19:31:37 PDT 2017


Author: ikudrin
Date: Wed Oct 25 19:31:36 2017
New Revision: 316635

URL: http://llvm.org/viewvc/llvm-project?rev=316635&view=rev
Log:
[lit] Respect LLVM_LIT_TOOLS_DIR when looking for 'tar' on Windows.

Changes in D38977 expect 'tar' to be found in one of PATH directories.
On Windows, one might opt to use LLVM_LIT_TOOLS_DIR rather than add MSYS
tools directory to the PATH. In that case, tests for lld failed on run.

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

Modified:
    lld/trunk/test/lit.cfg.py

Modified: lld/trunk/test/lit.cfg.py
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/lit.cfg.py?rev=316635&r1=316634&r2=316635&view=diff
==============================================================================
--- lld/trunk/test/lit.cfg.py (original)
+++ lld/trunk/test/lit.cfg.py Wed Oct 25 19:31:36 2017
@@ -83,8 +83,10 @@ if (lit.util.which('cvtres', config.envi
 if (config.llvm_libxml2_enabled == '1'):
     config.available_features.add('libxml2')
 
-tar_version = subprocess.Popen(
-    ['tar', '--version'], stdout=subprocess.PIPE, env={'LANG': 'C'})
-if 'GNU tar' in tar_version.stdout.read().decode():
-    config.available_features.add('gnutar')
-tar_version.wait()
+tar_executable = lit.util.which('tar', config.environment['PATH'])
+if tar_executable:
+    tar_version = subprocess.Popen(
+        [tar_executable, '--version'], stdout=subprocess.PIPE, env={'LANG': 'C'})
+    if 'GNU tar' in tar_version.stdout.read().decode():
+        config.available_features.add('gnutar')
+    tar_version.wait()




More information about the llvm-commits mailing list