11diff --git a/tools/signing/macos/mach_commands.py b/tools/signing/macos/mach_commands.py
2- index 4227363da7..4872c1d592 100644
2+ index 4227363da7..c09553ec40 100644
33--- a/tools/signing/macos/mach_commands.py
44+++ b/tools/signing/macos/mach_commands.py
55@@ -10,6 +10,8 @@ import plistlib
@@ -72,7 +72,7 @@ index 4227363da7..4872c1d592 100644
7272+ # in re-signing without requiring --force.
7373+ cs_reset_cmd = ["find", app, "-exec", "codesign", "--remove-signature", "{}", ";"]
7474+ run(command_context, cs_reset_cmd, capture_output=not verbose_arg)
75-
75+
7676 if use_rcodesign_arg is True:
7777 sign_with_rcodesign(
7878@@ -367,7 +378,11 @@ def macos_sign(
@@ -88,7 +88,17 @@ index 4227363da7..4872c1d592 100644
8888
8989
9090 def entitlement_repo_path(entitlements_key, entitlement_file):
91- @@ -723,3 +738,143 @@ def strip_restricted_entitlements(plist_file):
91+ @@ -551,7 +566,8 @@ def run(ctx, cmd, **kwargs):
92+ cmd_as_str = " ".join(cmd)
93+ ctx.log(logging.DEBUG, "macos-sign", {"cmd": cmd_as_str}, "[{cmd}]")
94+ try:
95+ - subprocess.run(cmd, check=True, **kwargs)
96+ + check = kwargs.pop('check', True)
97+ + subprocess.run(cmd, check=check, **kwargs)
98+ except subprocess.CalledProcessError as e:
99+ ctx.log(
100+ logging.ERROR,
101+ @@ -723,3 +739,143 @@ def strip_restricted_entitlements(plist_file):
92102 temp_file_obj.close()
93103
94104 return temp_file_path
0 commit comments