Skip to content

fix(build): link libc to fix CI failures on Linux + cross-compile#7

Merged
chaploud merged 1 commit into
mainfrom
develop/hotfix-link-libc
Apr 26, 2026
Merged

fix(build): link libc to fix CI failures on Linux + cross-compile#7
chaploud merged 1 commit into
mainfrom
develop/hotfix-link-libc

Conversation

@chaploud
Copy link
Copy Markdown
Contributor

Summary

  • Zig 0.16.0 migration switched runtime helpers to call std.c.{getcwd,getenv,realpath,write,mprotect} directly (the equivalent std.posix.* surface was removed), but build.zig was never updated to link libc.
  • macOS native auto-links libc, which masked the regression locally. On Linux native (zig build test) and all 4 cross-compile targets (*-macos-none, *-linux-gnu), the build fails with dependency on libc must be explicitly specified — observed on every CI run from PR Migrate to Zig 0.16.0 + zwasm v1.11.0 #5 onward, including the release: v0.5.0 push.
  • This patch sets link_libc = true on the test module, the cache_gen module, and the cljw exe module. F146 still tracks the eventual removal once pure-Zig equivalents land.

Test plan

  • zig build test (macOS native) passes
  • zig build -Doptimize=ReleaseSafe (macOS native) passes; smoke test (+ 1 2 3) returns 6
  • zig build -Dtarget=x86_64-linux-gnu -Doptimize=ReleaseSafe passes (locally)
  • zig build -Dtarget=aarch64-linux-gnu -Doptimize=ReleaseSafe passes (locally)
  • zig build -Dtarget=x86_64-macos-none -Doptimize=ReleaseSafe passes (locally)
  • zig build -Dtarget=aarch64-macos-none -Doptimize=ReleaseSafe passes (locally)
  • CI (test-macos, test-linux, cross-compile (×4)) all green

The Zig 0.16.0 migration switched several runtime helpers
(runtime/lifecycle, lang/builtins/system, lang/interop/classes/file,
engine/vm/jit, runtime/io_default) to call std.c.{getcwd, getenv,
realpath, write, mprotect} directly because the corresponding
std.posix.* surface was removed. build.zig was never updated to
link libc explicitly, so the references resolved only on macOS
native targets where libc is auto-linked. Linux native builds and
all *-macos-none / *-linux-gnu cross-compile targets failed with
"dependency on libc must be explicitly specified" (cache_gen
ReleaseSafe + zig build test on Linux + every cross-compile job).

Set link_libc = true on the test module, the cache_gen module, and
the cljw exe module to match the post-migration source-level
dependency. F146 still tracks the eventual removal once std.c
usages get pure-Zig equivalents.
@chaploud chaploud merged commit 184c873 into main Apr 26, 2026
6 checks passed
@chaploud chaploud deleted the develop/hotfix-link-libc branch April 26, 2026 18:13
chaploud added a commit that referenced this pull request May 27, 2026
…ADR-0027 number collision resolved (renumbered to ADR-0044)

Smell-audited: 2: depth-2 ADR-number-collision repair. Bench-schema ADR (commit 8678052, 2026-05-27 row 8.2) was minted as ADR-0027 but slot 0027 was already held by the NaN-box second-generation ADR (2026-05-24 row 5.2.b). Audit_scaffolding flagged this as the only block-severity finding at the Phase 8 → 9 boundary. ADR numbers are time-ordered max+1 at issue per CLAUDE.md § Project spirit — bench schema renumbered to next free slot ADR-0044.

Changes:
- `.dev/decisions/0027_bench_history_schema.md` → `0044_bench_history_schema.md`. Title flipped to "0044 — …" with an "ADR-number history note" preamble preserving the original 0027 mention so commit-message archaeology (`8678052`) stays interpretable.
- Caller updates (5 sites):
  * `.dev/ROADMAP.md` §9.10 Entry ADRs + Deliverables + row 8.2 description + status cell.
  * `.dev/handover.md` Guardrail refresh history landmark.
  * `bench/history.yaml` header comment + first lock entry's reason field.
  * `.dev/decisions/0021_test_taxonomy.md` Bench-full row + Related list.
  * `test/e2e/phase8_compare_cli.sh` ADR co-citation in the header comment.

Other audit findings deferred to Phase 9 opportunistic cycles (per Phase 9 entry owner discretion; not block-severity):
- ROADMAP §11.6 "Planned" gates #6/#7 already landed (rows 8.3/8.4) → move to Active.
- `.dev/structure_plan.md` src/app/ entries still flagged "Phase 8" for repl/self_host_loader.
- 12 debt rows with stale "Phase 7 entry" / "Phase 7+ target" — Step 0.5 sweep at Phase 9 entry handles these.
- D-007 (self-host viability) still scheduled "Phase 8 target" but Phase 8 closed without touching it — reschedule at Phase 9 entry.
- 8 stale "Phase 8+" references in ROADMAP / ADRs / source comments (cosmetic; opportunistic).

Simplify report (~2 recommendations) + security review report (0 critical, 4 medium hardening candidates) absorbed as future debt candidates; tracked inline in the boundary review subagent outputs (not committed — per `.claude/skills/audit_scaffolding/SKILL.md` the boundary chain produces reports, not commits).

Test gate: Mac 65/65 green (audit absorption is doc-only + filename rename, no source change).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant