P5.1: post-link build driver runs on the comptime VM (no fallback)
core.invokeByFuncId routes the post-link callback through comptime_vm.tryEval instead of the legacy Interpreter. REQUIRED because the sx build driver allocates/grows Lists, which the legacy interp can't do at comptime (issue 0141: struct_get: base has no fields); the VM can. No fallback (a side-effecting post-link callback can't double-execute): a VM bail is a hard build error (comptime_vm.last_bail_reason, surfaced by printInterpBailDiag). BuildConfig + import_sources threaded in; non-empty args rejected loudly. flushInterpOutput deleted (VM out writes direct via host-FFI). Smoke test examples/1661-platform-post-link-vm-list (AOT): a post-link callback grows a List to 3 + returns len==3, so the build succeeds (exit 0) only via the VM. First corpus coverage of the post-link path. 702/0 both gates.
This commit is contained in:
@@ -497,9 +497,13 @@ The compiler's whole post-IR role: codegen → build the CLI-derived `BuildConfi
|
||||
`on_build(config)` on the VM; a `raise` fails the build. Plain `sx run` fires none of it.
|
||||
|
||||
**Steps (each its own green step; depends on 4E first):**
|
||||
- **P5.1 — 4E prereq:** route the post-codegen / `on_build` invocation through the **VM** (`core.invokeByFuncId`
|
||||
→ VM). REQUIRED because the driver allocates (`List`) and the legacy interp can't (0141 — verified: comptime
|
||||
`List` growth works on the VM, fails on legacy). Add dedicated bundle smoke tests (no corpus coverage today).
|
||||
- **P5.1 — 4E prereq — DONE (2026-06-19).** `core.invokeByFuncId` routes the post-link callback through the
|
||||
**VM** (`comptime_vm.tryEval`), NO fallback (a side-effecting callback can't double-execute): a bail is a hard
|
||||
build error (`comptime_vm.last_bail_reason` surfaced by `main.printInterpBailDiag`). `BuildConfig` +
|
||||
`import_sources` threaded in; `flushInterpOutput` deleted (VM `out` writes direct via host-FFI). Smoke test
|
||||
`examples/1661-platform-post-link-vm-list` (AOT): a post-link callback GROWS a `List` (0141 — works on the VM,
|
||||
bails on legacy with `struct_get`), so the build succeeds (exit 0) only via the VM. Non-empty callback `args`
|
||||
rejected loudly (the `on_build(config)` arg-marshaling entry is P5.3). **702/0 both gates.**
|
||||
- **P5.2 — primitives:** expose `emit_object` + `link` (reuse `target.zig` linker) + metadata queries
|
||||
(`c_object_paths`/`link_libraries`/host-triple) as `abi(.compiler)` fns taking explicit args.
|
||||
- **P5.3 — `on_build` slot:** a comptime-assignable compiler slot (GENERALIZES today's `post_link_callback_fn`:
|
||||
|
||||
Reference in New Issue
Block a user