Skip to content

An SDK package must bootstrap the next SDK build; CI seeds generation zero from the host (#1259) - #1262

Merged
ehartford merged 1 commit into
mainfrom
sdk-package-bootstraps
Sep 21, 2026
Merged

ehartford merged 1 commit into
mainfrom
sdk-package-bootstraps

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Draft: battery running. Expect spec-inventory-check red from #1210's @[import_module] until its spec sentence lands — reported separately.

Fixes #1259. Every published SDK asset fails sdk-ninja's bootstrap check (CI red on all four non-mac lanes since #1210 added .github/actions/source-sdk): the linux x86_64 asset keeps bin/clang -> clang-22 as a link with no clang-22 in the archive and no share/; windows ships cmake.exe without share/cmake-*; the aarch64 assets have no cmake/ninja. None was produced by build/sdk.w's packager — they predate it.

  • build/sdk.w: the unix selection includes bin/clang-<major> (the driver the links resolve to); run_package_llvm_sdk_action refuses an archive that cannot bootstrap the next build (driver, links, cmake + module tree, ninja); the contract test pins the selection on every platform.
  • .github/actions/source-sdk: each bootstrap tool missing or dangling in the fetched asset is copied from the runner's toolchain with a loud line naming the source; the package that run produces then bootstraps itself. Once such a package is published on every platform (release runbook: republish + bump WITH_SDK_VERSION), the seeding never triggers.

@ehartford

Copy link
Copy Markdown
Contributor Author

Battery (seed-driven, worktree): build rc=0, :fixpoint rc=0, :test — every lane green except spec-inventory-check (implementation has unspec'd import_module, from #1210; needs the blessed §16.3 sentence, not this PR). sdk-contract-tests passes with the new bootstrap-set assertions. Stays draft until that lane is unblocked and the battery records green.

… zero from the host

Every published SDK asset fails `sdk-ninja`'s bootstrap check (CI red on
all four non-mac lanes since #1210 added .github/actions/source-sdk):
linux x86_64 v0.15.1 keeps `bin/clang -> clang-22` and `bin/clang++ ->
clang` as links with no clang-22 in the archive and no share/ (cmake without
its modules); windows x86_64 ships cmake.exe without share/cmake-*
(CMAKE_ROOT); the linux/windows aarch64 assets are older builds with no
cmake or ninja. None was produced by build/sdk.w's packager (no With code or
workflow writes .tar.zst); they predate it.

build/sdk.w: the unix tool selection includes the driver the links resolve
to (`bin/clang-<major>`, from COMPILER_LLVM_VERSION), and
run_package_llvm_sdk_action refuses an archive whose manifest lacks any of
the bootstrap set (driver, links, cmake + share/cmake-X.Y/Modules, ninja)
— "SDK archive cannot bootstrap the next SDK build: missing …". The
contract test pins the selection on every platform.

.github/actions/source-sdk: before building, each bootstrap tool that is
missing or dangling in the fetched asset (cmake also needs its module tree)
is copied from the runner's toolchain with a loud line naming the source;
the package that run produces then bootstraps itself. Once such a package
is published on every platform the seeding never triggers.
@ehartford

Copy link
Copy Markdown
Contributor Author

Proof for the reseed: this branch rebased onto #1263's tree (spec sentence present) runs the full battery green — build rc=0, :fixpoint rc=0, :test rc=0 (all lanes, sdk-contract-tests with the new bootstrap-set assertions included). Merge order: #1263 then this; the branch stays based on main.

@ehartford
ehartford force-pushed the sdk-package-bootstraps branch from ecde4ad to 85c2837 Compare September 21, 2026 22:01
@ehartford
ehartford marked this pull request as ready for review September 21, 2026 22:01
@ehartford
ehartford merged commit dd803c7 into main Sep 21, 2026
0 of 5 checks passed
ehartford pushed a commit that referenced this pull request Sep 21, 2026
…anion trees (Windows)

A copied cmake cannot find CMAKE_ROOT and a copied clang loses lib/clang:
each locates its trees relative to its own executable (#1262 CI run on
85c2837: seeded /usr/local/bin/cmake, then 'Could not find CMAKE_ROOT').
Unix seeds resolve through a symlink to the real path; Windows, where cmake
does not resolve links, copies share/cmake-* and lib/clang alongside.
ehartford added a commit that referenced this pull request Sep 22, 2026
…s (Windows), from the runner's tool, never the asset's own (#1265)

* source-sdk: seed by symlink (unix) or with companion trees (Windows), 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.

* source-sdk: a seeded run rebuilds the SDK with its own stage-1 tools 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.

* source-sdk: the fetched SDK is never written to; seeds live in a separate 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.

* source-sdk: resolve Chocolatey shims to the real executable; a seed that 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.

* source-sdk: on Windows take the real ninja (Chocolatey lib/ or Visual 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.

* sdk-cmake on Windows is an MSVC-style build: clang-cl, lld-link, mt.exe

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.

---------

Co-authored-by: Eric Hartford <[email protected]>
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.

Published LLVM SDK assets cannot bootstrap sdk-ninja: dangling bin/clang links, cmake without share/, aarch64 assets without cmake/ninja

1 participant