diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2018-02-12 08:08:45 +0100 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2018-02-11 23:08:45 -0800 |
commit | b7baeb542d08eff79e543cdfb62171a08cab502c (patch) | |
tree | f18a08fdaf40a236a53efb0c98b3715823026e70 | |
parent | 7e9a369dec567bcae35cb9fcbae5c19ecbec6860 (diff) | |
download | spack-b7baeb542d08eff79e543cdfb62171a08cab502c.tar.gz spack-b7baeb542d08eff79e543cdfb62171a08cab502c.tar.bz2 spack-b7baeb542d08eff79e543cdfb62171a08cab502c.tar.xz spack-b7baeb542d08eff79e543cdfb62171a08cab502c.zip |
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
-rw-r--r-- | var/spack/repos/builtin/packages/python/package.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index 34b6fb2bad..a3ad52df89 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -511,7 +511,12 @@ class Python(AutotoolsPackage): """Set PYTHONPATH to include the site-packages directory for the 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.prepend_path('PATH', os.path.dirname(self.command.path)) python_paths = [] for d in dependent_spec.traverse( |