Repository navigation
Fix sparkle updater bundle - #561
Merged
Merged
Conversation
Passing PRODUCT_BUNDLE_IDENTIFIER=net.phere.GitX on the xcodebuild
command line overrides the setting for every target in the workspace,
including Sparkle's Updater.app built from the submodule. Since the
Sparkle 2.9.3 bump, Updater.app's Info.plist takes its identifier from
that build setting, so released bundles contain two bundles claiming
net.phere.GitX: the app itself and
GitX.app/Contents/Frameworks/Sparkle.framework/Versions/B/Updater.app.
When the gitx CLI then asks Scripting Bridge for net.phere.GitX while
the app is not running, LaunchServices can resolve to the Updater.app,
which has no scripting definition, and the CLI crashes:
warning: failed to get scripting definition from
.../Sparkle.framework/Versions/B/Updater.app; it may not be scriptable.
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '-[SBApplication open:withOptions:]: unrecognized selector ...'
The override is redundant anyway: every target already sets its own
PRODUCT_BUNDLE_IDENTIFIER in project.pbxproj (net.phere.GitX for the
app, net.phere.gitx-cli for the CLI).
The CLI ships inside the app bundle at GitX.app/Contents/Resources/gitx, so derive the app's URL from the tool's own (symlink-resolved) path and target it with -[SBApplication applicationWithURL:]. Resolving by bundle identifier is fragile: if any other bundle on disk claims net.phere.GitX (as Sparkle's embedded Updater.app did in releases built with a global PRODUCT_BUNDLE_IDENTIFIER override), LaunchServices can return a bundle without our scripting definition and every scripting call crashes with '-[SBApplication open:withOptions:]: unrecognized selector'. The bundle-identifier lookup is kept as a fallback for running the tool outside an app bundle (e.g. straight from the build directory). This makes the CLI immune to broken bundles already installed by existing releases, complementing the workflow fix in the previous commit.
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




No description provided.