Skip to content

Windows: build-runner action workers do not carry the toolchain environment (WITH_LLVM_LD / LLVM_PREFIX / WITH_WINDOWS_*_LIBDIR) #1083

Closed

Description

@ehartford

What happens

On native Windows a link performed inside a build-runner action worker cannot find the linker when the generated llvm_ld metadata is not on its runtime-root path:

error: missing Windows LLVM linker metadata (C:\src\with\out\stage\bin/runtime/llvm_ld) and no WITH_LLVM_LD / LLVM_LD / LLVM_PREFIX in the environment
error: build.w target failed: with-sha256

The driver process that launched the build had WITH_LLVM_LD, LLVM_PREFIX, WITH_LIBCLANG and WITH_WINDOWS_{MSVC,UCRT,UM}_LIBDIR set. Actions run with a constructed ProcessEnv that starts empty (lib/std/build.w process_env()), and only the stage-compile action forwards the toolchain variables by name (build/compiler.w comp_run_compiler_capture, lines ~434-461). Every other action that links — here with-sha256, reached from a nested with build in test/behavior/behav_project_overflow_modes.w — gets a bare environment.

Observed on native Windows, main at 54fd9052 (fix-1081-str-from-cstr), tree's own release compiler; the same battery is green on macOS/Linux because cc needs no environment.

Expected

The Windows toolchain environment reaches every action child, not just the stage compile: one forwarding helper (the list already in build/compiler.w) applied wherever an action spawns the compiler or the linker — or, better, the stage compilers carry their llvm_ld metadata under <compiler_dir>/../lib so a link needs no environment at all (link_stage_resolve_runtime_root already probes that path).

Related

The nested build reaching the repo graph in the first place is the companion issue; fix_windows.md ("The :test battery on this box") has the capture. #1075 added the environment fallback this depends on.

Activity

  1. ehartford commented on Sep 7, 2026

    @ehartford
    ContributorAuthor

    Corrected diagnosis (reporter): the 'no WITH_LLVM_LD / LLVM_PREFIX in the environment' failure was inside the repo graph that a stale PWD had rooted the nested build at (see #1082); with correct rooting the project graph builds under the same environment, and the Windows spawner inherits the environment (CreateProcessW env=NULL), so no worker scrubs it. Fixed by #1091.

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