Commit 9727d19
release: the macOS signing script stops changing directory
Found by the first real release, which it stopped twice in two consecutive
steps.
Phase B refused on tfg-gui.app with "was signed by a DIFFERENT certificate,
expected C656..., got none". The signature was correct: codesign -dv on that
same bundle shows Developer ID Application, a chain to the Apple Root CA and a
timestamp. What failed was reading it back.
certificate_of cd'd into a temporary directory and then asked codesign about
the bundle, because --extract-certificates looked like a file name rather than
a path. The bundle path is relative - sign_release.py hands this script a
directory under the home directory - so after the cd it named nothing, codesign
answered "No such file or directory", and no certificate came out. A refusal
that is right about there being a problem and wrong about what it is costs more
than a silent one: it sends somebody to look at the card.
Measured on the Mac, all three ways: relative after a cd gives nothing,
absolute gives exactly the pinned digest, and relative with the prefix written
as a path and no cd gives the same. So the cd goes.
The same trap sat one step further on and was measured before anybody reached
it: the zip for notarisation cd'd into the unpacked directory and wrote to a
path relative to where the script started, so the file was never created. Bare
ditto with both paths as they arrive works, and --keepParent still puts the
.app at the top of the archive - read back out of the zip rather than assumed.
Why the rehearsal did not show this: it ran the script by hand with an absolute
directory, and the real caller passes a relative one. The command was proven,
the call was not.
The guard asks whether there is any cd at all rather than whether the paths are
absolute, because that is the property that can be read off the file. If a
directory change is ever genuinely needed here, the guard is the conversation
about it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 2f2371e commit 9727d19
2 files changed
Lines changed: 64 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
123 | 139 | | |
124 | 140 | | |
125 | 141 | | |
126 | | - | |
| 142 | + | |
127 | 143 | | |
128 | 144 | | |
129 | 145 | | |
| |||
172 | 188 | | |
173 | 189 | | |
174 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
175 | 198 | | |
176 | | - | |
| 199 | + | |
177 | 200 | | |
178 | 201 | | |
179 | 202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
207 | 246 | | |
208 | 247 | | |
209 | 248 | | |
| |||
0 commit comments