build_environment: clean *_ROOT variables (#26474)
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
This commit is contained in:
parent
abdd206f65
commit
a3dd0e7861
@ -185,6 +185,13 @@ def clean_environment():
|
||||
env.unset('LD_PRELOAD')
|
||||
env.unset('DYLD_INSERT_LIBRARIES')
|
||||
|
||||
# Avoid <packagename>_ROOT user variables overriding spack dependencies
|
||||
# https://cmake.org/cmake/help/latest/variable/PackageName_ROOT.html
|
||||
# Spack needs SPACK_ROOT though, so we need to exclude that
|
||||
for varname in os.environ.keys():
|
||||
if varname.endswith('_ROOT') and varname != 'SPACK_ROOT':
|
||||
env.unset(varname)
|
||||
|
||||
# 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,
|
||||
|
Loading…
Reference in New Issue
Block a user