Skip to content

build: one function owns the SDK a build's actions read, and an LLVM_PREFIX outside the checkout is refused with the route that works (#2353) - #2657

Merged
ehartford merged 1 commit into
fix-2313from
fix-2353
Oct 25, 2026
Merged

ehartford merged 1 commit into
fix-2313from
fix-2353

Conversation

@ehartford

@ehartford ehartford commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Root cause: run_linux_sysroot_action (build/sdk.w) took
compiler_default_llvm_prefix() whatever LLVM_PREFIX said, while the build
tools pack and the sysroot pack read LLVM_PREFIX: two derivations of "which
SDK this build uses". The packs also accepted a prefix outside the project
root, which the build's file sandbox (ToolFs) refuses to read: "ToolFs path
escapes project root in read_text: …/bin/cmake". The release runbook taught
exactly that out-of-tree LLVM_PREFIX.

sdk_llvm_prefix_in_project(root, LLVM_PREFIX) is the one answer: the named
SDK as a project path, the pinned .deps SDK when none is named, "" outside
the root. The linux and windows sysroot actions and both packs read it, and
an outside prefix is refused once: "LLVM_PREFIX names an SDK outside this
checkout (…): link it in with ln -s … .deps/llvm-… and leave LLVM_PREFIX
unset". The release and bootstrap runbooks give that recipe.

Test: sdk-contract-tests asserts the five cases of
sdk_llvm_prefix_in_project. Verified on the Mac: with
LLVM_PREFIX=~/with/.deps/… a fresh worktree's :sdk-build-tools-pack failed
"ToolFs path escapes project root"; now it gives the refusal above, and with
LLVM_PREFIX unset it builds.

Closes #2353

…PREFIX outside the checkout is refused with the route that works (#2353)

Root cause: run_linux_sysroot_action (build/sdk.w) took
compiler_default_llvm_prefix() whatever LLVM_PREFIX said, while the build
tools pack and the sysroot pack read LLVM_PREFIX: two derivations of "which
SDK this build uses". The packs also accepted a prefix outside the project
root, which the build's file sandbox (ToolFs) refuses to read: "ToolFs path
escapes project root in read_text: …/bin/cmake". The release runbook taught
exactly that out-of-tree LLVM_PREFIX.

sdk_llvm_prefix_in_project(root, LLVM_PREFIX) is the one answer: the named
SDK as a project path, the pinned .deps SDK when none is named, "" outside
the root. The linux and windows sysroot actions and both packs read it, and
an outside prefix is refused once: "LLVM_PREFIX names an SDK outside this
checkout (…): link it in with `ln -s … .deps/llvm-…` and leave LLVM_PREFIX
unset". The release and bootstrap runbooks give that recipe.

Test: sdk-contract-tests asserts the five cases of
sdk_llvm_prefix_in_project. Verified on the Mac: with
LLVM_PREFIX=~/with/.deps/… a fresh worktree's `:sdk-build-tools-pack` failed
"ToolFs path escapes project root"; now it gives the refusal above, and with
LLVM_PREFIX unset it builds.
@ehartford
ehartford added this pull request to stack #2658 October 25, 2026 21:47
@ehartford ehartford changed the title fix 2353 build: one function owns the SDK a build's actions read, and an LLVM_PREFIX outside the checkout is refused with the route that works (#2353) Oct 25, 2026
@ehartford

Copy link
Copy Markdown
Contributor Author

Battery GREEN on the stack top 48c1c72c2 (with run tools/battery.w, driven by the pinned seed nightly-20261025-local-1-c88f3eeff0bc): gate, UAT and battery-checks all green (out/battery/status.txt). Covers #2650 through #2657 (#2412, #2403, #2386, #2362, #2355, #2354, #2313, #2353). #2353 was also verified on Linux x86_64 (eric-5090): an out-of-tree LLVM_PREFIX is refused with the ln -s route, and :linux-sysroot builds green through that route.

@ehartford
ehartford marked this pull request as ready for review October 25, 2026 21:59
@ehartford
ehartford merged commit 2396bc9 into main Oct 25, 2026
@ehartford
ehartford deleted the fix-2353 branch October 25, 2026 21:59
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.

A fresh worktree cannot build against an out-of-tree SDK named by LLVM_PREFIX

1 participant