From 9f3376e56dc21e9aa181847fa959c4dc03823572 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Thu, 9 Jun 2022 14:12:00 -0500 Subject: [PATCH] Issue #1905 - Part 3a - Resign python binary ad-hoc since install_name_tool invalidates code signature. The code signature is invalidated on Intel as well, but on ARM the binary fails to run with an invalid code signature error. --- python/virtualenv/virtualenv.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/virtualenv/virtualenv.py b/python/virtualenv/virtualenv.py index 655e25cf01..d22207e257 100644 --- a/python/virtualenv/virtualenv.py +++ b/python/virtualenv/virtualenv.py @@ -1345,6 +1345,9 @@ def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear, sy "have Apple's development tools installed") raise + # Resign the executable, since install_name_tool invalidates the signature + call_subprocess(["codesign", "-s", "-", py_executable]) + if not is_win: # Ensure that 'python', 'pythonX' and 'pythonX.Y' all exist py_exe_version_major = 'python%s' % sys.version_info[0]