lately: embed Sparkle 2.9.5 in the macOS app #69

Merged
founder merged 2 commits from lately-sparkle-embed into main 2026-08-16 12:40:52 +00:00
Owner

Embeds Sparkle 2.9.5 in lately_macos_release so Lately can update from https://lately.org/builds/sparkle/appcast.xml (feed served + published by the follow-up PR; merge order: this first, so no unsigned appcast is ever produced).

  • MODULE.bazel http_archive sparkle (Sparkle-2.9.5.tar.xz, sha256 015336b6…73cc, verified twice) + bazel/lately/Sparkle.BUILD.bazel (apple_dynamic_framework_import — the tar.xz ships Sparkle.framework, not an xcframework).
  • BUILD.bazel: @sparkle//:Sparkle dep on lately_macos_app_sources; ipa_post_processor restoring exec bits on Sparkle's helpers (rules_apple 4.5.3's framework importer chmods them 0644 and Sparkle 2.9.5 refuses to install without +x).
  • Info.plist: SUFeedURL / SUPublicEDKey (same Ed25519 key as key.store) / SU* mirroring key.store; both macOS entitlements get the Sparkle 2 sandbox mach-lookup exceptions for org.lately.phi.
  • AppDelegate.swift: retained SPUStandardUpdaterController + “Check for Updates…” (⌘U).

Adversarially reviewed against rules_apple 4.5.3 / rcodesign / Sparkle sources: ship.

🤖 Generated with Claude Code

Embeds Sparkle 2.9.5 in `lately_macos_release` so Lately can update from `https://lately.org/builds/sparkle/appcast.xml` (feed served + published by the follow-up PR; merge order: this first, so no unsigned appcast is ever produced). - `MODULE.bazel` http_archive `sparkle` (Sparkle-2.9.5.tar.xz, sha256 `015336b6…73cc`, verified twice) + `bazel/lately/Sparkle.BUILD.bazel` (`apple_dynamic_framework_import` — the tar.xz ships `Sparkle.framework`, not an xcframework). - `BUILD.bazel`: `@sparkle//:Sparkle` dep on `lately_macos_app_sources`; `ipa_post_processor` restoring exec bits on Sparkle's helpers (rules_apple 4.5.3's framework importer chmods them 0644 and Sparkle 2.9.5 refuses to install without +x). - `Info.plist`: SUFeedURL / SUPublicEDKey (same Ed25519 key as key.store) / SU* mirroring key.store; both macOS entitlements get the Sparkle 2 sandbox mach-lookup exceptions for `org.lately.phi`. - `AppDelegate.swift`: retained `SPUStandardUpdaterController` + “Check for Updates…” (⌘U). Adversarially reviewed against rules_apple 4.5.3 / rcodesign / Sparkle sources: ship. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Lately macOS shipped with no updater at all: the Developer ID DMG is
notarized and published on every release, but installs never learn
about the next build. This wires Sparkle 2 into //:lately_macos_release
so it can update from https://lately.org/builds/sparkle/appcast.xml
once the feed lane lands.

Why a prebuilt release rather than the Apple/External/Sparkle submodule:
key.store's Developer ID app is hand-assembled by bazel/apple/runner.sh
(xcodebuild the submodule, ditto the framework in). Lately is a real
rules_apple macos_application and its Swift sources need a
Bazel-visible `Sparkle` module to import, so the framework has to enter
through a rules_apple import target either way. The submodule pin
(7ba3dedd, 2.x, between 2.9.0-beta.1 and 2.9.0-beta.2) matches no
release tag, so the http_archive tracks the latest 2.x release, 2.9.5:

 https://github.com/sparkle-project/Sparkle/releases/download/2.9.5/Sparkle-2.9.5.tar.xz
 sha256 015336b601493e05c237964954bff6191370003d94edefe663724c88840d73cc

