ci(release): scope cargo build to the 4 shipped binaries #19

Merged
mik-tf merged 1 commit from development_mik_home212_lib_rhai_scope_build into development 2026-05-06 18:27:46 +00:00
Owner

Refs lhumina_code/home#212

Fix-forward on PRs #14 / #15 / #17 — v0.1.0-rc3 build-linux failed at 2m43 on libusb1-sys C compile (linux/magic.h: No such file or directory). Run: https://forge.ourworld.tf/lhumina_code/hero_lib_rhai/actions/runs/78

Root cause

build_binaries() from scripts/build_lib.sh calls cargo build without -p or --workspace. In this virtual workspace that builds all members — including crates/gpu_agent, which pulls pci-infolibusb1-sys → needs linux kernel headers the runner image doesn't ship.

We don't publish gpu_agent as a binary in this release. The 4 binaries we ship are listed in buildenv.sh:

hero_do hero_runner_rhai hero_runner_rhai_server hero_runner_rhai_ui

Fix

Replace build_binaries() with an explicit cargo build -p ... for just those four packages. verify_binaries + compress_binaries from the helper still run afterward, so UPX compression and BIN_DIR semantics are preserved. Note crates/hero_do's [package].name is herolib_do (binary name hero_do is set via [[bin]]) — that's why -p herolib_do is the correct package flag.

Alternative considered: install linux-libc-dev on the runner. Rejected — masks the real issue (we shouldn't be building gpu_agent for a release that doesn't ship it) and adds a dep that affects every workspace touching the helper.

After merge

Tag v0.1.0-rc4. Expected: 4 release assets, all x86_64-unknown-linux-musl.

Signed-off-by: mik-tf

Refs https://forge.ourworld.tf/lhumina_code/home/issues/212 Fix-forward on PRs #14 / #15 / #17 — v0.1.0-rc3 build-linux failed at 2m43 on `libusb1-sys` C compile (`linux/magic.h: No such file or directory`). Run: https://forge.ourworld.tf/lhumina_code/hero_lib_rhai/actions/runs/78 ## Root cause `build_binaries()` from `scripts/build_lib.sh` calls `cargo build` without `-p` or `--workspace`. In this virtual workspace that builds *all* members — including `crates/gpu_agent`, which pulls `pci-info` → `libusb1-sys` → needs linux kernel headers the runner image doesn't ship. We don't publish `gpu_agent` as a binary in this release. The 4 binaries we ship are listed in `buildenv.sh`: ``` hero_do hero_runner_rhai hero_runner_rhai_server hero_runner_rhai_ui ``` ## Fix Replace `build_binaries()` with an explicit `cargo build -p ...` for just those four packages. `verify_binaries` + `compress_binaries` from the helper still run afterward, so UPX compression and BIN_DIR semantics are preserved. Note `crates/hero_do`'s `[package].name` is `herolib_do` (binary name `hero_do` is set via `[[bin]]`) — that's why `-p herolib_do` is the correct package flag. Alternative considered: install `linux-libc-dev` on the runner. Rejected — masks the real issue (we shouldn't be building `gpu_agent` for a release that doesn't ship it) and adds a dep that affects every workspace touching the helper. ## After merge Tag `v0.1.0-rc4`. Expected: 4 release assets, all `x86_64-unknown-linux-musl`. Signed-off-by: mik-tf
ci(release): scope cargo build to the 4 shipped binaries
Some checks failed
Tests / test-linux (pull_request) Failing after 23s
Lint / lint-linux (pull_request) Successful in 1m8s
361047e81d
v0.1.0-rc3 build-linux failed at 2m43 on `libusb1-sys` C compile —
`linux/magic.h: No such file or directory`. The runner image
(ghcr.io/despiegk/builder:latest) doesn't ship kernel headers, and
`apt-get install linux-libc-dev` would only fix the symptom.

Root cause: `build_binaries()` from `scripts/build_lib.sh` calls
`cargo build` with no -p / --workspace flag. In a virtual workspace
that builds *all* members. hero_lib_rhai's workspace includes
`crates/gpu_agent`, which pulls `pci-info` → `libusb1-sys` → needs
linux kernel headers we don't have at build time.

We don't ship gpu_agent as a binary in this release. Scoping the
cargo build to just the four packages we publish (herolib_do +
hero_runner_rhai{,_server,_ui}) sidesteps the libusb dep entirely.

verify_binaries + compress_binaries from the helper still run after
the explicit cargo build, so UPX compression and BIN_DIR semantics
are preserved.

Refs lhumina_code/home#212

Signed-off-by: mik-tf
mik-tf merged commit 6efb099db8 into development 2026-05-06 18:27:46 +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_lib_rhai!19
No description provided.