Skip to content

Pinned darwin seed (607a52f5, 09-25) predates #1720: it links the native build runner against a stale out/lib, the runner fails, and the driver's silent comptime fallback then fails the build (no stage1 ever ran) #1797

Closed

Description

@ehartford

Root cause (2026-09-27, deep dive; supersedes the first write-up, which was wrong — the build in question exited rc=1 and nothing mixed generations).

Chain

  1. seed.lock pins the darwin seed 7456c37b… = nightly-20260925-local-1-607a52f543e7, cut from 607a52f (2026-09-25 12:56) — before Link: an out/lib under the cwd is linked only when it is this compiler's runtime byte for byte (D30, #761 class) #1720 (2911b1d, 2026-09-26 12:23), the D30 rule that an on-disk out/lib/out/bootstrap-lib is linked only when its rt_core.o is byte-identical to the compiler's embedded one. The seed binary has no link_stage_runtime_dir_is_this_generation symbol; the fresh stage2/release do.
  2. In a checkout whose out/lib/out/bootstrap-lib hold runtime objects from an older tree (in /Users/eric/with: 2026-09-22, rt_core.o 389,840 bytes, without with_vec_free_buffer_drop_origin, added 09-25 by c5aaf76), src/main build first compiles the native build runner (build_runner_ensure, src/main.w:1568) with the seed. The seed's codegen references that symbol; the seed's Link.w takes the first complete on-disk runtime dir unchecked → Undefined symbols … _with_vec_free_buffer_drop_origin.
  3. The driver prints warning: build runner compile failed; actions fall back to comptime evaluation and continues (a silent fallback, CLAUDE.md "No Silent Fallbacks"). The seed's evaluator then fails on embedded-clang-resource-source (generic comptime function expects 1 type argument(s), found 0); stage1 and everything after are survey: skipping; rc=1 at 173.9 s.
  4. A second src/main build passes (my "build 3") only because the failed run had already rebuilt out/bootstrap-lib (the bootstrap-* object targets ran before the failure), so the runner then linked against fresh bootstrap objects. Deleting stage1/seed-input.json was a coincidence, not the fix. out/release/bin/with from 09-22 stayed in place meanwhile and was what reproduced Optional chain resets its receiver: a second o?.field on the same Option reads Some(<empty>) (struct and tuple payloads) #1710.

Reproduction (scratch worktree, done)

git checkout a4a0d7d7 + its seed (nightly-20260922, 7c3ed983…) + src/main build → then git checkout 5b6830b1 + pinned seed 7456…:

  • src/main build → rc=1 at 174.2 s, same log as above.
  • src/main build :abi-hash-check --no-deps with out/.build-state/build-runner{,.key} and the target state removed: fails with either out/lib or out/bootstrap-lib present (stale), passes with both removed ([build] runner compiled 18.5s, embedded runtime).
  • src/main run vec.w (a Vec program) in the same checkout: undefined symbol; the fresh out/stage/bin/with-stage2 and out/release/bin/with print 1 ab there (Link: an out/lib under the cwd is linked only when it is this compiler's runtime byte for byte (D30, #761 class) #1720 works in them).
  • --explain stage1 after the seed swap: stale: action signature changed (target, producer, action-code, compiler-source) — the build cache is not at fault.

Fixes

  • Seed bump: pin a darwin seed cut after 2911b1d. nightly-20260926-local-1-2e8defaa18ef has no darwin asset (its darwin leg did not publish) — cut one.
  • Driver (build_runner_ensure): compile the runner with WITH_OUT_DIR pointed at an empty per-build directory so every seed, old or new, links it from its embedded runtime (verified: with no on-disk runtime dirs the old seed links it fine). Takes effect in the next seed.
  • No silent fallback: when the runner compile fails, say what failed (the linker's first undefined symbol) and that the on-disk out/lib/out/bootstrap-lib are from another compiler generation; when the comptime fallback then cannot evaluate an action, name that as the consequence.
  • Now, in tree code the current seed runs (tools/battery.w / :gate preflight): record the seed digest in out/.build-state; on a change, remove out/lib, out/bootstrap-lib and out/tmp/with_runtime before the build.

Activity

  1. added
    bug
    tooling
    on Sep 27, 2026
  2. changed the title [-]Build cache: a stage1 built by a previous seed was reused after the seed changed; the mixed-generation release binary reproduced #1710 while the properly seeded build did not[/-] [+]Pinned darwin seed (607a52f5, 09-25) predates #1720: it links the native build runner against a stale out/lib, the runner fails, and the driver's silent comptime fallback then fails the build (no stage1 ever ran)[/+] on Sep 27, 2026
  3. ehartford commented on Sep 27, 2026

    @ehartford
    ContributorAuthor

    Driver/battery half landed on main in #1795 (squash 9993935): the runner is compiled only once no on-disk runtime directory is another generation's (or the bootstrap root was prepared in this run) and linked with WITH_OUT_DIR naming the build's root; embedded-clang-resource-source ordered after the prepared root; the fallback is a loud error; tools/battery.w removes out/lib, out/bootstrap-lib and out/tmp/with_runtime when the driving seed changed. Remaining: cut and pin a darwin seed after #1720 (in progress; this issue closes with that seed.lock bump).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugtooling

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions