Repository navigation
Conversation
CI classification — this PR's scope vs pre-existing redsThis PR is one logical change: it makes the Verified locally: Result per lane
The remaining battery failures are pre-existing and outside this PR's diffThis PR changes only
Net: this PR is the correct, scoped kind-26 fix that unblocks the build wall on all |
ce445e7 to
6d3e622
Compare
…ndex sweep) 0173d08 rewrote str.byte_at(i) -> s[i] across build.w, build/*.w, and lib/std/build.w (256 sites). These files are comptime-evaluated by the pinned seed compiler when `with build` materializes the build graph, before any stage compilation runs. Comptime `str` indexing is a compiler feature newer than the pinned seed (v0.15.1.3, and also v0.15.1.7): the seed fails graph materialization with "comptime index requires an array, tuple, or vec", breaking the very first build step on every self-host lane (linux x86_64/aarch64, windows x86_64/aarch64, macOS arm64). Per the bootstrap-ordering invariant, build-driver code reached at comptime must not use a language feature the pinned seed lacks. Revert the sweep for these files only; it can re-land once a released seed supports comptime `str` indexing. The compiler-source commits stacked on top (9dc3c43 HashMap `[k]` diagnostic, b9e0e65 retire Vec.set_i32) are unaffected: they change stage-compiled source, not comptime build-graph code.
…nter sha256_hash_str The pcre2 `.wo` bundle build and the bundle-interface self-host test both hashed in-memory strings with `sha256_hash_str(text, &raw mut digest[0] as *mut u8)`. That `&raw mut` (NK_UNARY, AST kind 26) takes a raw pointer into a mutable stack buffer, which the comptime build-graph evaluator does not model — the seed drives `with build` under the comptime evaluator, so evaluating those action bodies fails with "expression kind 26 is not comptime-evaluable yet", reddening `pcre2-wo-build` (part of `with build`) and `bundle-interface-tests` on every lane. The comptime evaluator serves `ToolFs.sha256_file` natively. So hash through it instead: - build/wo.w: `wo_sha256_text(fs, text)` stages the bytes into the action's own project-relative scratch dir (`fs.scratch_dir()`) and hashes the file — byte-identical to hashing the string. A store slot can live outside the project root, so its callers `host_read_text` the file and hand the bytes here rather than `sha256_file` an out-of-root path (the comptime project-relative guard would reject it). All six call sites thread `fs`. - build/selfhost.w: the interface-sha assertion hashes the emitted `.wi`, which is already a project-relative file, so `ctx.fs().sha256_file(wi_path)` directly. Drops the raw-pointer helper and its `std.crypto.sha256` import. Both are byte-identical to the previous hashes: `sha256_file(p)` equals `sha256(read_text(p))` for a text file, and each `.wo` manifest field is written and validated through the same helper, so they stay self-consistent. Verified on linux-x86_64: `with build :pcre2-wo-build` and `with build :bundle-interface-tests` both green (were the two failing targets).
6d3e622 to
3951069
Compare
|
not reverting str index sweep. |
|
(this PR throws out the baby with the bathwater) |
|
I will rebase this to main after my fix is in |
|
Split and superseded. The useful half — hashing the in-memory .wo action text via ToolFs.sha256_file instead of the raw-pointer sha256_hash_str — landed on main as 888d1f0, and it is what let the v0.15.1.8-seed comptime evaluator build the .wo bundle (part of the v0.15.1.10+ seed chain). The other half (reverting the build-driver |
Problem
withlang-dev/mainis red on the self-host lanes. Two independent build-graphbugs, both hit before any test runs — the pinned-seed lanes (linux x86_64,
windows x86_64/aarch64) die first at graph materialization (~2s in); the
newer-seed lanes (linux aarch64) then fail at the
.wobuild step.Root cause
1. Comptime
strindexing in build-driver files (bootstrap-ordering violation).0173d08e("least-ceremony sweep, build-driver files") rewrotestr.byte_at(i)→s[i]acrossbuild.w,build/*.w, andlib/std/build.w(232 sites). Those files are comptime-evaluated by the pinned seed compiler
when
with buildmaterializes the build graph — before any stagecompilation. Comptime
strindexing is a compiler feature newer than thepinned seed (
v0.15.1.3): it rejectss[i]withcomptime index requires an array, tuple, or vec, so those lanes never reach stage compilation.2. Raw-pointer
sha256at comptime (kind-26). Once the graph materializes,pcre2-wo-build/ the.woaction-hash step fails withexpression kind 26 is not comptime-evaluable yet— the&raw mutraw-pointer path insha256_hash_str.Fix
Two commits, each a single logical change, both keeping the build graph
comptime-legal against the already-tagged pinned seed:
str.byte_at(i)→s[i]sweep for build-driver files only(exact content inverse of
0173d08e; 232 insertions / 232 deletions acrossthe same 19 files). The later
.get(i) → v[i]Vec sweep is untouched —Vec indexing is supported by the pinned seed; only
strindexing is not.ToolFs.sha256_file, not the raw-pointersha256_hash_str— routes the.woaction-hash through a comptime-legalpath.
No compiler/stdlib source is touched — this changes only comptime-evaluated
build-graph code, so it cannot affect stage codegen or fixpoint determinism.
Verification
From the CI-pinned
v0.15.1.3seed on linux x86_64, clean (rm -rf out) build:with build→ green, all targets (pristine main head dies at ~2smaterialization with
comptime index requires an array, tuple, or vec).with build :fixpoint→ stage2 == stage3 byte-identical (27 targets,stage2/stage3 built fresh).
Bootstrappable from the already-tagged
v0.15.1.3seed; no new seed required.Base rung of the stack that greens every self-host lane.