[PATCH] D39278: [lit] Respect LLVM_LIT_TOOLS_DIR when looking for 'tar' on Windows.

Igor Kudrin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 23:44:31 PDT 2017


ikudrin created this revision.
ikudrin added a project: lld.

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


Repository:
  rL LLVM

https://reviews.llvm.org/D39278

Files:
  test/lit.cfg.py


Index: test/lit.cfg.py
===================================================================
--- test/lit.cfg.py
+++ test/lit.cfg.py
@@ -83,8 +83,10 @@
 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()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39278.120191.patch
Type: text/x-patch
Size: 799 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171025/f6260512/attachment.bin>


More information about the llvm-commits mailing list