Smaller bundles: stripped Mac binaries, one math font, smaller iOS asset catalog !458

merged merged by cmc on 2026-11-22 17:57 UTC · krz/orgstar:issue-207-bundle-size into main

Discussion

cmc

Closes #207, #208, #209.

#207 Developer ID binaries

  • scripts/build-app.sh runs strip -x on the main executable and the three extensions before signing, and copies the build's dSYMs (Swift Build already writes them beside the products) to .build/app/dSYMs.
  • scripts/release-mac.sh zips them to .build/release/orgstar-<version>-dSYMs.zip. Not uploaded.
  • CONTRIBUTING.org says where the zip is.

build-app.sh, arm64: bundle 102.3 MB to 73.0 MB. Main 41.7 to 30.2, widgets 19.7 to 12.8, Quick Look 8.2 to 5.9, Spotlight 8.1 to 5.9 MB. Binary and dSYM UUIDs match; atos with the dSYM resolves an address in the stripped binary to LatexPreview.swift:132. codesign --verify --deep --strict passes (ad hoc).

#208 SwiftMath fonts

MathImage.font defaults to .latinModernFont (latinmodern-math.otf/.plist), and fonts load on demand; nothing else in the repo uses SwiftMath. SwiftMath declares .copy("mathFonts.bundle"), so a package-level exclusion isn't possible without forking.

  • build-app.sh deletes the other eleven fonts and math tables from the copied bundle.
  • A "Remove unused math fonts" phase in Orgstar iOS, OrgstarShare, OrgstarWidgets and Orgstar macOS does the same after Resources, then signs the copy again if it was signed (Xcode signs the package bundle before copying it). The phase writes inside the bundle, which the script sandbox denies for anything but declared paths, so these four targets set ENABLE_USER_SCRIPT_SANDBOXING = NO.

SwiftMath bundle: 7.1 MB to 0.8 MB per copy. iOS simulator Release app 227.3 to 206.2 MB with #209; Mac App Store Release app 167 MB. rendersMath passes against a trimmed bundle, and crashes with fontPathNotFound when Latin Modern is removed as well, so the test reads that bundle.

#209 iOS icons

ASSETCATALOG_COMPILER_OPTIMIZATION = space on Orgstar iOS: the 1024 px icon renditions are stored zip-compressed instead of lzfse, both lossless. Assets.car 18.96 to 16.69 MB. No icon added, removed or changed. Recompressing the PNGs (optipng) does not change Assets.car, since actool encodes the pixels; the icons are dithered gradients, which compress poorly losslessly. The simulator build stores every icon for both iPhone and iPad; App Store thinning sends one idiom per device.

Tests

swift test: all pass except AgendaModelTests.checksFilesOffTheMainActor (timing), which passes alone. Both Xcode builds succeed.

At the next release

  • release-mac.sh: notarisation of stripped binaries, codesign --verify --strict --deep, and that the dSYM zip is in .build/release.
  • Sparkle: update from the previous release to this one.
  • Archive and export of Orgstar iOS and Orgstar macOS: the re-signed SwiftMath bundle with the distribution identity, and App Store Connect validation.