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
Wave 1 follow-up to PR #135 (binding-tier-1 Chapel pilot). Three
distinct issues surfaced in CI on #135's first run, each of which was
hiding behind the binding's never-having-been-compiled state.
1. CHAPEL TYPECHECK: T? syntax is class-only
============================================
The pre-existing binding used Chapel's `T?` postfix on value-type
returns: `proc safeAdd(a, b): int(64)?`, `bool?`, `string?`.
That syntax is class-only in Chapel 2.x — every Safe*.chpl module
fails to typecheck. All 11 modules were affected; this is the deep
"binding looked well-written but had never been compiled" finding.
Replacement: `Maybe(T)` — a binding-provided generic record with
`present: bool` and `value: T`, with constructors `some(v)` and
`absent(T)`. Naming note: `none` and `nothing` are both Chapel
reserved words, so the absent constructor is `absent`.
All 11 Safe*.chpl wrappers + smoke + 3 tests rewritten.
`Proven.chpl` adds `public import SafePath / SafeHeader / LibProven`
so callers can write `SafePath.hasTraversal(...)` as a qualified
reference.
`enum ProvenStatus : int(32) { ... }` typed-enum syntax was also
removed in Chapel 2.x. Dropped the type spec.
`extractString` / `cStringToChapel` switched to `try!` for
`string.createCopyingBuffer`, which is a throwing function in
Chapel 2.x — the FFI guarantees the buffer shape so the unconditional
unwrap is sound.
2. CI BUILD: 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 actually 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 to 0.15.2 to match.
3. proven.h missing `proven_version` / `proven_build_info`
==========================================================
These two accessors are exported by `ffi/zig/src/main.zig` and
called by the Chapel `libraryVersion()` / `libraryBuildInfo()`
helpers. `chpl` performs extern-decl resolution against included
C headers and fails the build when an `extern` references a symbol
not declared in any `-I`-supplied header.
Added two declarations to `bindings/c/include/proven.h`. These do
NOT introduce new Zig exports — they declare functions that
`main.zig` has always exported.
Verification
============
Locally (chpl 2.8.0 + zig 0.15.2 against a freshly-built libproven.so):
$ just check # symbol-audit PASS 5/0
$ just build # smoke target builds
$ just test # smoke + 4 tests all GREEN
hello_smoke: OK (libproven 0.1.0)
TestFfiContract: OK
TestLibraryInfo: OK (version=0.1.0)
TestSafeHeader: OK
TestSafePath: OK
All 11 src/*.chpl typecheck clean with `chpl --no-codegen`.
Detachability is preserved: every change here is inside the
detachable file set (`bindings/chapel/**`, `bindings/c/include/proven.h`,
the workflow). No new repo-root reach.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments