Skip to content

Upgrade to Swift 6.3.2: isolated deinit, Developer ID signing, floor 15.4 - #38

Closed
buggerman wants to merge 2 commits into
mainfrom
swift-6-3-2-upgrade
Closed

Upgrade to Swift 6.3.2: isolated deinit, Developer ID signing, floor 15.4#38
buggerman wants to merge 2 commits into
mainfrom
swift-6-3-2-upgrade

Conversation

@buggerman

Copy link
Copy Markdown
Owner

Summary

  • Enables isolated deinit (SE-0371) in ScrollbackIndex so SQLite handles are finalized properly at actor deallocation instead of relying on process-exit cleanup.
  • Bumps deployment floor to macOS 15.4 — required by the updated Swift concurrency runtime that backs isolated deinit.
  • Replaces ad-hoc codesigning with proper Developer ID codesigning using the newly-added repo secrets. Hardened runtime enabled, so we're notarization-ready if/when Apple credentials are added later.

Changes

  • Sources/BryggaCore/Persistence/ScrollbackIndex.swift — replace the deferred-cleanup comment block with an isolated deinit that calls sqlite3_finalize (twice, for both prepared statements) and sqlite3_close_v2. Both accept NULL safely, so this is safe for the uninitialized state.
  • Package.swiftswift-tools-version: 6.2 → 6.3; platform floor .macOS(.v15) → .macOS("15.4"). The string initializer is used because no .v15_4 enum case exists in PackageDescription yet.
  • Scripts/build-app.shLSMinimumSystemVersion: 15.0 → 15.4.
  • .github/workflows/release.yml — new "Import Developer ID certificate" step creates a temp keychain at $RUNNER_TEMP/build.keychain, decodes the base64 cert, imports the .p12, sets the partition list so codesign won't prompt, then deletes the decoded cert from disk. New "Developer ID codesign" step finds the Developer ID Application identity, signs the .app with --options runtime and Brygga.entitlements, and verifies. Release notes updated to reflect Developer ID signing (still mentions Gatekeeper warning since we're not notarized) and the 15.4 requirement.
  • AGENTS.md — toolchain reference updated to Swift 6.3.2; deployment floor notes updated throughout ("macOS 15 Sequoia" → "macOS 15.4 Sequoia"; reason for the floor updated to cite isolated deinit).

Test plan

  • `swift build` — passes
  • `swift test` — 132 tests pass
  • Developer ID signing path exercised on next push to `main` or `v*` tag (no easy way to test locally without the secrets). Step fails loud (non-zero exit) if the certificate isn't found in the imported keychain, so a misconfigured secret won't silently ship an unsigned binary.

Risk / rollback

The deployment floor bump drops support for macOS 15.0–15.3. macOS 15.4 was released March 2025; as of May 2026 the vast majority of Sequoia users are on 15.4+.

To revert: revert this commit. If only the signing change is problematic, revert the `release.yml` chunk and restore the `codesign --sign -` step — the rest of the changes are independent.

The hardened-runtime + sandbox combination is more restrictive than pure sandbox. Brygga doesn't use JIT, debugger attachment in release builds, or any other hardened-runtime-restricted features, so this should be a no-op at runtime, but worth a quick smoke test of the first signed nightly DMG when it ships.

buggerman added 2 commits May 13, 2026 00:49
…bump to 15.4

- Enable isolated deinit in ScrollbackIndex (SE-0371): sqlite3_finalize and
  sqlite3_close_v2 now run on the actor's executor at deallocation. Removes
  the workaround comment that had been in place since the actor was introduced.

- Bump deployment floor to macOS 15.4 (required by isolated deinit's Swift
  concurrency runtime). Package.swift uses .macOS("15.4") — no v15_4 enum
  case exists yet in PackageDescription — and LSMinimumSystemVersion in the
  build script is updated to match.

- swift-tools-version: 6.2 → 6.3 in Package.swift.

- Replace ad-hoc codesign with Developer ID codesign. The MACOS_CERTIFICATE
  (base64 .p12), MACOS_CERTIFICATE_PWD, and MACOS_KEYCHAIN_PWD secrets are
  now wired up in release.yml. The .app is signed with --options runtime and
  the repo's Brygga.entitlements file. The temp keychain is created, used,
  and the .p12 is deleted from disk in the same step. Hardened runtime gets
  us notarization-ready when/if Apple credentials land later.

- Update AGENTS.md toolchain reference (Swift 6.2 → 6.3.2) and deployment
  floor note throughout.
The macos-26 runner defaults to Xcode 26.2 which ships Swift 6.2.3,
but Package.swift now requires Swift 6.3.0+ (for isolated deinit).
Xcode 26.5 (beta) is the only installed Xcode that ships Swift 6.3.2,
matching the toolchain declared in AGENTS.md. The runner exposes a
stable /Applications/Xcode_26.5.app symlink that follows the current
26.5 beta, so this won't drift as Apple pushes beta_3, beta_4, etc.
@buggerman buggerman closed this May 12, 2026
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.

1 participant