You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
Follow-up fix for the chapel binding-tier-1 pilot landed in #135 — its
first CI run on the Chapel CI workflow failed for three real reasons,
all of which were hiding behind the binding's never-having-been-compiled
state.
Locally validated end-to-end with `chpl 2.8.0` + `zig 0.15.2` against a
freshly-built libproven.so:
```
chapel-symbol-audit: PASS 5 / FAIL 0
hello_smoke: OK (libproven 0.1.0)
TestFfiContract: OK
TestLibraryInfo: OK (version=0.1.0)
TestSafeHeader: OK
TestSafePath: OK
```
## Three root causes
### 1. `T?` syntax is class-only — every Safe*.chpl module was broken
The pre-existing binding used Chapel's `T?` postfix on value-type
returns (`bool?`, `int(64)?`, `string?`). That syntax is class-only
in Chapel 2.x — every Safe*.chpl module failed to typecheck. This is
the deep finding behind the brief's "well-written code, never linked"
diagnosis: the binding had never been compiled, full stop.
**Fix:** added a `Maybe(T)` generic record to `LibProven.chpl` with
constructors `some(v)` and `absent(T)`. (`absent` rather than
`none`/`nothing` because both of those are Chapel reserved words.)
Rewrote every Safe*.chpl wrapper + smoke + 3 tests to use it.
`Proven.chpl` adds `public import SafePath/SafeHeader/LibProven` so
callers can write `SafePath.hasTraversal(...)` as a qualified
reference (`public use` alone does not bring the module name in
scope as a qualifier).
`enum ProvenStatus : int(32) { ... }` typed-enum syntax was also
removed in Chapel 2.x; dropped the type spec. `extractString` /
`cStringToChapel` switched to `try!` for the now-throwing
`string.createCopyingBuffer`.
### 2. `ffi/zig/build.zig` depends on a missing repo
`hyperpolymath/idris2-zig-ffi` returns 404 to authenticated `gh`.
The same break blocks `zig-ffi.yml` on main; resolving the upstream
dep is out of scope for the Chapel pilot.
All exports in `ffi/zig/src/main.zig` are pure-Zig (only `@import
(\"std\")` + `@import(\"builtin\")`); none consume the
`idris2_zig_ffi` module. Switched `chapel-build` to compile
`main.zig` directly via `zig build-lib -dynamic -lc`, producing a
libproven.so with the WIRED 5 symbols.
`build.zig.zon` declares `minimum_zig_version = \"0.15.2\"`; bumped
the CI's pinned Zig from 0.13.0 → 0.15.2 to match.
### 3. `proven.h` missing `proven_version` / `proven_build_info`
`chpl` performs extern-decl resolution against included C headers
and errors when an `extern \"proven_X\"` references a symbol not
declared in any `-I`-supplied header. `proven_version` and
`proven_build_info` ARE exported by `ffi/zig/src/main.zig` (always
have been) but were absent from `proven.h`.
Added two declarations to `bindings/c/include/proven.h`. These do
NOT introduce new Zig exports — they document functions `main.zig`
has been shipping all along.
## Diff scope
18 files changed: chapel-ci.yml, proven.h, README.adoc, every
`bindings/chapel/src/*.chpl`, smoke + 3 tests. Detachability is
preserved — every change is inside the detachable file set
(`bindings/chapel/**`, `bindings/c/include/proven.h`, the
workflow).
## Test plan
- [ ] CI: `detachability-guard` GREEN
- [ ] CI: `chapel-build` GREEN — Zig 0.15.2 + `zig build-lib -lc` builds
libproven.so containing WIRED 5
- [ ] CI: `chapel-symbol-audit` PASS 5 / FAIL 0
- [ ] CI: `chapel-smoke` exit-0
- [ ] CI: `chapel-tests` — all 4 tests GREEN
- [ ] CI: `chapel-detachable-build` builds + tests from sparse checkout
- [ ] Auto-merge armed
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments