Commit 13208cd
iseriser: auto-install pinned Zig toolchain in setup + devcontainer (#70)
* iseriser: codegen emits verified, compiling Idris2 ABI (P2)
The scaffold generator still emitted the old flat, never-compiled ABI
template: files at `src/interface/abi/{Types,Layout,Foreign}.idr` with a
namespace they didn't match, a `Layout.idr` whose `modNatNZ ... == 0`
proof does not reduce at the type level, no `Proofs.idr`, and no `.ipkg`.
Every newly-generated -iser therefore started with a broken ABI — exactly
the bug a prior session hand-fixed across the family.
Rewrite the Idris2 ABI generators to emit the verified reference pattern,
proven to compile clean under Idris2 0.7.0 (zero warnings, no
believe_me/postulate/holes):
- Nested modules at `src/interface/abi/<Mod>/ABI/{Types,Layout,Foreign,
Proofs}.idr` so each file's path matches its namespace, plus
`src/interface/abi/<iser>-abi.ipkg` (sourcedir=".", lists all four).
- Types: `Result` with a complete `DecEq` (explicit off-diagonals, not
`No absurd`), a non-null `Handle` built via `choose`, and a primitive
enum with a tag-based `Eq` that is warning-free for any arity.
- Layout: real `Divides`/`StructLayout`/`FieldsAligned` machinery and one
concrete, provably C-ABI-compliant context layout.
- Proofs: a non-vacuous `CABICompliant` theorem (each offset pinned by
`DivideBy k Refl`, qualified layout name so it doesn't auto-bind), the
result-code round-trip, and a Nat-level negative control. Verified:
perturbing a field offset makes the proof fail to typecheck.
Tests: assert the generated tree is self-consistent (every ipkg module
present at its namespace path, no leftover template tokens, old flat path
gone) and add an end-to-end test that runs `idris2 --build` on the
generated ABI when the toolchain is present (no-op otherwise, so CI
without idris2 stays green). Update the integration tests for the new
paths and the real proof module.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xMKB3T4Vo5FYC7Czx3JSH
* iseriser: auto-install pinned Zig toolchain in setup + devcontainer
The Zig FFI bridge is half of the ABI-FFI standard, but nothing installed
Zig: `.tool-versions` only lists it (commented), `setup.sh` stops at
`just`, and the devcontainer's `postCreateCommand: just deps` referenced a
`deps` recipe that did not exist. Unlike the other toolchain pieces, Zig is
not distributed via GitHub releases, so it must come from ziglang.org.
Add `scripts/install-zig.sh`: an idempotent, fail-soft installer for the
pinned Zig 0.14.0 (arch/OS-aware, uses the system CA store the agent proxy
populates, never --insecure). If ziglang.org is not on the session's egress
allowlist the download 403s and the script exits 0 with an actionable
message, so it never blocks setup or a session.
Wire it in via the two paths the project already uses:
- `setup.sh` gains a "Step 1b: Install Zig toolchain" that runs it.
- a new `deps` Justfile recipe (installs Zig, warms Cargo) backs the
devcontainer `postCreateCommand: just deps`, which previously errored.
Once ziglang.org is allowlisted, future setups and dev containers install
Zig automatically with no further change.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xMKB3T4Vo5FYC7Czx3JSH
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 1b23126 commit 13208cd
3 files changed
Lines changed: 75 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
198 | 208 | | |
199 | 209 | | |
200 | 210 | | |
| |||
0 commit comments