Repository navigation
Commit c0a71fa
committed
ci(onnx): build ONNX Runtime for macOS with the floor the app declares
`npm run build:mac` cannot package a macOS bundle today. Microsoft's
`onnxruntime-osx-arm64-*.tgz` is built for macOS 14; `electron-builder.json5`
declares `minimumSystemVersion: "13.0"`; `before-pack.cjs` refuses a payload
that demands more than the floor. Correctly — the deployment target decides
which symbols the linker resolves against the OS rather than emitting locally,
which is how #515 stranded macOS 12 users with a dyld failure they reported as
a denied permission.
THERE IS NO VERSION THAT FITS. Every macOS arm64 release was checked, 1.20
through 1.29:
1.20.0 - 1.22.0 minos 13.3
1.23.0 minos 13.4
1.24.4 - 1.29.0 minos 14.0
The floor moved at 1.24 and never came back, and even the oldest is above
13.0. Lowering `ort`'s `api-27` feature does not help. Building is the only
way to keep both macOS 13 support and webcam segmentation.
MEASURED ON AN M1 before writing this. Shallow clone of the pinned tag with
submodules 979 MB / 21 s, configure 24 s, build 10 min at `--parallel 4`. The
result is `minos 13.0`, arm64, 21.7 MB against upstream's 36.7 MB — the
difference is the CoreML execution provider, which this app does not use:
`segmentation.rs` builds its session with no explicit provider, and
webcam-segmentation.md records the CPU EP as a measured choice ("Inference
p50, CPU EP: 3.575 ms — the CPU is faster").
It was then exercised through the real code path, not just inspected:
`the_whole_loop_produces_a_mask_from_compose_frame_alone` — capture, inference,
mask, composite — went from skipped ("ONNX Runtime absent") to passing with
`ORT_DYLIB_PATH` pointed at it.
WHAT THE WORKFLOW GUARDS. It reads the version from
`scripts/fetch-onnxruntime.mjs` and the floor from `electron-builder.json5`
rather than repeating either, so neither can drift. It then fails the build if
`minos` is not the floor, and if `OrtGetApiBase` or the CPU provider is missing
from the exports. A library that came out at 14.0 anyway would be worse than
none: it would sail through packaging and fail at dyld time on the machines it
was built to support.
It drives CMake directly rather than upstream's `build.sh`, whose `build_args.py`
needs Python 3.10+. The 3.10 in `find_package(Python 3.10)` is only real for the
Python bindings; the one thing Python is genuinely needed for is generating the
symbol export list, and `gen_def.py` parses on 3.9.
IT DOES NOT PUBLISH. The workflow builds, verifies, and prints the exact
`PINNED` entry to the job summary. Attaching the archive to a release and
pasting that entry stays a human step, so the posture this script documents —
immutable URL, SHA-256 verified before the archive is opened — survives.
`fetch-onnxruntime.mjs` gains an optional per-target `baseUrl`; nothing points
at it yet, so behaviour is unchanged until a maintainer decides to adopt it.1 parent 8c9323f commit c0a71fa
2 files changed
Lines changed: 221 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 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 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
57 | 75 | | |
58 | 76 | | |
59 | 77 | | |
| |||
204 | 222 | | |
205 | 223 | | |
206 | 224 | | |
207 | | - | |
| 225 | + | |
208 | 226 | | |
209 | 227 | | |
210 | 228 | | |
| |||
0 commit comments