[compiler-rt] 5ab446c - [compiler-rt] [test] Use the parent process env as base env in tests

Sergej Jaskiewicz via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 9 09:44:50 PDT 2020


Author: Sergej Jaskiewicz
Date: 2020-07-09T19:44:35+03:00
New Revision: 5ab446cfe5503fd4431a94db4d741cf3b5fdcd15

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

LOG: [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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/lit.common.cfg.py b/compiler-rt/test/lit.common.cfg.py
index 98a2f3c03e60..7c98c387c870 100644
--- a/compiler-rt/test/lit.common.cfg.py
+++ b/compiler-rt/test/lit.common.cfg.py
@@ -67,6 +67,8 @@
     # to link. In r19 and later we just use the default which is libc++.
     config.cxx_mode_flags.append('-stdlib=libstdc++')
 
+config.environment = dict(os.environ)
+
 # Clear some environment variables that might affect Clang.
 possibly_dangerous_env_vars = ['ASAN_OPTIONS', 'DFSAN_OPTIONS', 'LSAN_OPTIONS',
                                'MSAN_OPTIONS', 'UBSAN_OPTIONS',


        


More information about the llvm-commits mailing list