Skip to content

feat(xberg): build Intel macOS with ort-dynamic + onnxruntime#6

Merged
Goldziher merged 1 commit into
xberg-io:mainfrom
tobocop2:feat/intel-mac-ort-dynamic
Jul 3, 2026
Merged

feat(xberg): build Intel macOS with ort-dynamic + onnxruntime#6
Goldziher merged 1 commit into
xberg-io:mainfrom
tobocop2:feat/intel-mac-ort-dynamic

Conversation

@tobocop2

@tobocop2 tobocop2 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Problem

The xberg formula builds with the default (statically-linked) ONNX Runtime feature set, which has no x86_64-apple-darwin prebuilt — ort dropped it in v2.0.0-rc.11 and Microsoft stopped shipping onnxruntime-osx-x86_64 after 1.23. So there is no Intel-macOS bottle: the build simply can't link ONNX Runtime on that target.

Solution

On Intel macOS only, build with ort's load-dynamic strategy (--features …,ort-dynamic), add a runtime dependency on the onnxruntime formula (Homebrew's x86_64 build is 1.27, which satisfies ort's ≥1.24 check), and wrap the binary with an env script that points ORT_DYLIB_PATH at the Homebrew libonnxruntime.dylib — because ort dlopens it at runtime rather than linking it.

arm64 macOS and Linux take the unchanged else branch (static ONNX Runtime, no new dependency), so their bottles are byte-identical to today.

Pairs with xberg-io/xberg#1194, which adds the ort-dynamic feature and the macos-15-intel bottle matrix row. Because the formula builds x86_64 with ort-dynamic, that xberg change needs to land first for a release to build the Intel bottle.

Verification

ruby -c and brew style (only the repo's pre-existing single-quote style notes) are clean. The runtime mechanism — Homebrew's x86_64 onnxruntime loaded by ort's load-dynamic path — was proven end to end on a macos-15-intel runner in the paired PR: a cargo-built ort-dynamic CLI installs the Homebrew onnxruntime and runs real ONNX inference against it (evidence; a follow-up run re-proves the same ort-dynamic load path with the packaged CLI bundle: run 28633177260). The formula wires that same dylib via ORT_DYLIB_PATH; full bottle verification runs when the paired xberg PR merges and a release builds the Intel bottle.

Intel Macs have no static ONNX Runtime prebuilt (ort dropped x86_64-apple-darwin
in v2.0.0-rc.11; Microsoft dropped onnxruntime-osx-x86_64 after 1.23), so the
x86_64 build uses ort's load-dynamic strategy: build with the ort-dynamic
feature, depend on the onnxruntime formula, and point ORT_DYLIB_PATH at its
dylib via an env wrapper. arm64 macOS and Linux are unchanged.
@tobocop2 tobocop2 requested a review from Goldziher as a code owner July 2, 2026 21:52
tobocop2 added a commit to tobocop2/kreuzberg that referenced this pull request Jul 2, 2026
Pairs with the tap formula change (xberg-io/homebrew-tap#6) that builds x86_64
with ort-dynamic + depends_on onnxruntime.
@Goldziher Goldziher merged commit 4d257d0 into xberg-io:main Jul 3, 2026
4 checks passed
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.

2 participants