Commit a3e9e3f
authored
fix: copy SPM resource bundles to Contents/MacOS/ to prevent startup crash (#118)
* fix: copy SPM resource bundles to Contents/MacOS/ to prevent crash
SPM's auto-generated Bundle.module accessor looks for resource bundles at
Bundle.main.bundleURL/<name>.bundle. For an SPM executable wrapped in a
.app bundle, this resolves to Contents/MacOS/ at runtime. The accessor also
hardcodes the developer's build-time path as a fallback, which only works
on the machine that built it.
Previously, the build script only copied resource bundles to
Contents/Resources/. This meant the app worked on the developer's machine
(via the hardcoded fallback) but crashed with a fatalError on end-user
machines where neither path resolved — specifically during tokenizer
loading via swift-transformers' Hub module (Bundle.module).
Fix: copy resource bundles into both Contents/Resources/ (standard macOS
convention) and Contents/MacOS/ (where SPM's accessor actually looks).
Also clean up any stale bundles at the .app root from previous builds.
Fixes crash: EXC_BREAKPOINT in NSBundle.module during app startup.
* fix: sign resource bundles in Contents/MacOS/ before signing app
The previous commit copied resource bundles to Contents/MacOS/ but didn't
sign them there. codesign rejects unsigned nested bundles, causing the CI
build to fail with 'bundle format unrecognized, invalid, or unsuitable'.
* fix: add Info.plist to SPM resource bundles for codesign compatibility
SPM-generated resource bundles (e.g. swift-transformers_Hub.bundle) may
lack an Info.plist, causing codesign to reject them with 'bundle format
unrecognized, invalid, or unsuitable'. This adds a minimal Info.plist to
any resource bundle that lacks one before signing.
* fix: restructure SPM resource bundles for codesign compatibility
SPM generates flat resource bundles (files at bundle root) that codesign
rejects in Contents/MacOS/ with 'bundle format unrecognized'. This
restructures them into proper macOS bundle layout (Contents/Resources/
+ Contents/Info.plist) when copying to Contents/MacOS/, so they pass
codesign validation on both Developer ID and ad-hoc signed builds.
Also adds VocaMac.app.bak/ to .gitignore.1 parent a49aebe commit a3e9e3f
2 files changed
Lines changed: 46 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
100 | 114 | | |
| 115 | + | |
101 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
102 | 145 | | |
103 | 146 | | |
104 | 147 | | |
| |||
192 | 235 | | |
193 | 236 | | |
194 | 237 | | |
195 | | - | |
196 | | - | |
| 238 | + | |
| 239 | + | |
197 | 240 | | |
198 | 241 | | |
199 | 242 | | |
| |||
0 commit comments