Skip to content

Zig FFI: 0.15.2 migration debt — 11 compile errors in ffi/zig/src/ #35

Description

@hyperpolymath

Surfaced by #31's smoke gate + lmdb fix. Pre-existing main breakage (all 3 most recent main runs failed at Zig FFI Build & Test).

After the lmdb-dev + Zig 0.15 quick-fixes in #31 (financial_extract / gpu_ocr / hw_crypto.zig:117 inline-asm), the compile reaches deeper into ffi/zig/src/ and surfaces 11 more 0.15.2 incompatibilities:

Category A — visibility (1 site)

  • src/docudactyl_ffi.zig:371gpu_ocr.ddac_gpu_ocr_submit not marked pub. Fix: add pub to declaration in src/gpu_ocr.zig.

Category B — *const DynLib cast-discards-const (4 sites)

  • src/gpu_ocr.zig:169, 184, 199lib.lookup(...) requires *DynLib, gets *const DynLib.
  • src/ml_inference.zig:117lib.close() same problem.
  • Fix: refactor receivers to take mutable *DynLib OR @constCast at call sites. The std.DynLib API moved to mutable-receiver in Zig 0.15.

Category C — std.Target API change (1 site)

  • src/hw_crypto.zig:65std.Target.x86.featureSet(target.cpu.features)featureSet signature changed to expect []const Feature not Feature.Set.
  • Fix: pass features differently or use the new Target.Cpu.Feature.Set API.

Category D — net stream API change (1 site)

  • src/dragonfly.zig:46stream.handle.setReadTimeout(...)stream.handle is now i32 (raw FD), not a struct with methods.
  • Fix: use std.posix.setsockopt(stream.handle, std.posix.SOL.SOCKET, std.posix.SO.RCVTIMEO, ...) or equivalent.

Category E — additional unused/var-const strictness (likely several more)

Once A-D are fixed, expect a second wave of unused capture / var-never-mutated / expected pub errors per the Zig 0.15 strictness regime.

Why this isn't in #31

#31 (Wave-3 Chapel rehab) ships the docudactyl-side fixes (chpl 2.8.0 + smoke + CI). The FFI is a separate subsystem; this migration debt has been latent on main since the Zig 0.15 toolchain bump (~2026-05-26 per snifs#30 / [[reference_zig_015_breaking_changes]]). Fixing it properly needs:

  1. Domain knowledge of GPU OCR + ml inference + dragonfly socket code paths
  2. Possibly toolchain matrix in CI (0.14 + 0.15 transition)
  3. A separate review pass (not bundled with Chapel work)

Recommended: stand up a focused PR(s) per category, with build-ffi gated locally on each pass.

Owner action — confirm whether this should:

  • (a) be tackled before the next docudactyl release
  • (b) be delegated to a Zig-focused contributor or sub-agent fanout
  • (c) inform a broader estate-wide Zig 0.14 → 0.15 migration tracker (the same shape may apply to echidna / other repos with Zig FFI)

Activity

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 surfacestech-debtKnown shortcut, drift, or hygiene owed - includes cleanup

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions