Skip to content

fix(release): build release via xcodebuild so the .app launches - #70

Merged
bbjansen merged 1 commit into
mainfrom
fix/release-xcodebuild
Oct 30, 2026
Merged

bbjansen merged 1 commit into
mainfrom
fix/release-xcodebuild

Conversation

@bbjansen

Copy link
Copy Markdown
Owner

Why

v0.1.5 crashed at launch with a Swift fatalError from Bundle.module:
could not load resource bundle. Root cause: CI's swift build (native
build system) generates a resource_bundle_accessor.swift that resolves
Bundle.module from the .app bundle root, but our .app layout keeps
the SPM resource bundle under Contents/Resources/ (the only valid place —
codesign rejects resource bundles at the root).

swift build --build-system swiftbuild generates the correct
Bundle.main.resourceURL-based accessor, but fails to compile SwiftTerm's
Metal shader on the runner (CompileMetalFile / ClangStatCache errors).

Fix

Build the release with xcodebuild instead. Xcode's toolchain compiles
the Metal shader and emits the Contents/Resources resource accessor.

  • release-build.yml: replace the metal-shim + swiftbuild build with
    xcodebuild -scheme Simpleton -configuration Release. Includes
    diagnostics (scheme list, product listing, accessor type, sign_update
    location) because xcodebuild can't be run on the CLT-only dev machine —
    one CI run must reveal the layout.
  • make-app-bundle.sh: honor SIMPLETON_BINDIR so the bundler consumes
    xcodebuild's DerivedData/Build/Products/Release output.
  • Assemble step passes SIMPLETON_BINDIR; the Sparkle sign_update
    lookup now searches DerivedData/SourcePackages (where xcodebuild
    extracts the checksum-pinned Sparkle SPM artifact) ahead of
    .build/artifacts.
  • CoreChecks runs on the default build system (needs no Metal).

Verification

  • actionlint + shellcheck clean locally.
  • Post-merge: re-dispatch v0.1.5, download the artifact, and open-launch
    to confirm the crash is gone.

The native `swift build` accessor resolves Bundle.module from the .app
ROOT, which crashed v0.1.5 at launch ("could not load resource bundle");
`swift build --build-system swiftbuild` generates the correct
resourceURL-based accessor but fails to compile SwiftTerm's Metal shader
on CI. Build with xcodebuild instead: Xcode's toolchain compiles Metal
AND emits the Contents/Resources accessor.

- release-build.yml: replace the metal-shim + swiftbuild build with
  `xcodebuild -scheme Simpleton -configuration Release`, with diagnostics
  (scheme list, product listing, accessor type, sign_update location)
  since xcodebuild can't be run on the CLT-only dev machine.
- make-app-bundle.sh: honor SIMPLETON_BINDIR so the bundler can consume
  xcodebuild's DerivedData/Build/Products/Release output.
- Assemble step passes SIMPLETON_BINDIR; Sparkle sign_update lookup now
  searches DerivedData/SourcePackages (where xcodebuild extracts the
  pinned Sparkle SPM artifact) ahead of .build/artifacts.
- CoreChecks runs with the default build system (no Metal needed).
@bbjansen
bbjansen merged commit 3743021 into main Oct 30, 2026
5 checks passed
@bbjansen
bbjansen deleted the fix/release-xcodebuild branch October 30, 2026 15:03
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