Fix python scripts relying on external python in env (#19241)

This commit is contained in:
Greg Becker 2020-10-20 01:09:13 -07:00 committed by GitHub
parent 87da91cef6
commit bf47045302
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -418,6 +418,7 @@ def view_file_conflicts(self, view, merge_map):
def add_files_to_view(self, view, merge_map): def add_files_to_view(self, view, merge_map):
bin_dir = self.spec.prefix.bin bin_dir = self.spec.prefix.bin
python_prefix = self.extendee_spec.prefix python_prefix = self.extendee_spec.prefix
python_is_external = self.extendee_spec.external
global_view = same_path(python_prefix, view.get_projection_for_spec( global_view = same_path(python_prefix, view.get_projection_for_spec(
self.spec self.spec
)) ))
@ -428,7 +429,8 @@ def add_files_to_view(self, view, merge_map):
view.link(src, dst) view.link(src, dst)
elif not os.path.islink(src): elif not os.path.islink(src):
shutil.copy2(src, dst) 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( filter_file(
python_prefix, os.path.abspath( python_prefix, os.path.abspath(
view.get_projection_for_spec(self.spec)), dst view.get_projection_for_spec(self.spec)), dst