[compiler-rt] c148e15 - [compiler-rt] [test] Fix NameError when loading lit.cfg.py for crt

Sergej Jaskiewicz via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 10 03:47:39 PDT 2020


Author: Sergej Jaskiewicz
Date: 2020-06-10T13:47:24+03:00
New Revision: c148e15c255ea04d898c8f7de576dbf254a22529

URL: https://github.com/llvm/llvm-project/commit/c148e15c255ea04d898c8f7de576dbf254a22529
DIFF: https://github.com/llvm/llvm-project/commit/c148e15c255ea04d898c8f7de576dbf254a22529.diff

LOG: [compiler-rt] [test] Fix NameError when loading lit.cfg.py for crt

Summary:
The `execute_external` global variable is defined in [`lit.common.cfg.py`](https://github.com/llvm/llvm-project/blob/fcfb3170a776f89dde4de8ee105c99e10660f455/compiler-rt/test/lit.common.cfg.py#L18-L27) and used here (on lines 23 and 39). However, this variable is not visible in configs that are loaded independently.

Explicitly assign it to the correct value to avoid `NameError`.

Reviewers: compnerd, phosek

Reviewed By: compnerd, phosek

Subscribers: dberris, #sanitizers

Tags: #sanitizers

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

Added: 
    

Modified: 
    compiler-rt/test/crt/lit.cfg.py

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/crt/lit.cfg.py b/compiler-rt/test/crt/lit.cfg.py
index 591ae08fd678..dc15e456fe19 100644
--- a/compiler-rt/test/crt/lit.cfg.py
+++ b/compiler-rt/test/crt/lit.cfg.py
@@ -10,6 +10,17 @@
 config.test_source_root = os.path.dirname(__file__)
 
 
+# Choose between lit's internal shell pipeline runner and a real shell.  If
+# LIT_USE_INTERNAL_SHELL is in the environment, we use that as an override.
+use_lit_shell = os.environ.get("LIT_USE_INTERNAL_SHELL")
+if use_lit_shell:
+    # 0 is external, "" is default, and everything else is internal.
+    execute_external = (use_lit_shell == "0")
+else:
+    # Otherwise we default to internal on Windows and external elsewhere, as
+    # bash on Windows is usually very slow.
+    execute_external = (not sys.platform in ['win32'])
+
 def get_library_path(file):
     cmd = subprocess.Popen([config.clang.strip(),
                             config.target_cflags.strip(),


        


More information about the llvm-commits mailing list