Unset environment variables that are most commonly used by Autotools packages. (#8623)

This commit is contained in:
Sergey Kosukhin 2020-06-24 17:39:04 +02:00 committed by GitHub
parent ec58f28c20
commit bc53bb9b7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -162,6 +162,18 @@ def clean_environment():
if 'PKGCONF' in varname:
env.unset(varname)
# Unset the following variables because they can affect installation of
# Autotools and CMake packages.
build_system_vars = [
'CC', 'CFLAGS', 'CPP', 'CPPFLAGS', # C variables
'CXX', 'CCC', 'CXXFLAGS', 'CXXCPP', # C++ variables
'F77', 'FFLAGS', 'FLIBS', # Fortran77 variables
'FC', 'FCFLAGS', 'FCLIBS', # Fortran variables
'LDFLAGS', 'LIBS' # linker variables
]
for v in build_system_vars:
env.unset(v)
build_lang = spack.config.get('config:build_language')
if build_lang:
# Override language-related variables. This can be used to force

View File

@ -376,7 +376,7 @@ def unset(self, name, **kwargs):
"""Stores a request to unset an environment variable.
Args:
name: name of the environment variable to be set
name: name of the environment variable to be unset
"""
kwargs.update(self._get_outside_caller_attributes())
item = UnsetEnv(name, **kwargs)