summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGreg Becker <becker33@llnl.gov>2020-10-20 01:09:13 -0700
committerGitHub <noreply@github.com>2020-10-20 10:09:13 +0200
commitbf47045302cf0086e1f45e8ce3908d36088837bd (patch)
treea0e507e0eb66f315f8112e8c258282119ccfaa19 /lib
parent87da91cef61e9deffb3b9b0795de14190aa57eb5 (diff)
downloadspack-bf47045302cf0086e1f45e8ce3908d36088837bd.tar.gz
spack-bf47045302cf0086e1f45e8ce3908d36088837bd.tar.bz2
spack-bf47045302cf0086e1f45e8ce3908d36088837bd.tar.xz
spack-bf47045302cf0086e1f45e8ce3908d36088837bd.zip
Fix python scripts relying on external python in env (#19241)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/build_systems/python.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/spack/spack/build_systems/python.py b/lib/spack/spack/build_systems/python.py
index 2aad627f2d..5116a8aac6 100644
--- a/lib/spack/spack/build_systems/python.py
+++ b/lib/spack/spack/build_systems/python.py
@@ -418,6 +418,7 @@ class PythonPackage(PackageBase):
def add_files_to_view(self, view, merge_map):
bin_dir = self.spec.prefix.bin
python_prefix = self.extendee_spec.prefix
+ python_is_external = self.extendee_spec.external
global_view = same_path(python_prefix, view.get_projection_for_spec(
self.spec
))
@@ -428,7 +429,8 @@ class PythonPackage(PackageBase):
view.link(src, dst)
elif not os.path.islink(src):
shutil.copy2(src, dst)
- if 'script' in get_filetype(src):
+ is_script = 'script' in get_filetype(src)
+ if is_script and not python_is_external:
filter_file(
python_prefix, os.path.abspath(
view.get_projection_for_spec(self.spec)), dst