Skip to content

Build graph cache ignores env inputs such as SDK_OUTPUT_PREFIX: a target's declared output comes from the previous run's environment #1925

Closed

Description

@ehartford

Seen during #1915 on the Windows VM (seed nightly-20260926-local-1-2e8defaa18ef).

  1. src/main.exe build :stage2 with no SDK_* variables set.
  2. SDK_BOOTSTRAP_PREFIX=.deps/llvm-22.1.6-windows-x86_64-msvc SDK_OUTPUT_PREFIX=out/sdk-gnu/llvm-22.1.6-windows-x86_64-msvc src/main.exe build :sdk-cmake

Step 2 failed with

error: action target 'sdk-windows-libc' did not produce declared output: C:/src/win-own-sdk/out/sdk/windows-x86_64-msvc/install/llvm-22.1.6-windows-x86_64-msvc/libc/windows/x86_64-w64-mingw32/lib/crt2.o

— the default output prefix, although sdk_windows_libc_target reads SDK_OUTPUT_PREFIX through ctx.env_input (build.w sdk_output_prefix_arg). Deleting out/.build-state/build-graph.cache* and rerunning the same command built into out/sdk-gnu/... as asked. So the cached graph was reused although an environment input of build(ctx) changed.

Expected: a variable read with ctx.env_input during graph construction is part of the graph cache key (or invalidates it).

Workaround used: remove out/.build-state/build-graph.cache* before switching SDK_* variables.

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