summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2018-04-05 16:39:05 -0500
committerTodd Gamblin <tgamblin@llnl.gov>2018-04-05 14:39:05 -0700
commitbde69177becaff1ea9fea19014261ffb919e716a (patch)
tree7a3344bc9c5b8b31ccd29d58c86f3c99c8e48c6f /var
parenta63450bc4537f8db04530d0dacdc98babbdd38f2 (diff)
downloadspack-bde69177becaff1ea9fea19014261ffb919e716a.tar.gz
spack-bde69177becaff1ea9fea19014261ffb919e716a.tar.bz2
spack-bde69177becaff1ea9fea19014261ffb919e716a.tar.xz
spack-bde69177becaff1ea9fea19014261ffb919e716a.zip
Don't prepend Tcl/Python to PATH if in system directory (#7677)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/python/package.py6
-rw-r--r--var/spack/repos/builtin/packages/tcl/package.py5
2 files changed, 9 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py
index 3e0f038768..8dc46f113d 100644
--- a/var/spack/repos/builtin/packages/python/package.py
+++ b/var/spack/repos/builtin/packages/python/package.py
@@ -34,6 +34,7 @@ from llnl.util.filesystem import force_remove
import spack
from spack import *
+from spack.util.environment import is_system_path
from spack.util.prefix import Prefix
import spack.util.spack_json as sjson
@@ -543,7 +544,10 @@ class Python(AutotoolsPackage):
# 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))
+
+ path = os.path.dirname(self.command.path)
+ if not is_system_path(path):
+ spack_env.prepend_path('PATH', path)
python_paths = []
for d in dependent_spec.traverse(
diff --git a/var/spack/repos/builtin/packages/tcl/package.py b/var/spack/repos/builtin/packages/tcl/package.py
index b1ddc5a141..15891af2e1 100644
--- a/var/spack/repos/builtin/packages/tcl/package.py
+++ b/var/spack/repos/builtin/packages/tcl/package.py
@@ -24,6 +24,7 @@
##############################################################################
import os
+from spack.util.environment import is_system_path
from spack import *
@@ -102,7 +103,9 @@ class Tcl(AutotoolsPackage):
# where a system provided tcl is run against the standard libraries
# of a Spack built tcl. See issue #7128 that relates to python but
# 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)]