summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2018-11-27 19:29:12 +0000
committerZachary Turner <zturner@google.com>2018-11-27 19:29:12 +0000
commitd37fa56a8ed6d25036e5c52ab64aa8c9ec4c2068 (patch)
tree1674b9386e843f70115fd7c577dde910277088ba
parentffba54493f5d56dcf3e43d1f0bb4584b7bb721e1 (diff)
downloadbcm5719-llvm-d37fa56a8ed6d25036e5c52ab64aa8c9ec4c2068.tar.gz
bcm5719-llvm-d37fa56a8ed6d25036e5c52ab64aa8c9ec4c2068.zip
[lit] Pass more environment variables through to child processes.
This arose when I was trying to have a substitution which invoked a python script P, and that python script tried to invoke clang-cl (or even cl). Since we invoke P with a custom environment, it doesn't inherit the environment of the parent, and then when we go to invoke clang-cl, it's unable to find the MSVC installation directory. There were many more I could have passed through which are set by vcvarsall, but I tried to keep it simple and only pass through the important ones. Differential Revision: https://reviews.llvm.org/D54963 llvm-svn: 347691
-rw-r--r--llvm/utils/lit/lit/TestingConfig.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/llvm/utils/lit/lit/TestingConfig.py b/llvm/utils/lit/lit/TestingConfig.py
index 038a468d671..8060688116b 100644
--- a/llvm/utils/lit/lit/TestingConfig.py
+++ b/llvm/utils/lit/lit/TestingConfig.py
@@ -26,7 +26,16 @@ class TestingConfig:
'LSAN_OPTIONS', 'ADB', 'ANDROID_SERIAL',
'SANITIZER_IGNORE_CVE_2016_2143', 'TMPDIR', 'TMP', 'TEMP',
'TEMPDIR', 'AVRLIT_BOARD', 'AVRLIT_PORT',
- 'FILECHECK_DUMP_INPUT_ON_FAILURE', 'FILECHECK_OPTS']
+ 'FILECHECK_DUMP_INPUT_ON_FAILURE', 'FILECHECK_OPTS',
+ 'VCINSTALLDIR', 'VCToolsinstallDir', 'VSINSTALLDIR',
+ 'WindowsSdkDir', 'WindowsSDKLibVersion']
+
+ if sys.platform == 'win32':
+ pass_vars.append('INCLUDE')
+ pass_vars.append('LIB')
+ pass_vars.append('PATHEXT')
+ environment['PYTHONBUFFERED'] = '1'
+
for var in pass_vars:
val = os.environ.get(var, '')
# Check for empty string as some variables such as LD_PRELOAD cannot be empty
@@ -34,15 +43,6 @@ class TestingConfig:
if val:
environment[var] = val
- if sys.platform == 'win32':
- environment.update({
- 'INCLUDE' : os.environ.get('INCLUDE',''),
- 'PATHEXT' : os.environ.get('PATHEXT',''),
- 'PYTHONUNBUFFERED' : '1',
- 'TEMP' : os.environ.get('TEMP',''),
- 'TMP' : os.environ.get('TMP',''),
- })
-
# Set the default available features based on the LitConfig.
available_features = []
if litConfig.useValgrind:
OpenPOWER on IntegriCloud