summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-09-15 02:56:40 +0000
committerZachary Turner <zturner@google.com>2017-09-15 02:56:40 +0000
commite765db3a13ea619ba6a7521e81545c96d8b336a1 (patch)
tree81429db48ab6d393a99255bb592c9b83b4b4f15c
parent973030f71da9f1620364652baca380d2df6bfd8d (diff)
Revert "[lit] Force site configs to run before source-tree configs"
This patch is still breaking several multi-stage compiler-rt bots. I already know what the fix is, but I want to get the bots green for now and then try re-applying in the morning. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313335 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/lit.common.cfg11
-rw-r--r--test/profile/lit.cfg11
-rw-r--r--unittests/lit.common.unit.cfg2
3 files changed, 18 insertions, 6 deletions
diff --git a/test/lit.common.cfg b/test/lit.common.cfg
index 6c07ca661..4f23ab285 100644
--- a/test/lit.common.cfg
+++ b/test/lit.common.cfg
@@ -73,9 +73,10 @@ for name in possibly_dangerous_env_vars:
del config.environment[name]
# Tweak PATH to include llvm tools dir.
-if (not config.llvm_tools_dir) or (not os.path.exists(config.llvm_tools_dir)):
- lit_config.fatal("Invalid llvm_tools_dir config attribute: %r" % config.llvm_tools_dir)
-path = os.path.pathsep.join((config.llvm_tools_dir, config.environment['PATH']))
+llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
+if (not llvm_tools_dir) or (not os.path.exists(llvm_tools_dir)):
+ lit_config.fatal("Invalid llvm_tools_dir config attribute: %r" % llvm_tools_dir)
+path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH']))
config.environment['PATH'] = path
# Help MSVS link.exe find the standard libraries.
@@ -192,7 +193,7 @@ if config.host_os == 'Darwin':
else:
config.substitutions.append( ("%macos_min_target_10_11", "") )
-sancovcc_path = os.path.join(config.llvm_tools_dir, "sancov")
+sancovcc_path = os.path.join(llvm_tools_dir, "sancov")
if os.path.exists(sancovcc_path):
config.available_features.add("has_sancovcc")
config.substitutions.append( ("%sancovcc ", sancovcc_path) )
@@ -253,7 +254,7 @@ try:
stdout = subprocess.PIPE,
env=config.environment)
except OSError:
- print("Could not find llvm-config in " + config.llvm_tools_dir)
+ print("Could not find llvm-config in " + llvm_tools_dir)
exit(42)
if re.search(r'ON', llvm_config_cmd.stdout.read().decode('ascii')):
diff --git a/test/profile/lit.cfg b/test/profile/lit.cfg
index 7f0d95a9a..9ca394212 100644
--- a/test/profile/lit.cfg
+++ b/test/profile/lit.cfg
@@ -22,6 +22,17 @@ if hasattr(config, 'profile_lit_binary_dir') and \
config.profile_lit_binary_dir is not None:
config.test_exec_root = os.path.join(config.profile_lit_binary_dir, config.name)
+# If the above check didn't work, we're probably in the source tree. Use some
+# magic to re-execute from the build tree.
+if config.test_exec_root is None:
+ # The magic relies on knowing compilerrt_site_basedir.
+ compilerrt_basedir = lit_config.params.get('compilerrt_site_basedir', None)
+ if compilerrt_basedir:
+ site_cfg = os.path.join(compilerrt_basedir, 'profile', 'lit.site.cfg')
+ if os.path.exists(site_cfg):
+ lit_config.load_config(config, site_cfg)
+ raise SystemExit
+
if config.host_os in ['Linux']:
extra_link_flags = ["-ldl"]
else:
diff --git a/unittests/lit.common.unit.cfg b/unittests/lit.common.unit.cfg
index 31206e913..b08c1fe12 100644
--- a/unittests/lit.common.unit.cfg
+++ b/unittests/lit.common.unit.cfg
@@ -16,7 +16,7 @@ config.test_format = lit.formats.GoogleTest(llvm_build_mode, "Test")
config.suffixes = []
# Tweak PATH to include llvm tools dir.
-llvm_tools_dir = config.llvm_tools_dir
+llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
if (not llvm_tools_dir) or (not os.path.exists(llvm_tools_dir)):
lit_config.fatal("Invalid llvm_tools_dir config attribute: %r" % llvm_tools_dir)
path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH']))