Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/scripts/check-ort-feature-sync.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import json
import subprocess
import sys

metadata = json.loads(
subprocess.check_output(["cargo", "metadata", "--format-version", "1", "--locked"], text=True)
)
root = next(pkg for pkg in metadata["packages"] if pkg["name"] == "outline-core")
ort = next(pkg for pkg in metadata["packages"] if pkg["name"] == "ort")
feature_map = root["features"]
ort_defaults = set(ort["features"]["default"])

enabled = {
feature
for dep in root["dependencies"]
if dep["name"] == "ort"
for feature in dep["features"]
}

pending = list(feature_map["default"])
seen = set()

while pending:
item = pending.pop()
if item.startswith("ort/"):
enabled.add(item.split("/", 1)[1])
continue
if item.startswith("dep:") or item in seen:
continue
if item in feature_map:
seen.add(item)
pending.extend(feature_map[item])

missing = sorted(ort_defaults - enabled)
if missing:
print(f"missing mirrored ort default features: {', '.join(missing)}", file=sys.stderr)
print(f"ort defaults: {', '.join(sorted(ort_defaults))}", file=sys.stderr)
print(f"enabled here: {', '.join(sorted(enabled))}", file=sys.stderr)
raise SystemExit(1)

print(f"ort default features mirrored: {', '.join(sorted(ort_defaults))}")
12 changes: 8 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ env:
CARGO_TERM_COLOR: always
# ONNX Runtime (Linux x64) archive used by the runtime-strategy CI jobs.
# Cached under `ORT_ROOT`, unpacked to `ORT_DIR`, and shared as `ORT_ASSET_ARCHIVE`.
ORT_VERSION: 1.23.2
ORT_VERSION: 1.24.4
ORT_ROOT: .ci
ORT_DIR: .ci/onnxruntime
ORT_PKGCONFIG_DIR: .ci/pkgconfig
ORT_ASSET_ARCHIVE: .ci/ort-assets.tgz
ORT_ARCHIVE: onnxruntime-linux-x64-1.23.2.tgz
ORT_URL: https://github.com/microsoft/onnxruntime/releases/download/v1.23.2/onnxruntime-linux-x64-1.23.2.tgz
ORT_SHA256: 1fa4dcaef22f6f7d5cd81b28c2800414350c10116f5fdd46a2160082551c5f9b
ORT_ARCHIVE: onnxruntime-linux-x64-1.24.4.tgz
ORT_URL: https://github.com/microsoft/onnxruntime/releases/download/v1.24.4/onnxruntime-linux-x64-1.24.4.tgz
ORT_SHA256: 3a211fbea252c1e66290658f1b735b772056149f28321e71c308942cdb54b747

jobs:
build:
Expand All @@ -34,6 +34,10 @@ jobs:

steps:
- uses: actions/checkout@v4
# Keep mirrored ort defaults aligned with upstream.
- name: Check mirrored ort defaults
if: matrix.name == 'default'
run: python3 .github/scripts/check-ort-feature-sync.py
- name: Build
run: cargo build --verbose ${{ matrix.args }}
- name: Run tests
Expand Down
Loading
Loading