diff options
author | Omri Mor <omrimor2@illinois.edu> | 2020-12-24 15:48:53 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-24 16:48:53 -0600 |
commit | cfbe3aa056ea7bfb04f5880020a6d09cacda5570 (patch) | |
tree | 8bef28fafd9f4efaecc99e797db8eabd8fe02778 /lib | |
parent | 91e106ae7cda2c64b57d40c02c6bcc721b3526c8 (diff) | |
download | spack-cfbe3aa056ea7bfb04f5880020a6d09cacda5570.tar.gz spack-cfbe3aa056ea7bfb04f5880020a6d09cacda5570.tar.bz2 spack-cfbe3aa056ea7bfb04f5880020a6d09cacda5570.tar.xz spack-cfbe3aa056ea7bfb04f5880020a6d09cacda5570.zip |
Remove more variables from build environment (#20156)
GCC looks for included files based on several env vars.
Remove C_INCLUDE_PATH, CPLUS_INCLUDE_PATH, and OBJC_INCLUDE_PATH
from the build environment to ensure it's clean and prevent
accidental clobbering.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/build_environment.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index a2eabbc3db..c66ee18065 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -149,12 +149,17 @@ def clean_environment(): # can affect how some packages find libraries. We want to make # sure that builds never pull in unintended external dependencies. env.unset('LD_LIBRARY_PATH') - env.unset('LIBRARY_PATH') - env.unset('CPATH') env.unset('LD_RUN_PATH') env.unset('DYLD_LIBRARY_PATH') env.unset('DYLD_FALLBACK_LIBRARY_PATH') + # These vars affect how the compiler finds libraries and include dirs. + env.unset('LIBRARY_PATH') + env.unset('CPATH') + env.unset('C_INCLUDE_PATH') + env.unset('CPLUS_INCLUDE_PATH') + env.unset('OBJC_INCLUDE_PATH') + # On Cray "cluster" systems, unset CRAY_LD_LIBRARY_PATH to avoid # interference with Spack dependencies. # CNL requires these variables to be set (or at least some of them, |