From 73993a60b42d2bd195712e4e3c408c13da79b3ed Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Fri, 15 Jul 2022 19:33:30 -0700 Subject: [PATCH] macos: Add com.apple.security.automation.apple-events entitlement This is necessary for applications spawned via wezterm to be able to generate apple events. wezterm already had the text for the authorization prompt in its plist, but because it was code signed with the default set of entitlements, macOS didn't bother to prompt. This commit introduces an explicit set of entitlements and uses those when signing the executable. I test this by manually codesigning on my laptop and confirmed that I could run bbedit from inside wezterm. I can't directly test the CI version of that flow on my laptop as it may destroy my keychain if I got something wrong. We'll have to see if the CI generated build works out! refs: https://github.com/wez/wezterm/issues/2242 h/t to https://github.com/microsoft/vscode/issues/119787 for clearly documenting what was needed. --- ci/deploy.sh | 3 ++- ci/macos-entitlement.plist | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 ci/macos-entitlement.plist diff --git a/ci/deploy.sh b/ci/deploy.sh index defea143d..94b5d534a 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -76,7 +76,8 @@ case $OSTYPE in echo "Grant apple tools access to build.keychain" security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_PW" build.keychain echo "Codesign" - /usr/bin/codesign --keychain build.keychain --force --options runtime --deep --sign "$MACOS_TEAM_ID" $zipdir/WezTerm.app/ + /usr/bin/codesign --keychain build.keychain --force --options runtime \ + --entitlements ci/macos-entitlement.plist --deep --sign "$MACOS_TEAM_ID" $zipdir/WezTerm.app/ echo "Restore default keychain" security default-keychain -d user -s $def_keychain echo "Remove build.keychain" diff --git a/ci/macos-entitlement.plist b/ci/macos-entitlement.plist new file mode 100644 index 000000000..cffd6379c --- /dev/null +++ b/ci/macos-entitlement.plist @@ -0,0 +1,8 @@ + + + + + com.apple.security.automation.apple-events + + +