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
{{ message }}
Repository navigation
Commit 6356faf
Browse filesBrowse the repository at this point in the historyBrowse files
fix(build): build-time stdout overwrote itself on a file; non-wasm bootstrap could not compile
Smell-audited: 1: Smallest-diff bias rejected — the wasm gate became ONE predicate, not a second skip
The one-line `if (build_options.wasm) continue` in cache_gen would have been
the smaller fix, but that shape IS the bug (two sites disagreeing about one
gate), so it would have re-armed the same failure for the next gated file.
Two independent defects, both found while measuring the build path.
(1) `cljw build` lost build-time output when stdout was a regular file.
Build-time eval runs the entry's top-level forms (ADR-0034 A1-D2), but
`buildArtifact` left `rt.stdout` null, so each `println` built a fresh
offset-tracking writer that restarted at file offset 0. On a seekable stdout
every form overwrote the previous one:
printf '(println 1)(println 2)(println 3)(println 4)(println 5)\n' > five.clj
cljw build five.clj -o f.bin > f.log # f.log was "5\n", 2 bytes
A pipe hid it (no seek), and the e2e sent build output to /dev/null or captured
it through command substitution, so nothing in the suite ever redirected a
build to a file. Same fix `tryRunEmbedded` already carries (D-096): thread the
CLI's one process-shared writer in and flush it before the ADR-0176 exit
barrier, which may hard-exit and drop a buffered tail. New e2e cases (12)/(13)
pin the file-redirect case on both the build and run sides.
(2) A build without `-Dwasm` could not compile its own bootstrap.
`cache_gen` AOT-compiled every `FILES` entry while `lookupEmbeddedFile` refused
to serve `cljw.wasm` without the flag, so the flagless build died analysing a
file it could never load ("No namespace: 'wasm'" — `cljw.wasm`'s `wasm/…` call
sites resolve at ANALYZE time, so the comment claiming load-time safety in any
build was wrong). The gate is now one predicate, `isActiveFile`, read by both
the resolver and `ACTIVE_FILES`; every walk that compiles, emits, or replays
bundled files iterates `ACTIVE_FILES`, while `FILES` keeps its full shape so
`lookupEmbeddedFile` stays index-keyed. A unit test pins the coupling in either
build config so the next gated file cannot be added to one walk and forgotten
in the other.
Verified: the `-Dwasm` binary is byte-identical in size (7,368,808 B), so the
shipped configuration is untouched; the flagless build now succeeds at
5,035,432 B (-31.7%) with `cljw.wasm` honestly unresolvable.
0 commit comments