Skip to content

Fix sparkle updater bundle - #561

Merged
hannesa2 merged 2 commits into
masterfrom
fix-sparkle-updater-bundle-id
Jul 23, 2026
Merged

hannesa2 merged 2 commits into
masterfrom
fix-sparkle-updater-bundle-id

Conversation

@hannesa2

Copy link
Copy Markdown
Contributor

No description provided.

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.
@hannesa2
hannesa2 merged commit 8951252 into master Jul 23, 2026
4 of 6 checks passed
@hannesa2
hannesa2 deleted the fix-sparkle-updater-bundle-id branch July 23, 2026 12:27
@hannesa2

Copy link
Copy Markdown
Contributor Author

Screenshot differs: emulatorApi=arm64 with 4 screenshot(s)

setpoint (old) | diff | actual screenshot (new)

00-commit-context-menu.pngscreenshot

01-history-view.pngscreenshot

02-main-window.pngscreenshot

03-staging-view.pngscreenshot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants