Skip to content

Migrate ffi/zig to the Zig 0.16 std (3 of 4 test roots do not compile) #812

Closed

Description

@hyperpolymath

What

The ffi/zig/ tree does not compile against the Zig 0.16 std. Measured
2026-09-22 with Zig 0.16.0 (developer/tools/opt/mise/installs/zig/0.16.0):
three of build.zig's four test roots are red.

Root State
src/main.zig RED
src/json_writer.zig green
src/file_ops.zig RED
test/integration_test.zig RED

This is pre-existing and unrelated to #120. It is only visible now because
nothing has ever run zig build in CI — see #120 / PR #811, which added the
first Zig workflow and had to restrict it to the maximal green subset
(zig test ffi/zig/src/unified-api-adapter.zig) rather than zig build test.

The exact call sites — 16 across six removed or relocated symbols

Symbol Occurrences
std.fs.cwd 5
std.posix.getenv 3
std.fs.deleteFileAbsolute 3
std.fs.openFileAbsolute 2
std.fs.createFileAbsolute 2
std.time.timestamp 1

Plus a separate language-level defect: opaque types cannot have fields,
at ffi/zig/src/main.zig:46.

Acceptance criteria

  • zig build test exits 0 against Zig 0.16.0 with all four roots
    enabled, and prints a test count greater than 7 (7 is what PR feat(abi): generate the Zig and Rust wire enums from the normative Idris2 ABI (#120) #811
    leaves it at, after adding unified-api-adapter.zig as a fourth root).
  • .github/workflows/zig.yml is changed from zig test <one file> to
    zig build test, and its header comment recording the red subset is
    removed rather than left asserting something no longer true.
  • A mutant proves the job still has teeth: break one assertion in
    unified-api-adapter.zig, confirm the job goes red on an assertion
    failure (not a compile error), revert, confirm green.
  • The job reports jobs > 0 on a real PR, verified via
    /commits/<sha>/check-runs — not gh run list, which cannot see
    app-posted check-runs.
  • No symbol is "fixed" by deleting the call. Each of the 16 sites is
    migrated to its 0.16 equivalent, and the diff says which.

Why it matters

Until this lands, the Zig comptime 16-connector assertion runs only via the
single-file zig test invocation PR #811 added. The rest of the FFI
implementation is uncompiled in CI.

Activity

  1. added
    bindingsABI, FFI, WASM, and cross-language interop surfaces
    testingTests, benchmarks, fuzzing, property checks, coverage
    on Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bindingsABI, FFI, WASM, and cross-language interop surfacestestingTests, benchmarks, fuzzing, property checks, coverage

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions