Skip to content

build: a cold worktree bootstraps again — cached graph only with a runner (#2493); runner root needs the producer's generation, fallback root checked (#2491) - #2495

Merged
ehartford merged 2 commits into
mainfrom
runner-link-root
Oct 20, 2026
Merged

ehartford merged 2 commits into
mainfrom
runner-link-root

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Two driver/link defects found cutting the D30 step-2 seeds; both stop-the-line class.

#2493 — every seed cut from e1d2b25 fails a fresh clone. On a build-graph.cache hit the driver restores the graph with a placeholder Sema (by design the runner evaluates actions), but a cold worktree cannot link the runner before its bootstrap root exists, so the driver evaluates the actions itself and ActionCtx & co. do not exist in the placeholder: "capability type is not visible to comptime evaluator" for every object action, then a false dependency cycle. CI's :deps then build is exactly that sequence. Fix: the cache is admitted only when the runner exists (build_runner_built); the refusal names the type and module. Fixture behav_2493_cached_graph_without_runner.w (red on main, green here). Verified end to end: fresh clones with WITH_BUILD_CACHE_DIR=none WITH_BUILD_RUNNER_DIR=/nonexistent, :deps → build, bootstrap to green with the fixed compiler on darwin (361 s) and linux-x86_64 (eric-5090); the published nightly-20261020-local-1 seeds fail the same sequence on both.

#2491 and the reseed gate. build_runner_link_root accepted a seed's out/bootstrap-lib for a stage2 whose embedded runtime matched it byte for byte, but the bridges (nothing embeds them) were the seed's generation, so the runner link refused them — :install-user's reseed gate went red on main at the first seed of the same rt/ generation. A root the runner links must have this generation as its producer; the refusal says why when a root passes the byte test but not the bridge test. And link_stage_find_runtime_object_path linked a producer-less fallback root's objects (a stale 2026-08 src/runtime/ in the linux-aarch64 volume, #2491): only a root this generation produced, or whose objects are the ones this compiler embeds, is linked.

Evidence (~/.local/with-staging/runner-root at 84e3f81, driven by the pinned seed): :gate green, the fixture green on the release, the release compiler links its own runner, with run tools/battery.w GREEN (343 s).

After this merges: reseed, re-cut all seeds from the fixed main (nightly-20261020-local-2), bump seed.lock.

Eric Hartford added 2 commits October 20, 2026 10:41
…2493)

A cached build graph (out/.build-state/build-graph.cache) carries no Sema:
by design the parent never evaluates an action from it, the runner does.
A cold worktree cannot link the runner before its bootstrap root exists,
so the driver evaluates every action itself — against the placeholder,
where std.build's capability types do not exist: "capability type is not
visible to comptime evaluator" for every object action, a dependency
cycle, 0.2 s. CI's order is exactly that: `:deps` writes the cache, `build`
hits it. Every seed cut from e1d2b25 failed a fresh clone this way, on
darwin and linux-x86_64 alike; deleting the cache (or build.w.effects,
which keys it) let the same seed bootstrap.

The cache is admitted only when build_runner_built says the runner
exists, so an action never meets the placeholder; a cold worktree pays
one live evaluation of build.w. The refusal names the type and the
module (a tool that said only "capability type" left the hunt without
its first fact).

test/behavior/behav_2493_cached_graph_without_runner.w: a project whose
action names a wl_* extern in an unreached arm, so its runner needs a
bridge the project lacks; the second build (cache on disk, no runner) is
refused on the previous commit and passes here.
… root's objects are checked too (#2491)

build_runner_link_root accepted out/bootstrap-lib for a stage2 whose
embedded runtime matched the seed's objects byte for byte
(link_stage_runtime_dir_matches_embedded) — true once seed and stage2
compile the same rt/ identically — but the bridges nothing embeds were the
seed's generation, so the runner's link refused them ("missing LLVM
static bridge") and every action fell back to comptime evaluation: the
reseed gate went red on main at the first seed of the same rt/
generation. A root the runner links must have this generation as its
producer (link_stage_runtime_root_links_bridge); when a root passes the
byte test but not the bridge test, the refusal says so.

link_stage_find_runtime_object_path linked the fallback root's objects
whenever the root was not provably foreign — a stale, producer-less
<compiler_dir>/runtime of 2026-08 was linked by a current compiler and
every current runtime symbol came up undefined (#2491, the linux-aarch64
seed cut). Only a root this generation produced, or whose objects are the
ones this compiler embeds, is linked; link_stage_runtime_root_is_foreign
goes with its last caller.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant