mirror of
https://github.com/samvallad33/vestige.git
synced 2026-05-11 16:52:36 +02:00
Microsoft is discontinuing x86_64 macOS ONNX Runtime prebuilts after v1.23.0, so ort-sys 2.0.0-rc.11 can't ship an Intel Mac binary and never will. Previous Intel Mac attempts kept dying in the ort-sys build script with "does not provide prebuilt binaries for the target x86_64-apple-darwin with feature set (no features)." Issue #41 was the latest casualty. Fix: route Intel Mac through the ort-dynamic feature path (runtime dlopen against a system libonnxruntime installed via Homebrew). This sidesteps ort-sys prebuilts entirely and works today. Changes: - crates/vestige-core/Cargo.toml: split `embeddings` into code-only vs backend-choice. The embeddings feature now just pulls fastembed + hf-hub + image-models and activates the 27 #[cfg(feature = "embeddings")] gates throughout the crate. New `ort-download` feature carries the download-binaries-native-tls backend (the historical default). Existing `ort-dynamic` feature now transitively enables `embeddings`, so the cfg gates stay active when users swap backends. Default feature set expands `["embeddings", ...]` -> `["embeddings", "ort-download", ...]` so existing consumers see identical behavior. - crates/vestige-mcp/Cargo.toml: mirrors the split. Adds `ort-download` feature that chains to vestige-core/ort-download, keeps `ort-dynamic` that chains to vestige-core/ort-dynamic. Both transitively pull `embeddings`. Default adds `ort-download` so `cargo install vestige-mcp` still picks the prebuilt-ort backend like before. - .github/workflows/ci.yml: re-adds x86_64-apple-darwin to the release-build matrix with `--no-default-features --features ort-dynamic,vector-search`. Adds a `brew install onnxruntime` step that sets ORT_DYLIB_PATH from `brew --prefix onnxruntime`. - .github/workflows/release.yml: re-adds x86_64-apple-darwin to the release matrix with the same flags + brew install step. The Intel Mac tarball now also bundles docs/INSTALL-INTEL-MAC.md so binary consumers get the `brew install onnxruntime` + ORT_DYLIB_PATH prereq out of the box. - docs/INSTALL-INTEL-MAC.md: new install guide covering the Homebrew prereq, binary install, source build, troubleshooting, and the v2.1 ort-candle migration plan. - README.md: replaces the "Intel Mac and Windows build from source only" paragraph with the prebuilt Intel Mac install (brew + curl + env var) and a link to the full guide. Platform table updated: Intel Mac back on the "prebuilt" list. Verified locally on aarch64-apple-darwin: - `cargo check --release -p vestige-mcp` -> clean (default features) - `cargo check --release -p vestige-mcp --no-default-features --features ort-dynamic,vector-search` -> clean Runtime path on Intel Mac (verified on CI): brew install onnxruntime export ORT_DYLIB_PATH=$(brew --prefix onnxruntime)/lib/libonnxruntime.dylib vestige-mcp --version Fixes #41. Long-term plan (v2.1): migrate to ort-candle pure-Rust backend so no system ONNX Runtime dep is needed on any platform. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
111 lines
3.1 KiB
YAML
111 lines
3.1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUST_BACKTRACE: 1
|
|
|
|
jobs:
|
|
test:
|
|
name: Test (${{ matrix.os }})
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [macos-latest, ubuntu-latest]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: clippy
|
|
|
|
- name: Cache cargo
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/bin/
|
|
~/.cargo/registry/index/
|
|
~/.cargo/registry/cache/
|
|
~/.cargo/git/db/
|
|
target/
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: ${{ runner.os }}-cargo-
|
|
|
|
- name: Check
|
|
run: cargo check --workspace
|
|
|
|
- name: Clippy
|
|
run: cargo clippy --workspace -- -D warnings
|
|
|
|
- name: Test
|
|
run: cargo test --workspace
|
|
|
|
release-build:
|
|
name: Release Build (${{ matrix.target }})
|
|
runs-on: ${{ matrix.os }}
|
|
if: github.ref == 'refs/heads/main'
|
|
needs: [test]
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: macos-latest
|
|
target: aarch64-apple-darwin
|
|
cargo_flags: ""
|
|
needs_onnxruntime: false
|
|
# Intel Mac builds against a system ONNX Runtime via ort-dynamic
|
|
# (ort-sys has no x86_64-apple-darwin prebuilts). Keeps the target
|
|
# green on CI so regressions surface before a release cut.
|
|
- os: macos-latest
|
|
target: x86_64-apple-darwin
|
|
cargo_flags: "--no-default-features --features ort-dynamic,vector-search"
|
|
needs_onnxruntime: true
|
|
- os: ubuntu-latest
|
|
target: x86_64-unknown-linux-gnu
|
|
cargo_flags: ""
|
|
needs_onnxruntime: false
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: ${{ matrix.target }}
|
|
|
|
- name: Cache cargo
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/bin/
|
|
~/.cargo/registry/index/
|
|
~/.cargo/registry/cache/
|
|
~/.cargo/git/db/
|
|
target/
|
|
key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
- name: Install ONNX Runtime (Intel Mac dynamic link)
|
|
if: matrix.needs_onnxruntime
|
|
run: |
|
|
brew install onnxruntime
|
|
echo "ORT_DYLIB_PATH=$(brew --prefix onnxruntime)/lib/libonnxruntime.dylib" >> $GITHUB_ENV
|
|
|
|
- name: Build release
|
|
run: cargo build --release --target ${{ matrix.target }} -p vestige-mcp ${{ matrix.cargo_flags }}
|
|
|
|
- name: Package
|
|
run: |
|
|
cd target/${{ matrix.target }}/release
|
|
tar czf ../../../vestige-mcp-${{ matrix.target }}.tar.gz vestige-mcp vestige vestige-restore
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: vestige-mcp-${{ matrix.target }}
|
|
path: vestige-mcp-${{ matrix.target }}.tar.gz
|