build_lib.sh fails — missing buildenv.sh in hero_lib_rha #4
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_lib_rhai#4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Description:
Running ./scripts/build_lib.sh (or any Makefile target that sources it) fails because buildenv.sh does not exist at the repository root.
Error:
Implementation Spec for Issue #4
Objective
scripts/build_lib.shis a shared library sourced in both this repo and external consumer repos (e.g.hero_lib_rhai). When sourced in a repo that does not have abuildenv.sh, the script currently fails hard with fatal errors andreturn 1, aborting sourcing entirely.The fix: make the script gracefully degrade when
buildenv.shis absent — sourcing should succeed, all utility functions remain available, and any individual function that strictly requires a missing variable will fail at call time with a clear message rather than at source time.Root Cause
Lines 63–92 of
scripts/build_lib.shcontain three sequential hard-fail guards executed at source time:Fix (3 changes to
scripts/build_lib.sh)Change 1 — Soft warn instead of hard fail when buildenv.sh absent
Replace the
return 1with anINFO:message:Change 2 — Remove source-time mandatory variable validation
Remove the three
return 1guards forPROJECT_NAME,BINARIES,ALL_FEATURESfrom top-level scope. All functions that use these variables already validate them at call time.Change 3 — Guard FORGE_PACKAGE_NAME default on PROJECT_NAME
Acceptance Criteria
source scripts/build_lib.shin a repo with nobuildenv.shexits with status0build_binaries,verify_binaries, etc.) are defined after sourcinghero_lib(withbuildenv.sh) is unchangedTest Results
Ran
make checkon hero_lib after applying the fix.cargo check --workspacecompleted successfully withFinishedstatus. Two minor dead-code warnings were present (non-blocking):crates/os/src/rootfs/distros/alpine.rs—command_existsmethod never usedcrates/webserver/src/server.rs—extra_addrsfield never readNo errors. All workspace crates checked successfully.