D-05 ONNX cross-compile — editor pilot (load-dynamic + bundled libonnxruntime.so) #8
No reviewers
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_editor!8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_mik_d05_onnx_editor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements D-05 on
hero_editor— first of three pilots (editor → voice → embedder).Summary
voice_activity_detectorwithdefault-features = false, features = ["load-dynamic"]so the transitive ort dep dlopen-loadslibonnxruntime.soat runtime instead of linking at build time.[features] default = []tohero_editor_sdkso the workflowcargo --features defaultresolves (playbook item 9, mirrorshero_matrixchat_sdkfrom session 58)..forgejo/workflows/build-linux.yamlto the post-home#212 canonical shape (target-triple asset naming, dual upload, race-tolerant Create Release). Mirrorshero_matrixchat.x86_64-unknown-linux-musl→x86_64-unknown-linux-gnufor ONNX services only. Microsoft does not ship a musl onnxruntime tarball; the 14 non-ONNX services keep static-musl untouched.Bundle ONNX Runtimestep downloadsonnxruntime-linux-{x64,aarch64}-${ONNXRUNTIME_VERSION}.tgzfrom Microsoft and copieslibonnxruntime.so*next to the binaries; upload steps emitlibonnxruntime.so.${ONNXRUNTIME_VERSION}-${target-triple}as a separate asset (8 assets per release: 3 bins + 1 .so × 2 archs, ~+8 MB per arch).ONNXRUNTIME_VERSION=1.25.1inbuildenv.shas single source of truth.99e094f, andcargo fmt+ a syntax-error fix inexamples/basic_usage.rs(4 brokenprintln!string literals — string closed mid-message).Local verification
cargo tree -e features -p hero_editor_uiconfirmsvoice_activity_detectoris enabled withload-dynamic. ort defaults leak through VADs upstream ort declaration (which does not disable defaults), but on gnu the openssl-sys/ureq cascade compiles as host-side build-deps without issue.ort-sys/build.rs:676shows the runtime download path is gated on pkg-config failure + env var, so its benign even when activated.cargo build --workspace --releaseclean.cargo check --workspaceclean (warnings only — strict clippy debt tracked in hero_editor#7, deferred perhero_biz#22/hero_foundry#28precedent).Test plan
v0.1.0-rc4(rc1/rc2/rc3 burned in earlier session 55 attempts, before D-05).hero_editor*-{x86_64,aarch64}-unknown-linux-gnu× 3 bins +libonnxruntime.so.1.25.1-*-unknown-linux-gnu× 2)..so(playbook item 12).service_editor install --from-ci, confirm OpenRPChealthreturns ok (playbook item 13). Voice WS deferred to UX-validation gate.Out of scope
Mechanical pre-merge gate cleanup before applying D-05. - cargo fmt across the workspace (5 files reflowed by current rustfmt). - crates/hero_editor_examples/examples/basic_usage.rs had unbalanced quotes in 4 println! lines that closed the string literal mid-message (`println!("...{{...}}" - Read file content");`). The intended message put `- Read file content` inside the string. Without this fix the example doesn't even tokenize, which blocked `cargo fmt --check`. - crates/hero_editor_server/src/lib.rs picks up the clippy quick wins found while running the strict pre-merge gate: collapse a nested `if check_extension { if let Some(ext) = ...` into an `if let` chain, and drop four `.map_err(|e| internal_err(e))` redundant closures. Remaining strict-clippy debt (broken examples/health.rs SDK call site, dead structs/imports in hero_editor_ui) is tracked in hero_editor#7 and deferred per the hero_biz#22 / hero_foundry#28 precedent. Signed-off-by: mik-tfApply the D-05 ONNX cross-compile pattern (decisions/D-05-onnx-cross-compile.md) to hero_editor. First implementation pilot of the shared pattern that will also unblock hero_voice (session 61) and hero_embedder (session 62). Cargo: - Workspace-pin voice_activity_detector with default-features = false, features = ["load-dynamic"] so the transitive ort dep loads libonnxruntime.so via dlopen at runtime instead of link-time. - Switch hero_editor_ui to consume the workspace pin. - Add `[features] default = []` on hero_editor_sdk so the workflow's `cargo --features default` resolves (mirrors hero_matrixchat_sdk fix from session 58, playbook item 9). Workflow (.forgejo/workflows/build-linux.yaml): - Port to the post-home#212 canonical shape (target-triple asset naming, dual upload to release assets + package registry, separate Create Release step with race-tolerant GET-or-POST). Mirrors hero_matrixchat's build-linux.yaml. - Swap matrix x86_64-unknown-linux-musl -> x86_64-unknown-linux-gnu. Microsoft does not ship a musl onnxruntime tarball, so ONNX services move to glibc; the 14 non-ONNX services keep static-musl. - New `Bundle ONNX Runtime` step between Build and Upload: download Microsoft's onnxruntime-linux-{x64,aarch64}-${ONNXRUNTIME_VERSION}.tgz and copy libonnxruntime.so* next to the built binaries so the upload steps pick them up (playbook item 12). - Upload libonnxruntime.so.${ONNXRUNTIME_VERSION}-${target-triple} as a separate asset alongside the binaries (8 assets total: 3 binaries + 1 .so per arch, ~+8 MB per arch). buildenv.sh: - Pin ONNXRUNTIME_VERSION=1.25.1 as the single source of truth for the workflow's tarball download. Local verification on x86_64-unknown-linux-gnu: - `cargo tree -e features -p hero_editor_ui` confirms voice_activity_detector is enabled with `load-dynamic`. ort defaults still leak through VAD's upstream ort declaration (which doesn't disable defaults), but on gnu the openssl-sys/ureq cascade compiles as host-side build-deps without issue, and ort-sys's `download-binaries` runtime path is gated and benign when load-dynamic is set (ort-sys/build.rs:676). - `cargo build --workspace --release` clean, `cargo check --workspace` clean (warnings only — strict clippy debt tracked in hero_editor#7). Closes nothing yet — completes after the consumer-side (hero_skills/service_editor.nu --from-ci) lands and v0.1.0-rc4 ships. Signed-off-by: mik-tfmik-tf referenced this pull request from lhumina_code/hero_demo2026-05-05 15:29:36 +00:00