Set a default python that is consistent with the libraries in PYTHONHOME (#7157)

fixes #7128

Before this PR packages that were indirectly dependent on python might
have failed due to inconsistency between the python found in the
environment and the standard libraries set in PYTHONHOME
This commit is contained in:
Massimiliano Culpo 2018-02-12 08:08:45 +01:00 committed by Todd Gamblin
parent 7e9a369dec
commit b7baeb542d

View file

@ -511,7 +511,12 @@ def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
"""Set PYTHONPATH to include the site-packages directory for the """Set PYTHONPATH to include the site-packages directory for the
extension and any other python extensions it depends on.""" extension and any other python extensions it depends on."""
# If we set PYTHONHOME, we must also ensure that the corresponding
# python is found in the build environment. This to prevent cases
# where a system provided python is run against the standard libraries
# of a Spack built python. See issue #7128
spack_env.set('PYTHONHOME', self.home) spack_env.set('PYTHONHOME', self.home)
spack_env.prepend_path('PATH', os.path.dirname(self.command.path))
python_paths = [] python_paths = []
for d in dependent_spec.traverse( for d in dependent_spec.traverse(