The tarball ships a versioned Sparkle.framework, not an .xcframework
(only the SwiftPM zip carries one), so bazel/lately/Sparkle.BUILD.bazel
uses apple_dynamic_framework_import over Sparkle.framework/**;
rules_apple 4.5.3's imported_dynamic_framework_processor handles the
Versions/B layout and re-creates the top-level symlinks.

App side, mirroring key.store's KeyStoreBazelApp.swift: a retained
SPUStandardUpdaterController(startingUpdater: true) on the @MainActor
AppDelegate (SPUStandardUpdaterController is NS_SWIFT_UI_ACTOR, so this
is Swift 6 clean) and a "Check for Updates…" (Cmd-U) item after About
in the app menu whose target is the controller, which validates the
item itself.

Info.plist (kept in OpenStep form) gains SUFeedURL, SUPublicEDKey (the
key that actually verifies the live key.store appcast, NkmI/…; the
feed URL is per app so sharing the Ed25519 key is fine), the same
SUEnableAutomaticChecks / SUAutomaticallyUpdate /
SUScheduledCheckInterval policy runner.sh write_macos_plist bakes into
key.store, and SUEnableInstallerLauncherService, which Sparkle requires
in a sandboxed host. OpenStep has no booleans, so these land as
strings; Sparkle 2.9's SUHost converts NSString via
-boolValue/-doubleValue explicitly.

Lately is sandboxed (key.store is not), so both macOS entitlements files
add com.apple.security.temporary-exception.mach-lookup.global-name for
org.lately.phi-spks / org.lately.phi-spki, the Mach services Sparkle's
Installer XPC registers under the host bundle id. network.client is
already present, so the Downloader XPC service stays off. The key is not
profile-scoped, so runner.sh
validate_macos_developer_id_profile_allows_entitlements ignores it, and
the files stay byte-identical to their canonical plist serialization,
which verify_rcodesign_entitlements_blob_matches_input requires.

Signing needs nothing new: sign-lately-macos-app already goes through
sign_macos_app_bundle, the same rcodesign path that re-signs key.store's
nested Sparkle.framework/Versions/B, Autoupdate, Updater.app and the XPC
services inside-out with --for-notarization (runtime flag on every
Mach-O; entitlements are not inherited by nested code, so the XPC
services stay unsandboxed as Sparkle requires).
lately: restore Sparkle helper exec bits after rules_apple import
Some checks failed
Namespace: Build Images / Refresh macOS runner lane (push) Successful in 6s
Build: Apple / Check (SwiftLint) (push) Successful in 17s
Namespace: Build Images / Refresh Linux runner image (push) Successful in 45s
Build: Apple / Build (visionOS) (push) Successful in 29s
Build: Apple / Build (iOS) (push) Successful in 30s
Build: Apple / Build (macOS) (push) Has been cancelled
Release: If Needed / Check (Release Needed) (push) Has been cancelled
Deploy: API / Deploy (API) (push) Has been cancelled
Deploy: Web / Deploy (Web) (push) Has been cancelled
Build: Apple / Check (SwiftLint) (pull_request) Successful in 3m49s
Build: Apple / Build (visionOS) (pull_request) Successful in 24s
Build: Apple / Build (iOS) (pull_request) Successful in 41s
Build: Apple / Build (macOS) (pull_request) Successful in 1m51s
Build: Linux / Build (Linux x86_64) (pull_request) Successful in 18m16s
Build: Linux / Build (keystore-forge x86_64) (pull_request) Has been skipped
Build: Linux / Build (Linux x86_64) (push) Successful in 42m32s
Build: Linux / Build (keystore-forge x86_64) (push) Has been skipped
3175269762
rules_apple 4.5.3's imported_dynamic_framework_processor copies every
file of an imported framework other than the framework's own binary
through _copy_framework_file(..., executable=False), i.e. chmod 0644
(tools/imported_dynamic_framework_processor/
imported_dynamic_framework_processor.py). For Sparkle that strips the
executable bit from Sparkle.framework/Versions/B/Autoupdate,
Updater.app/Contents/MacOS/Updater and
XPCServices/{Installer,Downloader}.xpc/Contents/MacOS/*. Sparkle 2.9
checks exactly this before installing (SPUHelperHasExecutablePermission
requires S_IXUSR|S_IXGRP|S_IXOTH and reports "were they lost during a
bad file copy?"), and launchd could not spawn the XPC service anyway, so
without a fix every Lately update would download, verify and then fail
to install. Nothing downstream repairs it: process_and_sign zips with
unix modes, runner.sh build_lately_macos unzips them, and rcodesign
preserves the mode of every Mach-O it re-signs.

macos_application's ipa_post_processor runs on the unzipped bundle after
assembly and before rules_apple signs it, which is the one Bazel-owned
hook for this, so //:lately_macos_release now points it at a small
sh_binary that chmod 755s those helpers under any Sparkle.framework in
the work dir. It is idempotent, touches nothing but modes (so the
ad-hoc seals rules_apple already computed for the framework stay valid)
and keeps bazel-bin/lately_macos_release.zip correct on its own instead
of relying on a runner.sh fix-up.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
key-store/key.store!69
No description provided.