Skip to content

Commit 5ab446c

Browse files
committed
[compiler-rt] [test] Use the parent process env as base env in tests
Summary: Right now the lit config builds up an environment that the tests will be run in. However, it does it from scratch instead of adding new variables to the parent process environment. This may (and does) result in strange behavior when running tests with an executor (i. e. with the `COMPILER_RT_EMULATOR` CMake variable set to something), since the executor may need some of the parent process's environment variables. Here this is fixed. Reviewers: compnerd, phosek Reviewed By: compnerd Subscribers: dberris, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D83486
1 parent e529d77 commit 5ab446c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compiler-rt/test/lit.common.cfg.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@
6767
# to link. In r19 and later we just use the default which is libc++.
6868
config.cxx_mode_flags.append('-stdlib=libstdc++')
6969

70+
config.environment = dict(os.environ)
71+
7072
# Clear some environment variables that might affect Clang.
7173
possibly_dangerous_env_vars = ['ASAN_OPTIONS', 'DFSAN_OPTIONS', 'LSAN_OPTIONS',
7274
'MSAN_OPTIONS', 'UBSAN_OPTIONS',

0 commit comments

Comments
 (0)