fix(tests): migrate test suite to zig 0.16 APIs #1

Merged
markus merged 1 commit from unstable into main 2026-02-24 11:21:52 +01:00
Owner

Summary

  • Eliminate all compile errors (9 categories) across 153 test files caused by Zig 0.16 API removals
  • Remove std.debug.print calls that corrupt --listen=- IPC pipe
  • Replace removed APIs: realpathAlloc, process.Child.run, ArrayList.writer(), Thread.sleep, Dir.makeDir, Dir.writeFile
  • Add sleep() to compat_time via linux.nanosleep
  • Add ArrayListWriter shim to json_helpers.zig for janusd
  • Wire missing modules (compat_time, compat_fs, zig_parser, semantic) in build.zig
  • Add link_libc = true to test targets requiring libc

Results

Metric Before After
Compile errors ~40 targets 0
Build steps 194/236 207/236
Tests passing 885/1007 944/1097
Files changed 153 (+679/-2889)

28 remaining failures are all runtime (LLC pipeline, pre-existing nursery/async bugs). No Zig 0.16 migration issues remain.

Test plan

  • zig build compiles clean
  • zig build test — zero compilation errors
  • 207/236 build steps pass
  • 944/1097 individual tests pass
## Summary - Eliminate all compile errors (9 categories) across 153 test files caused by Zig 0.16 API removals - Remove `std.debug.print` calls that corrupt `--listen=-` IPC pipe - Replace removed APIs: `realpathAlloc`, `process.Child.run`, `ArrayList.writer()`, `Thread.sleep`, `Dir.makeDir`, `Dir.writeFile` - Add `sleep()` to `compat_time` via `linux.nanosleep` - Add `ArrayListWriter` shim to `json_helpers.zig` for janusd - Wire missing modules (`compat_time`, `compat_fs`, `zig_parser`, `semantic`) in build.zig - Add `link_libc = true` to test targets requiring libc ## Results | Metric | Before | After | |--------|--------|-------| | Compile errors | ~40 targets | **0** | | Build steps | 194/236 | **207/236** | | Tests passing | 885/1007 | **944/1097** | | Files changed | — | 153 (+679/-2889) | 28 remaining failures are all runtime (LLC pipeline, pre-existing nursery/async bugs). No Zig 0.16 migration issues remain. ## Test plan - [x] `zig build` compiles clean - [x] `zig build test` — zero compilation errors - [x] 207/236 build steps pass - [x] 944/1097 individual tests pass
fix(tests): migrate test suite to zig 0.16 APIs
Some checks failed
🧪 Janus CI Pipeline / 🧪 Test Suite (release-safe) (pull_request) Has been skipped
AI-Airlock Gatekeeper / Detect AI Authorship (pull_request) Successful in 4s
gRPC Smoke / smoke-musl (pull_request) Failing after 1s
License Header Check / Check License Headers (pull_request) Failing after 0s
License Header Check / License Audit (pull_request) Has been skipped
Strategic Release Pipeline / 🧪 Sandbox - Experimental Innovation (pull_request) Has been skipped
Strategic Release Pipeline / 🔥 Forge - Alpha Integration (pull_request) Has been skipped
Strategic Release Pipeline / 🛡️ Crucible - Beta Quality Assurance (pull_request) Has been skipped
Strategic Release Pipeline / 🛡️ Crucible - Beta Quality Assurance-1 (pull_request) Has been skipped
Strategic Release Pipeline / 🛡️ Crucible - Beta Quality Assurance-2 (pull_request) Has been skipped
Strategic Release Pipeline / 🏰 Fortress - Production Release (pull_request) Has been skipped
Strategic Release Pipeline / 🏰 Fortress - Production Release-1 (pull_request) Has been skipped
Strategic Release Pipeline / 🏰 Fortress - Production Release-2 (pull_request) Has been skipped
Strategic Release Pipeline / 🏰 Fortress - Production Release-3 (pull_request) Has been skipped
Strategic Release Pipeline / 🗿 Bedrock - Enterprise LTS (pull_request) Has been skipped
🧪 Janus CI Pipeline / 📦 Package Test (alpine) (pull_request) Has been skipped
🧪 Janus CI Pipeline / 📦 Package Test (arch) (pull_request) Has been skipped
🧪 Janus CI Pipeline / 📦 Package Test (debian) (pull_request) Has been skipped
🧪 Janus CI Pipeline / 📦 Package Test (fedora) (pull_request) Has been skipped
🧪 Janus CI Pipeline / 🔒 Security Analysis (pull_request) Has been skipped
🧪 Janus CI Pipeline / ⚡ Performance Test (pull_request) Has been skipped
🧪 Janus CI Pipeline / 🔗 Integration Test (pull_request) Has been skipped
AI-Airlock Gatekeeper / Validate Proof Package (pull_request) Has been skipped
AI-Airlock Gatekeeper / Block AI Self-Merge (pull_request) Has been skipped
Strategic Release Pipeline / 🚀 Release Orchestration (pull_request) Has been skipped
🧪 Janus CI Pipeline / 📊 CI Status Report (pull_request) Failing after 0s
AI-Airlock Gatekeeper / Gatekeeper Summary (pull_request) Successful in 0s
gRPC Smoke / smoke (pull_request) Has been cancelled
Forbidden Paths Guard / guard (pull_request) Has been cancelled
Validation / test (pull_request) Has been cancelled
6540999df3
- Remove std.debug.print calls that corrupt --listen=- IPC pipe
- Replace realpathAlloc with realPathFileAlloc across e2e tests
- Replace std.process.Child.run with std.process.run (io param)
- Replace .Exited with .exited (lowercase tagged union fields)
- Replace Dir.writeFile(.{}) with writeFile(io, .{})
- Replace Dir.makeDir with createDir(io, path, .default_dir)
- Add sleep() to compat_time via linux.nanosleep
- Replace ArrayList.writer() with ArrayListWriter shim (janusd)
- Replace ArrayList.writer() with appendFmt in emitters
- Wire missing modules (compat_time, compat_fs, zig_parser, semantic)
- Add link_libc to test targets requiring libc (janusd, scheduler)
- Fix emit() signatures and graph ownership in QTJIR test helpers
- Remove unused captures in for loops (zig 0.16 strict mode)

All 153 files compile clean. Zero compilation errors remain.
207/236 build steps pass; remaining 28 are runtime failures
(LLC pipeline, pre-existing nursery/async bugs).
markus requested review from Owners 2026-02-24 11:19:41 +01:00
markus merged commit 32d14c48f1 into main 2026-02-24 11:21:52 +01:00
Sign in to join this conversation.
No reviewers
janus/Owners
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
janus/janus-lang!1
No description provided.