Skip to content

Link.w links a .producer-less <compiler_dir>/runtime of any generation (fallback root skips the generation check; the error text in #2490) #2491

Closed

Description

@ehartford

Found cutting the linux-aarch64 seed for #2490 (2026-10-20), in tools/docker/linux-aarch64's with-aarch64 volume.

Symptom. A fresh cross-built compiler (e1d2b25, :cross-arm-compiler on linux-x86_64, embedded runtime current) placed at /work/with/src/main fails :deps with exactly #2490's errors:

ld.lld: error: undefined symbol: with_vec_release_last
ld.lld: error: undefined symbol: with_vec_free_buffer_drop_origin_at
ld.lld: error: undefined symbol: with_net_tcp_connect_timeout
ld.lld: error: undefined symbol: with_net_set_timeout
ld.lld: error: undefined symbol: with_vec_push_es
ld.lld: error: undefined symbol: with_vec_make_unique_bits
ld.lld: error: undefined symbol: with_vec_append_bytes
ld.lld: error: undefined symbol: with_fiber_sleep_until
>>> referenced by string.w:136 (<embedded-std>/std/string.w:136)
>>>               /work/with/out/tmp/deps-download/https_fetch.o:(aes_sbox)

Exact cause (strace -f -e trace=openat,execve, runbook recipe): the volume held a stale /work/with/src/runtime/ (runtime objects dated 2026-08-19, uid 1001, no .producer), and the __ld exec linked them:

execve("/work/with/src/main", ["/work/with/src/main", "__ld", ..., "/work/hf-probe.o",
  "/work/with/src/runtime/channel_runtime.o", ..., "/work/with/src/runtime/rt_core.o",
  "/work/with/src/runtime/rt_linux_aarch64.o", ...])

llvm-nm --defined-only on that rt_core.o: 0 hits for with_vec_push_es.

src/compiler/Link.w:

Repro (any host, native):

mkdir -p /tmp/seedbin && cp out/release/bin/with /tmp/seedbin/with
mkdir /tmp/seedbin/runtime && cp <an older checkout>/out/lib/*.o /tmp/seedbin/runtime/   # no .producer
/tmp/seedbin/with build build/https_fetch.w -o /tmp/hf     # links /tmp/seedbin/runtime/rt_core.o

Expected: the link refuses the directory (its objects are neither this generation's by .producer nor the embedded bytes) and falls back to the embedded runtime, or prints link_stage_runtime_generation_refusal. Actual: undefined with_* symbols from whatever that directory holds.

Fix direction. The fallback root must pass the same test as a candidate: in link_stage_find_runtime_object_path, take root/<name> only when link_stage_runtime_dir_is_this_generation(root); otherwise go straight to the embedded objects. A directory without .producer is not "ours", it is unknown.

Workaround used for the seed cut: rm -rf /work/with/src/runtime (plus git clean -fdX keeping .deps and src/main) in the volume, then the same compiler bootstrapped normally. Note for #2490: the pinned 10-09 seed was run in the same polluted volume, so that failure's link also took src/runtime/; whether the seed's own embedded runtime lacks the symbols too is a separate fact (the 10-11 D115 helpers postdate it, so probably yes), but the error text in #2490 is this bug's.

Activity

  1. ehartford commented on Oct 20, 2026

    @ehartford
    ContributorAuthor

    Fixed in #2495: link_stage_find_runtime_object_path links a root's objects only when the root is this generation's — its .producer names this compiler, or its objects are the ones this compiler embeds — so a producer-less stale directory is never linked; and the runner's root must have this generation as its producer (the bridges are never embedded).

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions