Don't prepend Tcl/Python to PATH if in system directory (#7677)

This commit is contained in:
Adam J. Stewart 2018-04-05 16:39:05 -05:00 committed by Todd Gamblin
parent a63450bc45
commit bde69177be
2 changed files with 9 additions and 2 deletions

View file

@ -34,6 +34,7 @@
import spack import spack
from spack import * from spack import *
from spack.util.environment import is_system_path
from spack.util.prefix import Prefix from spack.util.prefix import Prefix
import spack.util.spack_json as sjson import spack.util.spack_json as sjson
@ -543,7 +544,10 @@ def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
# where a system provided python is run against the standard libraries # where a system provided python is run against the standard libraries
# of a Spack built python. See issue #7128 # 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))
path = os.path.dirname(self.command.path)
if not is_system_path(path):
spack_env.prepend_path('PATH', path)
python_paths = [] python_paths = []
for d in dependent_spec.traverse( for d in dependent_spec.traverse(

View file

@ -24,6 +24,7 @@
############################################################################## ##############################################################################
import os import os
from spack.util.environment import is_system_path
from spack import * from spack import *
@ -102,7 +103,9 @@ def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
# where a system provided tcl is run against the standard libraries # where a system provided tcl is run against the standard libraries
# of a Spack built tcl. See issue #7128 that relates to python but # of a Spack built tcl. See issue #7128 that relates to python but
# it boils down to the same situation we have here. # it boils down to the same situation we have here.
spack_env.prepend_path('PATH', os.path.dirname(self.command.path)) path = os.path.dirname(self.command.path)
if not is_system_path(path):
spack_env.prepend_path('PATH', path)
tcl_paths = [join_path(self.prefix, self.tcl_builtin_lib_dir)] tcl_paths = [join_path(self.prefix, self.tcl_builtin_lib_dir)]