Skip to content

Commit 889de01

Browse files
staticfloatKristofferC
authored andcommitted
Fix MacOS Notarization (#35080)
We need to individually sign each Mach-O file independently, otherwise notarization bails. Note that you must sign the overall `.app` after each individual file is signed. I've also added more Entitlements. I've gone for a "gentle shotgun" approach, turning on everything that I think we could reasonably want. I wait expectantly for someone to complain that they need Location access turned on for some package. ;) (cherry picked from commit 418f111)
1 parent ef4fe83 commit 889de01

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

contrib/mac/app/Entitlements.plist

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,19 @@
44
<dict>
55
<key>com.apple.security.automation.apple-events</key>
66
<true/>
7+
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
8+
<true/>
9+
<key>com.apple.security.cs.allow-jit</key>
10+
<true/>
11+
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
12+
<true/>
13+
<key>com.apple.security.cs.debugger</key>
14+
<true/>
15+
<key>com.apple.security.cs.disable-library-validation</key>
16+
<true/>
17+
<key>com.apple.security.device.audio-input</key>
18+
<true/>
19+
<key>com.apple.security.device.camera</key>
20+
<true/>
721
</dict>
822
</plist>

contrib/mac/app/Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@ dmg/$(APP_NAME): startup.applescript julia.icns
5151
tar zxf $(JULIAHOME)/$(JULIA_BINARYDIST_FILENAME).tar.gz -C $@/Contents/Resources/julia --strip-components 1
5252
if [ -n "$$MACOS_CODESIGN_IDENTITY" ]; then \
5353
echo "Codesigning with identity $$MACOS_CODESIGN_IDENTITY"; \
54-
codesign -s "$$MACOS_CODESIGN_IDENTITY" --option=runtime --entitlements Entitlements.plist -v --deep $@; \
54+
MACHO_FILES=$$(find "$@" -type f -perm -755 | cut -d: -f1); \
55+
for f in $${MACHO_FILES}; do \
56+
echo "Codesigning $${f}..."; \
57+
codesign -s "$$MACOS_CODESIGN_IDENTITY" --option=runtime --entitlements Entitlements.plist -vvv --timestamp --deep --force "$${f}"; \
58+
done; \
59+
codesign -s "$$MACOS_CODESIGN_IDENTITY" --option=runtime --entitlements Entitlements.plist -vvv --timestamp --deep --force "$@"; \
5560
else \
5661
true; \
5762
fi
@@ -62,7 +67,7 @@ ifneq ($(filter root,$(ROOTFILES)),)
6267
@echo "We have to use sudo here to clean out folders owned by root. You may be asked for your password"
6368
sudo rm -rf dmg *.dmg notarize-*.xml
6469
else
65-
rm -rf dmg *.dmg
70+
rm -rf dmg *.dmg notarize-*.xml
6671
endif
6772

6873
notarize-upload-$(DMG_NAME).xml: $(DMG_NAME)

contrib/mac/app/notarize_check.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ function wait_until_completed()
3333
echo -n "."
3434
sleep 10
3535
continue
36+
elif [[ ${STATUS} == "invalid" ]]; then
37+
echo "invalid! Looks like something got borked:"
38+
/usr/libexec/PlistBuddy -c "print notarization-info:LogFileURL" "${PLIST_FILE}" 2>/dev/null
39+
exit 1
3640
else
3741
echo "Notarization failed with status ${STATUS}"
3842
exit 1

0 commit comments

Comments
 (0)