P1: export missing ABI function + add ABI↔FFI gate#37
Merged
Conversation
The Idris2 ABI declared a C function (in Types.idr's Foreign namespace) with no matching Zig export, so the bridge would not link. Add the export, then add scripts/abi-ffi-gate.py + .github/workflows/abi-ffi-gate.yml to enforce ABI↔FFI conformance going forward (ABI is the source of truth). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019xMKB3T4Vo5FYC7Czx3JSH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
The new ABI↔FFI gate caught a real drift: the Idris2 ABI declares
dafniser_compile(%foreign "C:dafniser_compile"inTypes.idr's Foreign namespace,Bits64 -> Bits32) but the Zig FFI never exported it — so the bridge would not link.Change
export fn dafniser_compile(handle) Resultmatching the ABI signature (compile + verify the loaded spec; verification backend is stubbed as elsewhere).scripts/abi-ffi-gate.py(fails on a declared C symbol with no export, a mismatched result-code map, or an unrendered template token) +.github/workflows/abi-ffi-gate.yml(runs it, plus a Zig 0.14.0 build/test). The Idris2 ABI is the source of truth.Verification
zig test src/interface/ffi/src/main.zig -lc→ pass ·idris2 --build dafniser-abi.ipkg→ clean ·python3 scripts/abi-ffi-gate.py→ OK (17 functions, 5 result codes match).CI note
rust-ci / Hypatia / governance reds are pre-existing estate-infra unrelated to this change.
🤖 Generated with Claude Code
https://claude.ai/code/session_019xMKB3T4Vo5FYC7Czx3JSH
Generated by Claude Code