ci: D-05 ONNX cross-compile pattern (build-linux.yaml + buildenv.sh) #36

Merged
mik-tf merged 3 commits from development_mik_d05_embedder into development 2026-05-06 14:44:23 +00:00
Owner

Summary

Third and final application of D-05 — ONNX cross-compile via load-dynamic + bundled libonnxruntime.so + matrix musl→gnu — after hero_editor (session 60, v0.1.0-rc4) and hero_voice (session 61, v0.1.0-rc2).

No Cargo edits needed — ort was already declared with default-features = false, features = ["load-dynamic", "api-24"] on the workspace dep. Cargo invariant verified: cargo tree -e features -p hero_embedder_lib | grep -E 'download-binaries|copy-dylibs' returns empty.

Commits

  1. aa5647bchore: cargo fmt + clippy explicit_auto_deref fix (38 fmt diffs + 1 clippy site, mechanical, mirrors hero_matrixchat#7 precedent).
  2. 829745bci: D-05 ONNX cross-compile pattern for hero_embedder:
    • Pin ONNXRUNTIME_VERSION=1.25.1 in buildenv.sh (lockstep with voice + editor).
    • Port build-linux.yaml to voice-canonical D-05 shape (manual git clone, Bundle ONNX Runtime step, .so upload to both Release Assets and Package Registry, target-triple-named asset naming per home#212).
    • Matrix swap: x86_64-unknown-linux-muslx86_64-unknown-linux-gnu. aarch64-unknown-linux-gnu unchanged.
    • Preserved esaxx-rs requirement: CXX_x86_64_unknown_linux_gnu=g++ and CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++ env on Build step (embedder pulls esaxx-rs via tokenizers).
  3. 6b8eb5fci: add hero_embedderd to BINARIES:
    • hero_embedderd is the ONNX daemon — the only binary in the workspace that actually loads libonnxruntime.so via load-dynamic. Without it in BINARIES the bundled .so has no consumer, which defeats D-05's whole point for hero_embedder. The other four binaries (hero_embedder, _server, _ui, _proxy) don't load ort directly.

Pre-merge workspace gate

  • cargo fmt --check clean (after first commit).
  • cargo clippy --workspace --all-targets -- -D warnings clean (after first commit).
  • cargo build --workspace --release clean (2m 33s).

Expected release artifacts on next tag

12 assets total:

  • 5 binaries (hero_embedderd, hero_embedder_server, hero_embedder, hero_embedder_ui, hero_embedder_proxy) × 2 archs.
  • libonnxruntime.so.1.25.1-x86_64-unknown-linux-gnu.
  • libonnxruntime.so.1.25.1-aarch64-unknown-linux-gnu.

Consumer wiring

Separate PR on hero_skills will add service_embedder install --download (mirror of service_voice shape) plus a rule-of-three refactor extracting svc_install_onnx_runtime_download from service_editor.nu + service_voice.nu into shared lib.nu.

Coverage

16/15 → 17/15+ services with --download. D-05 ONNX rollout complete after this lands.

Refs

## Summary Third and final application of [D-05](https://forge.ourworld.tf/lhumina_code/hero_demo/src/branch/development/decisions/D-05-onnx-cross-compile.md) — ONNX cross-compile via `load-dynamic` + bundled `libonnxruntime.so` + matrix musl→gnu — after `hero_editor` (session 60, [v0.1.0-rc4](https://forge.ourworld.tf/lhumina_code/hero_editor/releases/tag/v0.1.0-rc4)) and `hero_voice` (session 61, [v0.1.0-rc2](https://forge.ourworld.tf/lhumina_code/hero_voice/releases/tag/v0.1.0-rc2)). No Cargo edits needed — `ort` was already declared with `default-features = false, features = ["load-dynamic", "api-24"]` on the workspace dep. Cargo invariant verified: `cargo tree -e features -p hero_embedder_lib | grep -E 'download-binaries|copy-dylibs'` returns empty. ## Commits 1. `aa5647b` — `chore: cargo fmt + clippy explicit_auto_deref fix` (38 fmt diffs + 1 clippy site, mechanical, mirrors hero_matrixchat#7 precedent). 2. `829745b` — `ci: D-05 ONNX cross-compile pattern for hero_embedder`: - Pin `ONNXRUNTIME_VERSION=1.25.1` in `buildenv.sh` (lockstep with voice + editor). - Port `build-linux.yaml` to voice-canonical D-05 shape (manual git clone, Bundle ONNX Runtime step, .so upload to both Release Assets and Package Registry, target-triple-named asset naming per home#212). - Matrix swap: `x86_64-unknown-linux-musl` → `x86_64-unknown-linux-gnu`. `aarch64-unknown-linux-gnu` unchanged. - **Preserved esaxx-rs requirement**: `CXX_x86_64_unknown_linux_gnu=g++` and `CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++` env on Build step (embedder pulls esaxx-rs via tokenizers). 3. `6b8eb5f` — `ci: add hero_embedderd to BINARIES`: - hero_embedderd is the ONNX daemon — the only binary in the workspace that actually loads libonnxruntime.so via `load-dynamic`. Without it in BINARIES the bundled .so has no consumer, which defeats D-05's whole point for hero_embedder. The other four binaries (hero_embedder, _server, _ui, _proxy) don't load ort directly. ## Pre-merge workspace gate - `cargo fmt --check` clean (after first commit). - `cargo clippy --workspace --all-targets -- -D warnings` clean (after first commit). - `cargo build --workspace --release` clean (2m 33s). ## Expected release artifacts on next tag 12 assets total: - 5 binaries (`hero_embedderd`, `hero_embedder_server`, `hero_embedder`, `hero_embedder_ui`, `hero_embedder_proxy`) × 2 archs. - `libonnxruntime.so.1.25.1-x86_64-unknown-linux-gnu`. - `libonnxruntime.so.1.25.1-aarch64-unknown-linux-gnu`. ## Consumer wiring Separate PR on `hero_skills` will add `service_embedder install --download` (mirror of `service_voice` shape) plus a rule-of-three refactor extracting `svc_install_onnx_runtime_download` from `service_editor.nu` + `service_voice.nu` into shared `lib.nu`. ## Coverage 16/15 → **17/15+** services with `--download`. D-05 ONNX rollout complete after this lands. ## Refs - https://forge.ourworld.tf/lhumina_code/hero_demo/issues/54 - https://forge.ourworld.tf/lhumina_code/home/issues/212
Pre-existing debt fixed mechanically as part of the workspace pre-merge
gate before the D-05 build-linux.yaml port. Mirrors session 58
hero_matrixchat#7 precedent (fmt debt bundled with workflow port).

- 38 fmt diffs fixed by `cargo fmt`
- 1 clippy::explicit_auto_deref fix in hero_embedder_lib/src/download.rs

Signed-off-by: mik-tf
ci: D-05 ONNX cross-compile pattern for hero_embedder
Some checks failed
Test / test (pull_request) Has been cancelled
829745b9aa
Apply the D-05 ONNX overlay (third + final ONNX service after
hero_editor and hero_voice). load-dynamic was already declared on the
workspace ort dep, so this PR is the workflow + buildenv half of the
overlay.

- Pin ONNXRUNTIME_VERSION=1.25.1 in buildenv.sh (lockstep with voice +
  editor; bump in lockstep with service_embedder.nu SVX_ONNX_VERSION).
- Port build-linux.yaml to the voice-canonical D-05 shape:
  * matrix x86_64-unknown-linux-musl -> x86_64-unknown-linux-gnu
    (Microsoft ships no musl onnxruntime tarball; D-05 swap)
  * aarch64-unknown-linux-gnu unchanged
  * manual git clone checkout (Forgejo + actions/checkout@v4 auth bug)
  * preserve esaxx-rs CXX env vars (CXX_x86_64_unknown_linux_gnu=g++,
    CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++) — embedder
    pulls esaxx-rs via tokenizers
  * Bundle ONNX Runtime step downloads Microsoft's official tarball
    and copies libonnxruntime.so* next to the binaries
  * Upload Release Assets and Upload to Package Registry both publish
    libonnxruntime.so.<ver>-<target-triple> alongside the binaries

Expected release artifacts on next tag: 10 assets total
  4 binaries (hero_embedder_server, hero_embedder, hero_embedder_ui,
  hero_embedder_proxy) x 2 archs + libonnxruntime.so.1.25.1 x 2 archs.

Refs lhumina_code/hero_demo#54
Refs decisions/D-05-onnx-cross-compile.md (in
https://forge.ourworld.tf/lhumina_code/hero_demo)

Signed-off-by: mik-tf
ci: add hero_embedderd to BINARIES (D-05 consumer of bundled .so)
All checks were successful
Test / test (pull_request) Successful in 4m32s
6b8eb5fb1b
hero_embedderd is the ONNX daemon — the only binary in the workspace
that loads libonnxruntime.so via the load-dynamic ort feature. Without
it in BINARIES, the new build-linux.yaml ships the bundled
libonnxruntime.so but no consumer for it, which defeats D-05 for
hero_embedder. The other four binaries (hero_embedder, _server, _ui,
_proxy) do not load ort directly.

Bumps expected asset count on next tag from 10 to 12:
  5 binaries x 2 archs + libonnxruntime.so.1.25.1 x 2 archs.

Signed-off-by: mik-tf
mik-tf merged commit 2257c36518 into development 2026-05-06 14:44:23 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_embedder!36
No description provided.