From 576c25b3eab8d3a3501379801fac8c934efe624a Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 8 Mar 2021 11:27:06 +0100 Subject: [PATCH] makewheel: Re-sign arm64 macOS binaries after removing signature Fixes #1123 --- makepanda/makewheel.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/makepanda/makewheel.py b/makepanda/makewheel.py index adf691a559..a8fbb1d3e3 100644 --- a/makepanda/makewheel.py +++ b/makepanda/makewheel.py @@ -443,9 +443,14 @@ class WheelFile(object): subprocess.call(["install_name_tool", "-change", dep, new_dep, temp.name]) remove_signature = True - # Remove the codesign signature if we modified the library. + # Replace the codesign signature if we modified the library. if remove_signature: - subprocess.call(["codesign", "--remove-signature", temp.name]) + if self.platform.endswith("_arm64"): + subprocess.call(["codesign", "-f", "-s", "-", temp.name]) + else: + subprocess.call(["codesign", "--remove-signature", temp.name]) + if self.platform.endswith("_universal2"): + subprocess.call(["codesign", "-a", "arm64", "-s", "-", temp.name]) else: # On other unixes, we just add dependencies normally. for dep in deps: