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
Bootstrap stage1 resolves bare write to the libc extern (fd, buf, n), release binary to std.builtins.write — enum_discriminant_flags red on stage1 only #1320
Found while running the enum test set on a fresh :dev stage1 for #1313/#1310 (base cffb1cb).
test/behavior/enum_discriminant_flags.w has use std.builtins.write and calls write(int_to_string(Flags.X)). Under the installed release compiler (with v0.15.2.1-g478b26481) it passes (012124). Under a bootstrap stage1 — both ~/with/out/bootstrap/bin/with-stage1 built from main at cffb1cb and a fresh one in a worktree at the same base — the check fails:
error: function 'write' expects 3 argument(s), found 1
--> test/behavior/enum_discriminant_flags.w:17:5
error: wrong argument type in call to 'write'
= note: parameter 'fd' expects i32
i.e. the explicit use std.builtins.write loses to the libc write(fd, buf, n) extern on stage1, while the release binary resolves the explicit import. Same class as the known stage1-only reds (spec_ss16, -e, hash_engines): the two binaries embed/resolve the std surface differently, and a D29-global extern outranks an explicit symbol import (#1153 noted builtins need explicit precedence). An explicit use std.builtins.write must win everywhere, and stage1 and the release binary must agree.
Repro: with build :dev && out/bootstrap/bin/with-stage1 test test/behavior/enum_discriminant_flags.w.
Activity
ehartford commentedon Oct 2, 2026
Fixed on main 1688728. Seed-built bootstrap stage1 (
with build :dev,with v0.15.3.0-g168872857):darwin-aarch64:
linux-x86_64 (eric-5090, fresh clone
~/with-ladder/verify, pinned seed,dev rc=0): same output, rc=0.The explicit
use std.builtins.writewins over the libc extern on stage1.