Skip to content

Windows bootstrap: the seed cannot link the native build runner ("missing Windows LLVM linker metadata"), so every action falls back to the comptime evaluator and build/wo.w fails (kind 26) #1075

Closed

Description

@ehartford

Release run 33899384891 (tag v0.15.1.9, seed v0.15.1.8), jobs "Verify and package windows-x86_64" and "windows-aarch64", step "Build seed to release compiler":

error: missing Windows LLVM linker metadata
warning: build runner compile failed; actions fall back to comptime evaluation
error: action target 'pcre2-wo-build' failed during comptime evaluation: expression kind 26 is not comptime-evaluable yet

link_stage_link_with_extras_libs_args_plan (src/compiler/Link.w:783-790) routes every Windows link through the LLVM linker plan and reads the linker path from <runtime root>/llvm_ld. When the seed compiles the native build runner (#921) that file does not exist yet: it is produced by the bootstrap-llvm-link-metadata target, which runs after the runner. The runner has therefore never linked on Windows; it did not matter while every action was comptime-evaluable, and C3's build/wo.w action (#1046) ended that.

Fix: the runner link (and any link before the metadata target) must resolve the linker without the metadata file — the workflows already export LLVM_PREFIX and the shim; build/compiler.w already forwards WITH_LLVM_LD/LLVM_LD to child compilers, so Link.w should honor WITH_LLVM_LD (then LLVM_PREFIX/bin/lld-link.exe) when llvm_ld is absent, and the seed's own embedded metadata should be the default. Separately, #1046 (the evaluator cannot take &raw mut digest[0]) means the fallback path is not a fallback for this action at all; the fallback should refuse loudly with the runner's link error, not run and fail on an unrelated message.

Activity

  1. ehartford commented on Sep 5, 2026

    @ehartford
    ContributorAuthor

    Precise finding (v0.15.1.12 run 33934126586, with #1035 echoing the .wo action stderr): on both Windows lanes pcre2-wo-build fails with error: missing Windows LLVM linker metadata, then install target 'pcre2-wo-install-o' missing source: .../out/wo/pcre2.o.

    So the blocker is not only the build-runner compile (f5af0c9 addresses that). The pcre2-wo-build ACTION itself links the pcre2 corpus into pcre2.o, and on Windows every link routes through Link.w's LLVM plan (link_stage_link_with_extras_libs_args_plan, runtime_sysinfo_os() == "Windows"), which reads <runtime root>/llvm_ld + llvm_ld.rsp. Under the comptime evaluator (the runner never links on Windows) that metadata is produced by the bootstrap-llvm-link-metadata target, which the seed's build has not run when this action links. #1029's stdio-globals fix and the runner retry both land in v0.15.1.11/.12, but the action still cannot link.

    Fix: Link.w must resolve the Windows linker without the generated metadata file when it is absent — honor WITH_LLVM_LD, then LLVM_PREFIX/bin/lld-link.exe with the Windows SDK lib dirs the workflow already exports — so a link before bootstrap-llvm-link-metadata (the runner compile, and any comptime .wo action) succeeds. This is a compiler change needing its own Windows seed cut from a v0.15.1.10+ branch. Windows stays pinned at v0.15.1.8 in seed.lock until it lands; the Linux and macOS lanes bootstrap from v0.15.1.10.

  2. joshhickson commented on Sep 14, 2026

    @joshhickson
    Contributor

    Adding a user-facing data point for this, from a first-time install on Windows 11 rather than from CI.

    The same missing Windows LLVM linker metadata failure makes the published release binary unusable out of the box, not just the bootstrap build runner. On a clean Windows 11 Home 10.0.26200 x86_64 machine with no prior With and no system LLVM:

    # with-windows-x86_64.exe from the v0.15.2.1 release
    # sha256 8f4817f2c4a3a916515ec93fd8a8f228bc9cfcd423689c5977dc564efc02a115
    # (matches the with-windows-x86_64.exe pin in seed.lock)
    
    with.exe -e 'print("hi")'
    error: missing Windows LLVM linker metadata (C:\Users\<user>\.with\bin/runtime/llvm_ld)
    and no WITH_LLVM_LD / LLVM_LD / LLVM_PREFIX in the environment
    

    Only with.exe ships as a release asset — there is no runtime/ directory beside it, so <runtime root>/llvm_ld cannot exist for anyone installing from a release. This makes the first command a new Windows user runs fail.

    This matches the fix already proposed here — honour WITH_LLVM_LD, then LLVM_PREFIX/bin/lld-link.exe, when llvm_ld is absent. Setting LLVM_PREFIX manually does resolve it and the compiler then works correctly (-e, -n, -p all verified).

    Two smaller observations while here:

    1. The error message renders mixed path separators: C:\Users\<user>\.with\bin/runtime/llvm_ld.
    2. There is currently no Windows LLVM SDK published in any recent tagged release (present in 1 of the last 15 releases, absent from v0.15.2.1, v0.15.2.0, v0.15.1.8, v0.15.1.7), so a user hitting this error on a tagged release has nothing to point LLVM_PREFIX at without hunting through older nightlies. Filed as Windows LLVM SDK is not published in tagged releases (present in 1 of the last 15), so a released Windows compiler has no SDK to link with #1145; mentioning it here because it makes this issue's user-facing impact considerably worse.

    Happy to test a fix on real Windows hardware (Win 10 and Win 11, Intel + Nvidia) if that is useful.

  3. ehartford commented on Sep 16, 2026

    @ehartford
    ContributorAuthor

    Seed is only one way
    the other way is bootstrap
    I will fix this when i get to it (I will, but it might take a week or so)
    But, if you would like to fix it, you aren't blocked -
    You can bootstrap using the emit-c path

    https://github.com/withlang-dev/with/blob/main/docs/with-bootstrap-runbook.md

  4. ehartford commented on Sep 16, 2026

    @ehartford
    ContributorAuthor

    I will work on cutting a new release

  5. joshhickson commented on Sep 17, 2026

    @joshhickson
    Contributor

    I'd like to take the user-facing half of this, if it doesn't collide with #1155.

    What's left, as far as I can tell: the linker fallback in 3741acde is already in v0.15.2.1, so WITH_LLVM_LD / LLVM_LD / LLVM_PREFIX work when set. But someone installing from withlang.org gets only with.exe in %USERPROFILE%\.local\bin. install.ps1 doesn't fetch an LLVM SDK and the compiler has no default place to look for one, so their first with run hello.w still fails:

    error: missing Windows LLVM linker metadata (…\fresh-install/runtime/llvm_ld) and no WITH_LLVM_LD / LLVM_LD / LLVM_PREFIX in the environment
    error: run failed
    

    I reproduced that today with a source build of main at 69bf4e70 (seed v0.15.2.1, the selfhost-windows.yml recipe) copied into an empty folder with no LLVM variables set. The release binary fails identically, and with LLVM_PREFIX set both print hi. On main that path also now prints warning: link: could not probe … with 'llvm-nm.exe' (exit -2) when llvm-nm isn't on PATH.

    What I'd propose, as small separate PRs, each tested locally from a source build on Windows 11 first:

    1. Installer: once v0.15.2.2 publishes the Windows LLVM SDK asset, install.ps1 / install.cmd download it alongside the compiler and verify its sha256.
    2. Compiler: after the environment variables, look for that SDK in one default location before failing, and resolve llvm-nm the same way.
    3. Error text: say what to install and where, and normalise the mixed path separators in the message.

    Two questions before I start: where would you want the SDK to live (beside the binary, or a per-user directory like %USERPROFILE%\.with)? And would you rather the Windows release ship the SDK inside the compiler bundle instead, in which case only (2) and (3) apply?

  6. ehartford commented on Oct 25, 2026

    @ehartford
    ContributorAuthor

    Triage 2026-10-25, with v0.15.3.0 (main a261b65): does not reproduce. The Windows seed built the release compiler for the 2026-10-25 seed cut (win10, main c88f3ee, out\release\bin\with.exe), and 3741acd resolves lld-link when the llvm_ld metadata is absent. A lone with.exe, copied out of the tree with no LLVM* or WITH* variables set, builds and runs a program:

    > copy out\release\bin\with.exe C:\Users\Eric\triage1075\with.exe
    > C:\Users\Eric\triage1075\with.exe build hello.w -o hello.exe
    > hello.exe
    hello from user install
    

    Not isolated: this host has a system lld-link on PATH (C:\Program Files\LLVM\bin), so a machine with no LLVM at all was not tested.

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