Commit 9b29847
committed
darwin: harden reconcile_framework_install_names (fail-loud + all-slice ids)
Two robustness fixes to the #223 reconcile pass (both from code review):
1. Stop swallowing real failures. The install_name_tool/-id/-change and codesign
calls used `2>/dev/null || true`, which also hid genuine failures — most
importantly install_name_tool's 'larger updated load commands do not fit'
(a Mach-O with no header space to grow a load command). A swallowed -change
leaves a bare @rpath ref and reproduces the exact dyld launch crash this pass
exists to prevent, silently. Now: -id, a *present-dep* -change (absent deps
are still a rc-0 no-op), and codesign failures are fatal — the function
returns non-zero with a clear message, and sync_site_packages.sh propagates it
(`|| exit 1`) so `flet build` fails loudly instead of shipping a broken app.
stderr is captured and only printed on error, so the expected
'will invalidate the code signature' warning stays off the build log.
2. Record every slice's old install-id, not just the first. Pass 1 read oldid
only from the first slice; a lib whose slices carry divergent install names
(e.g. an arch-specific absolute build path instead of an @rpath id) would
leave the other slices' deps unrewritten. Now each distinct old id is mapped
(deduped) to the same new framework id.
Verified: happy path (padded dylibs) + the real llama ggml->llama chain both
reconcile to rc 0 with no bare refs; a divergent-slice-id pair rewrites both
slices; an unpadded binary now fails loudly (rc 1) instead of silently.1 parent cc28d13 commit 9b29847
2 files changed
Lines changed: 48 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
59 | 64 | | |
60 | 65 | | |
61 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
136 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
137 | 142 | | |
138 | 143 | | |
139 | 144 | | |
140 | 145 | | |
141 | 146 | | |
142 | | - | |
143 | 147 | | |
144 | 148 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
152 | 169 | | |
153 | | - | |
154 | 170 | | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | 171 | | |
160 | 172 | | |
161 | | - | |
162 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
163 | 180 | | |
164 | 181 | | |
165 | 182 | | |
| |||
169 | 186 | | |
170 | 187 | | |
171 | 188 | | |
172 | | - | |
173 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
174 | 193 | | |
175 | 194 | | |
176 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
177 | 199 | | |
178 | 200 | | |
179 | 201 | | |
0 commit comments