sparkle-project / Sparkle

A software update framework for macOS
https://sparkle-project.org
Other
7.37k stars 1.05k forks source link

Cannot make release with custom XPC bundle id #2445

Closed floorish closed 11 months ago

floorish commented 11 months ago

Summary

make release fails when setting a custom XPC bundle id prefix.

Using Xcode 15.0 - Sparkle v2.5.0 - f0ceaf5cc9f3f23daa0ccb6dcebd79fc96ccc7d9

  1. Edit ConfigCommon.xcconfig
XPC_SERVICE_BUNDLE_ID_PREFIX = org.sparkle-project
=>
XPC_SERVICE_BUNDLE_ID_PREFIX = my.app
  1. Run make release

Expected: Builds release with custom bundle id

Observed: BUILD FAILED

ProcessProductPackaging /sparkle-repo/Downloader/my.app.Downloader.entitlements /sparkle-repo/build/Sparkle.kowu76/Build/Intermediates.noindex/Sparkle.build/Release/SparkleDownloader.build/Downloader.xpc.xcent (in target 'SparkleDownloader' from project 'Sparkle')

Possible Fix

Seems like it is looking for the incorrect Downloader entitlements file with the custom bundle id.

  1. Edit ConfigDownloader.xcconfig
CODE_SIGN_ENTITLEMENTS = Downloader/${DOWNLOADER_BUNDLE_ID}.entitlements
=>
CODE_SIGN_ENTITLEMENTS = Downloader/org.sparkle-project.Downloader.entitlements

Make release seems to work again. I'm not sure if CODE_SIGN_ENTITLEMENTS is supposed to be dynamic, because the entitlements file is always named org.sparkle-project.Downloader.entitlements?

floorish commented 11 months ago

I think there is a similar issue with the custom names for XPC services:

ConfigCommon.xcconfig

INSTALLER_LAUNCHER_NAME = InstallerCustom
DOWNLOADER_NAME = DownloaderCustom

make release will fail unless make-xcframework.sh is updated:

xcodebuild -create-xcframework -framework "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/Products/Library/Frameworks/Sparkle.framework" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Sparkle.framework.dSYM" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Autoupdate.dSYM" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Updater.app.dSYM" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Installer.xpc.dSYM" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Downloader.xpc.dSYM" -output "$BUILT_PRODUCTS_DIR/Sparkle.xcframework"

=> 

xcodebuild -create-xcframework -framework "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/Products/Library/Frameworks/Sparkle.framework" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Sparkle.framework.dSYM" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Autoupdate.dSYM" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Updater.app.dSYM" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/$INSTALLER_LAUNCHER_NAME.xpc.dSYM" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/$DOWNLOADER_NAME.xpc.dSYM" -output "$BUILT_PRODUCTS_DIR/Sparkle.xcframework"

The dsym files are named according to the custom names in ConfigCommon

zorgiepoo commented 11 months ago

These changes make sense to me. Are you able to make a pull request with them?

I don't really recommend changing the Installer XPC Service name by the way (or at least to not something strange) as that can show up in the authorization dialog prompt. Since you are modifying the config files, if you don't need the Downloader XPC Service you can just disable it (I suspect few apps need/want to use it but very curious to hear if that's your case). Changing the bundle ID of the XPC Services also has not much gain these days I think.

floorish commented 11 months ago

Thanks for your recommendations!

I don't really recommend changing the Installer XPC Service name by the way (or at least to not something strange) as that can show up in the authorization dialog prompt.

Yes I want to make it less generic, e.g. MyAppInstaller — that's what it's used for, isn't it? For older Sparkle builds I changed the bundle id because that was shown in the auth dialog, but I guess that's indeed not very useful anymore. (according to https://github.com/sparkle-project/Sparkle/pull/1425 and https://github.com/sparkle-project/Sparkle/pull/2096)

I couldn't change it to a name with spaces, e.g. "My App Installer" as that fails (probably due to missing quotes somewhere, but don't really care about that)

if you don't need the Downloader XPC Service you can just disable it (I suspect few apps need/want to use it but very curious to hear if that's your case).

Yes that was the first thing I disabled, but even if disabled the make release would fail with the custom bundle id as the (incorrect) entitlements file is still used during build.

PS: is there a donation link for your work on this project?

zorgiepoo commented 11 months ago

Yes I want to make it less generic, e.g. MyAppInstaller — that's what it's used for, isn't it? For older Sparkle builds I changed the bundle id because that was shown in the auth dialog, but I guess that's indeed not very useful anymore. (according to https://github.com/sparkle-project/Sparkle/pull/1425 and https://github.com/sparkle-project/Sparkle/pull/2096)

Yeah this makes sense.

No donations, but thanks for the PR!

floorish commented 11 months ago

Thank you for all your work!