Skip to content

fix(macos): serve ONNX Runtime from a build that respects the 13.0 floor - #599

Merged
EtienneLescot merged 1 commit into
mainfrom
claude/onnx-adopt-macos13
Sep 4, 2026
Merged

fix(macos): serve ONNX Runtime from a build that respects the 13.0 floor#599
EtienneLescot merged 1 commit into
mainfrom
claude/onnx-adopt-macos13

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

npm run build:mac does not package on this branch's parent. It fails in before-pack.cjs, and it is right to: Microsoft's published onnxruntime-osx-arm64-1.27.1.tgz is built with minos 14.0, the app declares a 13.0 floor, and a payload may not demand more than the app promises — the deployment target decides which symbols the linker resolves against the OS instead of emitting locally (#515).

No published release fixes this. Every ONNX Runtime release from 1.24 on is minos 14.0; every one before it is at least 13.3. There is no 13.0 build to point at, so this points at one we make.

What changes

The darwin-arm64 entry now resolves to an archive built by build-onnxruntime-macos.yml (merged in #595) from the same upstream commit already recorded in this file, with the deployment target pinned and minos, OrtGetApiBase and the CPU provider all checked before upload. Provenance is attested:

gh attestation verify onnxruntime-osx-arm64-1.27.1.tgz --repo getopenscreen/openscreen

Everything else about the fetch is untouched: immutable URL, SHA-256 verified before the archive is opened, license extracted and checked. What moved is who built the bytes, not how far they are trusted.

Second, unrelated but found while publishing: that workflow's on.push had paths: and no branches:, so pushing the artifact's own tag started a fresh 22-minute build of what had just been attached to the release (run 33887404444, cancelled). Now restricted to main.

What I verified

Not "it should work" — run, on this machine, against these exact bytes.

Check Result
node scripts/fetch-onnxruntime.mjs --force downloads from the release, sha256 ok (7 MB), license MIT, exit 0
Vendored library minos 13.0, 21.7 MB, exports OrtGetApiBase + …AppendExecutionProvider_CPU
npx electron-builder --mac dir --arm64 succeeds, before-pack.cjs untouched and un-disarmed — this is the thing that was broken
Packaged app carries the 13.0 dylib; no native binary in the bundle exceeds the 13.0 floor
Real inference cargo test -p openscreen-compositor --features segmentation --lib8 passed, log says ONNX Runtime présent, so the inference tests ran rather than skipped
Falsifiability control with ORT_DYLIB_PATH pointing at nothing, three of those tests print test sauté — proving the pass above was not vacuous

What I don't know

  • Nobody has run this on macOS 13. This Mac is on 26.5, and minos 13.0 is a statement about what the linker targeted, not a test that the library executes there. It is the same guarantee every other native binary in the bundle ships with, and no stronger.
  • The bytes are not reproducible by re-running the workflow. The compiler is whatever the runner image carries, and the run records ImageOS for that reason. Two builds of the same commit are not guaranteed byte-identical, so the SHA-256 here pins this artifact, not "any build of df2ba1cf".
  • The CPU execution provider is the only one built; nothing else was requested and nothing else was checked for.

What a reviewer should contest

  1. This is the project building its own dependency binary. That is a real cost — a supply chain to maintain, and a rebuild needed at each version bump. The alternative I would rather have had is upstream shipping a 13.0 build, which they do not. The other real option is gating webcam blur off below macOS 14 and staying on Microsoft's archive; that trades a working feature on 13.x for one less thing to own, and it is a product call, not a technical one. Say so if you want it.
  2. The archive lives under a v0.0.0-* tag, which is the marker this repo uses for a binary needing a permanent URL that is not a product version. ci(build): do not run the release matrix for internal v0.0.0-* tags #598 taught build.yml to ignore that prefix; the package-manager workflows already skip prereleases. The one thing that still fires is the Discord announcement.
  3. segmentation.rs still says the macOS CI "ne la stage pas encore" — with this merged, CI could stage the library and actually run those three inference tests instead of skipping them. I did not widen the scope to do it; it is worth a follow-up.

Closes #591.

Summary by CodeRabbit

  • Bug Fixes
    • macOS builds now avoid being retriggered when release tags are pushed.
    • Apple Silicon builds use an artifact compatible with the app’s macOS 13.0 minimum requirement.
    • Artifact integrity verification has been updated for the new build source.

`npm run build:mac` could not package at all. Microsoft's published
`onnxruntime-osx-arm64-1.27.1.tgz` is built with `minos 14.0`, the app declares
a 13.0 floor, and `before-pack.cjs` refuses a payload that demands more than the
app promises — correctly, since the deployment target decides which symbols the
linker resolves against the OS rather than emitting locally (#515). No published
release fixes it: every one from 1.24 on is 14.0, and every one before it is at
least 13.3.

So the archive now comes from `build-onnxruntime-macos.yml`, which builds the
same upstream commit with the target pinned, checks `minos` and the ABI surface,
and attests provenance. Only the origin of the bytes moves; the URL is still
immutable and the SHA-256 is still verified before the archive is opened.

Also stops that workflow from triggering on tag pushes: `on.push` had `paths:`
but no `branches:`, so publishing the artifact under its own tag started a fresh
22-minute build of what had just been attached to the release.

Closes #591
@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: e935e443-1630-477c-a333-b25590c4e4d3

📥 Commits

Reviewing files that changed from the base of the PR and between 64e1af3 and 9b5407f.

📒 Files selected for processing (2)
  • .github/workflows/build-onnxruntime-macos.yml
  • scripts/fetch-onnxruntime.mjs

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The macOS ARM64 ONNX Runtime pin now uses a repository-built release with a new checksum. The macOS build workflow now runs automatically only for pushes to main; manual dispatch remains available.

Changes

macOS ONNX Runtime artifact

Layer / File(s) Summary
Build and consume the macOS ARM64 artifact
.github/workflows/build-onnxruntime-macos.yml, scripts/fetch-onnxruntime.mjs
The darwin-arm64 pin now uses the repository release v0.0.0-onnxruntime-1.27.1 and its SHA-256 digest. The workflow limits automatic runs to pushes on main.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 9b540

macOS ARM64 packaging now obtains ONNX Runtime from a project-built, checksum-pinned release intended for the macOS 13.0 support floor, and automatic artifact builds are limited to main. No merge-blocking risk is currently identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The workflow change that restricts push-triggered builds to main prevents duplicate artifact builds, but it is explicitly unrelated to issue #591's macOS packaging objective. Move the workflow trigger change to a separate pull request, or link it to an issue that defines duplicate artifact builds as an objective of this change.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the macOS ONNX Runtime packaging fix and the required 13.0 deployment target.
Description check ✅ Passed The description provides detailed change context, issue linkage, implementation details, risks, and testing results. It omits the template's Type of change, Release impact, and Desktop impact checklis…
Linked Issues check ✅ Passed The PR resolves issue #591 by replacing the macOS ONNX Runtime archive with a project-built artifact targeting macOS 13.0. It preserves the packaging guard, verifies required binary properties, and ke…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/onnx-adopt-macos13

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@EtienneLescot

Copy link
Copy Markdown
Collaborator Author

One consequence I would rather state than let you find: merging this will start a ~24-minute ONNX build. Both files this PR touches are in that workflow's paths:, and the merge is a push to main, so it matches.

That build is redundant — it will produce an artifact already published and already pinned here — but I left it rather than narrowing the filter further. The trigger cannot express "only when VERSION changes", and the rebuild does do something real: it proves the pinned commit still builds green with the runner image of the day. If you would rather not pay for it, cancel the run; nothing depends on it.

Verified on the branch push that the branches: [main] guard works — no run was queued for claude/onnx-adopt-macos13, where the old trigger would have started one.

@EtienneLescot
EtienneLescot merged commit 5b6149a into main Sep 4, 2026
18 checks passed
@EtienneLescot
EtienneLescot deleted the claude/onnx-adopt-macos13 branch September 4, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

npm run build:mac cannot package: ONNX Runtime 1.27.1 is built for macOS 14, the app's floor is 13

1 participant