Skip to content

source-sdk: seed bootstrap tools by symlink (unix) or with their trees (Windows), from the runner's tool, never the asset's own - #1265

Merged
ehartford merged 6 commits into
mainfrom
source-sdk-windows-seed
Sep 22, 2026
Merged

ehartford merged 6 commits into
mainfrom
source-sdk-windows-seed

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Follow-up to #1262 (which merged before its symlink fix was pushed). Two CI failures on main after it:

  • linux/aarch64 lanes: CMake Error: Could not find CMAKE_ROOT — a copied cmake cannot find its share/cmake-X.Y (it locates it relative to its executable); same for clang's lib/clang. Unix seeds are now symlinks to the real path (verified locally: symlinked cmake reports its root, a copy fails).
  • windows x86_64: cp: cannot stat '…/bin/cmake' — command -v cmake found the asset's own cmake.exe first on PATH (exactly what cannot bootstrap) and reported it without .exe. The seed now takes the first PATH candidate outside the bootstrap prefix, spelled with .exe, and copies share/cmake-* / lib/clang alongside since Windows cmake does not resolve links.

Workflow-only; the CI lanes on this PR are the test (source-sdk should get past sdk-ninja on all four non-mac lanes and produce a self-bootstrapping package).

Eric Hartford added 2 commits September 21, 2026 18:57
… from the runner's tool, never the asset's own

#1262 merged before its symlink push landed: main still copies the host
binary, and a copied cmake cannot find CMAKE_ROOT (every linux/aarch64 lane
on dd803c7). On Windows `command -v cmake` found the asset's own cmake.exe
first on PATH and reported it without .exe, so the copy stat'd a name that
does not exist (windows x86_64 on 605ecea). The seed now takes the first
PATH candidate outside the bootstrap prefix, spelled with .exe on Windows;
unix seeds are symlinks to the real path (a tool locates its share/ and
lib/clang relative to its executable); Windows copies those trees alongside.
…and packages only that

The SDK contains only binaries we built, built by a toolchain we built. A
generation-zero run compiles stage 1 with the runner's compiler, so stage 1
is a bootstrap and not a product: the action now builds again with stage
1's own clang/cmake/ninja (SDK_BOOTSTRAP_PREFIX = the stage-1 install,
moved aside) and packages that. Runs whose fetched asset can bootstrap are
unchanged.
Eric Hartford added 4 commits September 21, 2026 19:18
…rate bootstrap prefix

The seed step put the runner's tools inside the fetched SDK directory, the
prefix the compiler links against. It now inspects the asset read-only; when
the asset bootstraps itself it is used as is, otherwise a separate
.deps/bootstrap-<host> holds links to the runner's tools and is exported as
SDK_BOOTSTRAP_PREFIX for the build step, which rebuilds with stage 1's own
tools whenever the bootstrap is not the asset.
…hat cannot run fails by name

windows x86_64 on fd46738: the seeded ninja was Chocolatey's shim
(C:/ProgramData/Chocolatey/bin/ninja.exe), which runs only beside its .shim
sidecar; copied alone it failed 'ninja --version' and ninja's configure
died at project(). The seed now follows the .shim's path to the real
executable, and every seeded tool must answer --version before the build.
… Studio's), never a bin/ shim

The seed self-check caught it on c206261: 'seeded ninja does not run' — the
PATH candidate was still Chocolatey's shim. Known real locations are tried
first and Chocolatey's bin/ is skipped outright.
Both Windows lanes on e5c2cb7 failed linking cmake's cmcldeps.exe with
'duplicate resource: type MANIFEST': the GNU-style clang driver made CMake
generate its own manifest .res beside cmake's manifest .rc.
tools/build-cmake.ps1 — the recipe behind the shipped cmake.exe — builds
with clang-cl, links with lld-link and passes CMAKE_MT; sdk-cmake now does
the same (SDK_WINDOWS_MT reaches it as a sixth argument) and requires
clang-cl and lld-link in the bootstrap prefix, which the generation-zero
seed now provides on Windows.
@ehartford

Copy link
Copy Markdown
Contributor Author

Battery on this tree (seed-driven, worktree, e500abf): build rc=0, :fixpoint rc=0, :test rc=0, :test-green rc=0, :last-green rc=0 — fully green (the spec sentence is on main). CI's source-sdk lanes on e500abf are the test of the Windows cmake recipe (clang-cl + lld-link + mt.exe) and of the two-stage generation-zero build; seeding self-check and ninja/cmake bootstrap already pass on every lane.

@ehartford
ehartford merged commit 75b2f6c into main Sep 22, 2026
2 of 5 checks passed
@ehartford

Copy link
Copy Markdown
Contributor Author

Battery on ce0a6a7 (Windows rc.exe fix; seed-driven, worktree): build rc=0, :fixpoint rc=0, :test rc=0, :test-green rc=0, :last-green rc=0. CI lanes on ce0a6a7 are the remaining proof (Windows: clang-cl + lld-link + mt.exe + rc.exe from the same kit; all: stage 1 host-compiled → stage 2 self-compiled → package stage 2).

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.

1 participant