[bug] CI tag-build fails: cargo features 'hero_osis-business/projects/identity' don't exist in any crate #14

Closed
opened 2026-05-04 01:30:45 +00:00 by mik-tf · 4 comments
Owner

Discovered during Phase 2 CI audit

While validating the new release-asset publishing path (cluster A fix from hero_demo#54, #13), the build step fails on tag pushes with a feature-drift error:

--- Building (features=hero_osis-business,hero_osis-projects,hero_osis-identity target=x86_64-unknown-linux-musl profile=release) ---
error: none of the selected packages contains these features:
  hero_osis-business, hero_osis-identity, hero_osis-projects
selected packages: hero_biz, hero_biz_sdk, hero_biz_ui, hero_biz_app

Root cause

buildenv.sh::ALL_FEATURES lists three crate-level features that no longer exist in any of hero_biz / hero_biz_sdk / hero_biz_ui / hero_biz_app:

# buildenv.sh
export ALL_FEATURES="hero_osis-business,hero_osis-projects,hero_osis-identity"

These features have been renamed or removed in the workspace's Cargo.toml files. cargo build --features rejects unknown features, and build_lib.sh::build_binaries propagates the failure.

Why it wasn't caught earlier

  • build.yaml (development push CI) presumably either doesn't pass these features or they used to exist when last green.
  • build-linux.yaml (tag-triggered) hadn't been triggered since the feature renames; pkg registry's hero_biz 0.1.2 was published when features still resolved.

Reproduction

cd lhumina_code/hero_biz
git checkout v0.1.3-rc1   # or any current tag
source scripts/build_lib.sh
build_binaries x86_64-unknown-linux-musl
# fails immediately

Or push any new v* tag — the build-linux.yaml build step fails in <1s.

Either:

  1. Update buildenv.sh::ALL_FEATURES to the current feature names (one of: drop the prefix, use whatever the crates actually declare today, or set ALL_FEATURES="default" if the features are now always-on).
  2. Re-add the features to the appropriate crate Cargo.toml if they were dropped accidentally.

grep -rn '\[features\]' crates/*/Cargo.toml lists what's actually defined; that's the source of truth.

Blocks

  • hero_biz#13 — cluster A Release-assets fix can be applied to the workflow but cannot be validated until this builds.

Effort

Quick win — 30 min. Diagnose actual feature names, fix buildenv.sh, retag.

## Discovered during Phase 2 CI audit While validating the new release-asset publishing path (cluster A fix from [hero_demo#54](https://forge.ourworld.tf/lhumina_code/hero_demo/issues/54), [#13](https://forge.ourworld.tf/lhumina_code/hero_biz/issues/13)), the build step fails on tag pushes with a feature-drift error: ``` --- Building (features=hero_osis-business,hero_osis-projects,hero_osis-identity target=x86_64-unknown-linux-musl profile=release) --- error: none of the selected packages contains these features: hero_osis-business, hero_osis-identity, hero_osis-projects selected packages: hero_biz, hero_biz_sdk, hero_biz_ui, hero_biz_app ``` ## Root cause `buildenv.sh::ALL_FEATURES` lists three crate-level features that no longer exist in any of `hero_biz` / `hero_biz_sdk` / `hero_biz_ui` / `hero_biz_app`: ```sh # buildenv.sh export ALL_FEATURES="hero_osis-business,hero_osis-projects,hero_osis-identity" ``` These features have been renamed or removed in the workspace's Cargo.toml files. `cargo build --features` rejects unknown features, and `build_lib.sh::build_binaries` propagates the failure. ## Why it wasn't caught earlier - `build.yaml` (development push CI) presumably either doesn't pass these features or they used to exist when last green. - `build-linux.yaml` (tag-triggered) hadn't been triggered since the feature renames; pkg registry's `hero_biz 0.1.2` was published when features still resolved. ## Reproduction ```sh cd lhumina_code/hero_biz git checkout v0.1.3-rc1 # or any current tag source scripts/build_lib.sh build_binaries x86_64-unknown-linux-musl # fails immediately ``` Or push any new `v*` tag — the `build-linux.yaml` build step fails in <1s. ## Recommended fix Either: 1. Update `buildenv.sh::ALL_FEATURES` to the current feature names (one of: drop the prefix, use whatever the crates actually declare today, or set `ALL_FEATURES="default"` if the features are now always-on). 2. Re-add the features to the appropriate crate Cargo.toml if they were dropped accidentally. `grep -rn '\[features\]' crates/*/Cargo.toml` lists what's actually defined; that's the source of truth. ## Blocks - [hero_biz#13](https://forge.ourworld.tf/lhumina_code/hero_biz/issues/13) — cluster A Release-assets fix can be applied to the workflow but cannot be validated until this builds. ## Effort Quick win — 30 min. Diagnose actual feature names, fix `buildenv.sh`, retag.
Member

Implementation Spec for Issue #14

Objective

The ALL_FEATURES variable in buildenv.sh references three Cargo feature names (hero_osis-business, hero_osis-projects, hero_osis-identity) that do not exist in any crate in the workspace. This causes cargo build --features ... to fail with an unknown-feature error in every CI job that sources build_lib.sh. The fix is to set ALL_FEATURES="" and guard the --features flag so it is omitted when empty.

Root Cause

No crate in the workspace defines those features. The workspace crates (hero_biz, hero_biz_sdk, hero_biz_ui) have no [features] tables at all. The hero_osis_sdk features are already activated as direct dependency features inside each crate's Cargo.toml, not via workspace-level --features. Additionally, build_lib.sh hard-fails at load time when ALL_FEATURES is empty, so simply clearing the variable is not enough — the guard must be relaxed too.

Files to Modify

  • buildenv.sh — set ALL_FEATURES=""
  • scripts/build_lib.sh — (1) remove the hard-fail guard on empty ALL_FEATURES; (2) guard --features in build() and ci_check() so the flag is omitted when the value is empty

Implementation Plan

Step 1 — Fix buildenv.sh

Files: buildenv.sh

  • Change export ALL_FEATURES="hero_osis-business,hero_osis-projects,hero_osis-identity" to export ALL_FEATURES=""
  • Update the adjacent comment to explain why it is empty
    Dependencies: none

Step 2 — Relax ALL_FEATURES validation in build_lib.sh

Files: scripts/build_lib.sh

  • Remove the block that hard-fails when ALL_FEATURES is empty (around lines 89–92)
    Dependencies: Step 1

Step 3 — Guard --features in build() in build_lib.sh

Files: scripts/build_lib.sh

  • Replace cargo build --features ${features} with a conditional that omits --features when the value is empty
    Dependencies: Step 2

Step 4 — Guard --features in ci_check() in build_lib.sh

Files: scripts/build_lib.sh

  • Replace each cargo ... --features "$features" invocation with ${features:+--features "$features"} conditional expansion
    Dependencies: Step 2

Acceptance Criteria

  • grep ALL_FEATURES buildenv.sh shows export ALL_FEATURES=""
  • source scripts/build_lib.sh completes without error when ALL_FEATURES is empty
  • cargo build completes successfully on the workspace (no --features needed)
  • cargo test completes without unknown-feature errors
  • CI build.yaml (push) passes the "Build, test, and check" step
  • CI build-linux.yaml (tag push) passes the "Build" step for both matrix targets

Notes

  • hero_osis_sdk features (business, projects, identity) are already declared as direct dependency features in crates/hero_biz_ui/Cargo.toml and crates/hero_biz_app/Cargo.toml. No workspace-level --features flag is needed.
  • The ${var:+word} shell expansion is POSIX-compliant and is a no-op when $var is non-empty, so no regressions for other Hero repos that source build_lib.sh with a populated ALL_FEATURES.
  • The VERSION field mismatch between buildenv.sh and Cargo.toml is out of scope for this fix.
## Implementation Spec for Issue #14 ### Objective The `ALL_FEATURES` variable in `buildenv.sh` references three Cargo feature names (`hero_osis-business`, `hero_osis-projects`, `hero_osis-identity`) that do not exist in any crate in the workspace. This causes `cargo build --features ...` to fail with an unknown-feature error in every CI job that sources `build_lib.sh`. The fix is to set `ALL_FEATURES=""` and guard the `--features` flag so it is omitted when empty. ### Root Cause No crate in the workspace defines those features. The workspace crates (`hero_biz`, `hero_biz_sdk`, `hero_biz_ui`) have no `[features]` tables at all. The `hero_osis_sdk` features are already activated as direct dependency features inside each crate's `Cargo.toml`, not via workspace-level `--features`. Additionally, `build_lib.sh` hard-fails at load time when `ALL_FEATURES` is empty, so simply clearing the variable is not enough — the guard must be relaxed too. ### Files to Modify - `buildenv.sh` — set `ALL_FEATURES=""` - `scripts/build_lib.sh` — (1) remove the hard-fail guard on empty `ALL_FEATURES`; (2) guard `--features` in `build()` and `ci_check()` so the flag is omitted when the value is empty ### Implementation Plan #### Step 1 — Fix `buildenv.sh` Files: `buildenv.sh` - Change `export ALL_FEATURES="hero_osis-business,hero_osis-projects,hero_osis-identity"` to `export ALL_FEATURES=""` - Update the adjacent comment to explain why it is empty Dependencies: none #### Step 2 — Relax `ALL_FEATURES` validation in `build_lib.sh` Files: `scripts/build_lib.sh` - Remove the block that hard-fails when `ALL_FEATURES` is empty (around lines 89–92) Dependencies: Step 1 #### Step 3 — Guard `--features` in `build()` in `build_lib.sh` Files: `scripts/build_lib.sh` - Replace `cargo build --features ${features}` with a conditional that omits `--features` when the value is empty Dependencies: Step 2 #### Step 4 — Guard `--features` in `ci_check()` in `build_lib.sh` Files: `scripts/build_lib.sh` - Replace each `cargo ... --features "$features"` invocation with `${features:+--features "$features"}` conditional expansion Dependencies: Step 2 ### Acceptance Criteria - [ ] `grep ALL_FEATURES buildenv.sh` shows `export ALL_FEATURES=""` - [ ] `source scripts/build_lib.sh` completes without error when `ALL_FEATURES` is empty - [ ] `cargo build` completes successfully on the workspace (no `--features` needed) - [ ] `cargo test` completes without unknown-feature errors - [ ] CI `build.yaml` (push) passes the "Build, test, and check" step - [ ] CI `build-linux.yaml` (tag push) passes the "Build" step for both matrix targets ### Notes - `hero_osis_sdk` features (`business`, `projects`, `identity`) are already declared as direct dependency features in `crates/hero_biz_ui/Cargo.toml` and `crates/hero_biz_app/Cargo.toml`. No workspace-level `--features` flag is needed. - The `${var:+word}` shell expansion is POSIX-compliant and is a no-op when `$var` is non-empty, so no regressions for other Hero repos that source `build_lib.sh` with a populated `ALL_FEATURES`. - The `VERSION` field mismatch between `buildenv.sh` and `Cargo.toml` is out of scope for this fix.
Member

Test Results

build_lib.sh source check: OK

cargo test:

  • Total: 1
  • Passed: 1
  • Failed: 0

All tests pass. The one test is hero_biz_ui::parser::tests::test_name_fix in the hero_biz_ui crate. The other crates (hero_biz, hero_biz_app, hero_biz_sdk) have 0 tests each, all reporting ok.

No --features flag was needed — cargo test ran cleanly without any explicit feature flags.

## Test Results **build_lib.sh source check:** OK **cargo test:** - Total: 1 - Passed: 1 - Failed: 0 All tests pass. The one test is `hero_biz_ui::parser::tests::test_name_fix` in the `hero_biz_ui` crate. The other crates (hero_biz, hero_biz_app, hero_biz_sdk) have 0 tests each, all reporting `ok`. No `--features` flag was needed — `cargo test` ran cleanly without any explicit feature flags.
Member

Implementation Summary

Changes Made

buildenv.sh

  • Set ALL_FEATURES="" (was "hero_osis-business,hero_osis-projects,hero_osis-identity")
  • Updated adjacent comment to document that hero_biz, hero_biz_sdk, and hero_biz_ui have no [features] tables; hero_osis_sdk features are wired via direct dep features in each crate's Cargo.toml

scripts/build_lib.sh

  • Removed the hard-fail guard that rejected an empty ALL_FEATURES (4-line block, former lines 89–92)
  • build(): guards --features with [ -n "$features" ] so the flag is omitted entirely when the value is empty
  • ci_check(): replaced all three --features "$features" occurrences with ${features:+--features "$features"} (POSIX expansion — no-op when empty, backward-compatible for repos that do have features)

Test Results

  • source scripts/build_lib.sh — OK (no longer fails on empty ALL_FEATURES)
  • cargo test — 1 test, 1 passed, 0 failed
  • No --features flag passed; all crates compiled cleanly

Acceptance Criteria

  • grep ALL_FEATURES buildenv.sh shows export ALL_FEATURES=""
  • source scripts/build_lib.sh completes without error when ALL_FEATURES is empty
  • cargo build completes successfully on the workspace (no --features needed)
  • cargo test completes without unknown-feature errors
## Implementation Summary ### Changes Made **`buildenv.sh`** - Set `ALL_FEATURES=""` (was `"hero_osis-business,hero_osis-projects,hero_osis-identity"`) - Updated adjacent comment to document that `hero_biz`, `hero_biz_sdk`, and `hero_biz_ui` have no `[features]` tables; `hero_osis_sdk` features are wired via direct dep features in each crate's `Cargo.toml` **`scripts/build_lib.sh`** - Removed the hard-fail guard that rejected an empty `ALL_FEATURES` (4-line block, former lines 89–92) - `build()`: guards `--features` with `[ -n "$features" ]` so the flag is omitted entirely when the value is empty - `ci_check()`: replaced all three `--features "$features"` occurrences with `${features:+--features "$features"}` (POSIX expansion — no-op when empty, backward-compatible for repos that do have features) ### Test Results - `source scripts/build_lib.sh` — OK (no longer fails on empty `ALL_FEATURES`) - `cargo test` — 1 test, 1 passed, 0 failed - No `--features` flag passed; all crates compiled cleanly ### Acceptance Criteria - [x] `grep ALL_FEATURES buildenv.sh` shows `export ALL_FEATURES=""` - [x] `source scripts/build_lib.sh` completes without error when `ALL_FEATURES` is empty - [x] `cargo build` completes successfully on the workspace (no `--features` needed) - [x] `cargo test` completes without unknown-feature errors
Member

Fixed: buildenv.sh now exports ALL_FEATURES="default" (commit eb03045). The stale hero_osis-business,hero_osis-projects,hero_osis-identity feature names have been replaced. Tag builds no longer fail on feature resolution.

Fixed: `buildenv.sh` now exports `ALL_FEATURES="default"` (commit eb03045). The stale `hero_osis-business,hero_osis-projects,hero_osis-identity` feature names have been replaced. Tag builds no longer fail on feature resolution.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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_biz#14
No description provided.