Fix build system, CI pipeline, and add three-tier local CI reproduction #16

Closed
opened 2026-02-18 17:23:56 +00:00 by mik-tf · 0 comments
Owner

Context

PR #14 started as a dependency and port cleanup but grew into a comprehensive build system and CI overhaul. The Makefile had argument bugs that broke CI, test-all.sh duplicated raw cargo commands instead of using Makefile targets, and there was no way to reproduce CI locally with full fidelity.

Goals

Build fixes (CI blockers)

  • Fix build releasebuild in Makefile build target (build() signature is features, target, profile — "release" went into features arg)
  • Fix build debugbuild "$ALL_FEATURES" "" debug in installdev target (same class of bug)
  • Fix all clippy warnings (collapsible_if, map_or, unsafe fn bodies, dead_code)
  • Run cargo fmt on pre-existing formatting issues

CI pipeline alignment

  • Align test-all.sh to call make targets (fmt-check, lint, check, test, build) instead of raw cargo commands — Makefile is the single source of truth
  • Simplify CI workflow (build.yaml) to single make test-all step
  • Add CARGO_NET_GIT_FETCH_WITH_CLI=true to ci-local.sh to match CI environment

Three-tier local CI reproduction

  • make test-all (~80% fidelity) — quick offline checks, fastest iteration
  • make ci-local (~95% fidelity) — moves workspace .cargo/config.toml aside, sets CI env vars, runs make test-all
  • make ci-docker (~100% fidelity) — runs inside ghcr.io/despiegk/builder:latest (same image as CI), Docker isolation eliminates all environment differences

ci-docker infrastructure

  • scripts/ci-docker.sh — orchestrates Docker run with SSH keys, cargo registry mounts, CI env vars
  • scripts/ci-patch-deps.sh — replicates CI's cross-repo deps.txt patching for feature branch builds

Dependency and config fixes

  • Replace local path dep with git dep for herolib_os
  • Switch Cargo.toml git deps from SSH to HTTPS URLs (per hero_coderoot convention)
  • Add missing Makefile targets (lint, fmt-check, ship-binary, build-package, ci-docker)
  • Replace simplified build_lib.sh with canonical version
  • Add comprehensive test suite (19 unit tests, smoke test framework)
  • Remove hardcoded secrets, add ${VAR:-default} env substitution

Verification

  • 19/19 unit tests pass
  • make ci-local passes → remote CI passes (confirmed on PR #14)
  • make ci-docker passes inside Docker container (fmt-check, clippy, check, test, release build)
## Context PR #14 started as a dependency and port cleanup but grew into a comprehensive build system and CI overhaul. The Makefile had argument bugs that broke CI, test-all.sh duplicated raw cargo commands instead of using Makefile targets, and there was no way to reproduce CI locally with full fidelity. ## Goals ### Build fixes (CI blockers) - Fix `build release` → `build` in Makefile build target (`build()` signature is `features, target, profile` — "release" went into features arg) - Fix `build debug` → `build "$ALL_FEATURES" "" debug` in installdev target (same class of bug) - Fix all clippy warnings (collapsible_if, map_or, unsafe fn bodies, dead_code) - Run cargo fmt on pre-existing formatting issues ### CI pipeline alignment - Align test-all.sh to call `make` targets (fmt-check, lint, check, test, build) instead of raw cargo commands — Makefile is the single source of truth - Simplify CI workflow (build.yaml) to single `make test-all` step - Add `CARGO_NET_GIT_FETCH_WITH_CLI=true` to ci-local.sh to match CI environment ### Three-tier local CI reproduction - **`make test-all`** (~80% fidelity) — quick offline checks, fastest iteration - **`make ci-local`** (~95% fidelity) — moves workspace .cargo/config.toml aside, sets CI env vars, runs `make test-all` - **`make ci-docker`** (~100% fidelity) — runs inside `ghcr.io/despiegk/builder:latest` (same image as CI), Docker isolation eliminates all environment differences ### ci-docker infrastructure - `scripts/ci-docker.sh` — orchestrates Docker run with SSH keys, cargo registry mounts, CI env vars - `scripts/ci-patch-deps.sh` — replicates CI's cross-repo deps.txt patching for feature branch builds ### Dependency and config fixes - Replace local path dep with git dep for herolib_os - Switch Cargo.toml git deps from SSH to HTTPS URLs (per hero_coderoot convention) - Add missing Makefile targets (lint, fmt-check, ship-binary, build-package, ci-docker) - Replace simplified build_lib.sh with canonical version - Add comprehensive test suite (19 unit tests, smoke test framework) - Remove hardcoded secrets, add ${VAR:-default} env substitution ## Verification - 19/19 unit tests pass - `make ci-local` passes → remote CI passes (confirmed on PR #14) - `make ci-docker` passes inside Docker container (fmt-check, clippy, check, test, release build)
mik-tf changed title from Fix build_lib argument bugs and align CI/test-all pipeline to Fix build system, CI pipeline, and add three-tier local CI reproduction 2026-02-18 21:31:06 +00:00
Sign in to join this conversation.
No labels
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_services#16
No description provided.