Skip to content

Windows SDK builds keep cmcldeps.exe beside cmake.exe (seed, package, checks); name rc.exe beside CMAKE_MT - #1266

Merged
ehartford merged 3 commits into
mainfrom
windows-sdk-rc-compiler
Sep 22, 2026
Merged

ehartford merged 3 commits into
mainfrom
windows-sdk-rc-compiler

Conversation

@ehartford

@ehartford ehartford commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Every Windows source-sdk lane failed building cmake itself at its one .rc file: fatal error RC1107: invalid usage.

Root cause (from the lane log, byte for byte): the failing command is RC D:\a\...\CMakeVersion.rc <depfile> <res> "Note: including file: " "clang-cl.exe" "rc.exe" -DUNICODE … /fo <res> <src> — a leading space where the Ninja generator's RC dependency scanner cmcldeps.exe belongs. CMake resolves cmcldeps.exe beside its own executable (cmSystemTools::FindCMakeResources) and clears the path when it is missing; cmNinjaTargetGenerator then emits the rule with an empty prefix, so RC runs from PATH with the scanner's seven positional arguments and rejects them.

The Windows seed copied only cmake.exe + share/, so the seeded cmake had no scanner. Our packager (build/sdk.w) selected the same set, so a published Windows SDK could never have bootstrapped an RC build either.

Fix (779a7102)

  • source-sdk: the Windows seed copies cmcldeps.exe beside cmake.exe; the asset usability check requires it (and clang-cl/lld-link, which cmake's MSVC-style build resolves from the bootstrap prefix); the self-check refuses a seeded cmake without it, by name.
  • build/sdk.w: the Windows package selects bin/cmcldeps.exe; the bootstrap set requires it with clang-cl.exe and lld-link.exe.

Not the fix (00995d64): CMAKE_RC_COMPILER beside CMAKE_MT was a misdiagnosis — the pre-fix lanes already used the Kit 26100 rc.exe. Kept as toolchain explicitness only.

Battery on 779a7102: running; verdict posted below.

Eric Hartford added 2 commits September 21, 2026 21:23
…eside CMAKE_MT

Both Windows lanes on e500abf: cmake's own build compiled CMakeVersion.rc
with whatever rc.exe PATH offered — Resource Compiler 10.0.10011 (the 2015
kit), which rejects CMake's flags with 'RC1107: invalid usage'. rc.exe
lives beside mt.exe in the same kit directory; both the cmake and the LLVM
configure now pass it as CMAKE_RC_COMPILER.
…s it, the package ships it, both check for it

Every Windows source-sdk lane failed building cmake itself at its one .rc
file: `fatal error RC1107: invalid usage`. The lane log shows the failing
command as ` RC D:\a\...\CMakeVersion.rc <depfile> <res> "Note: including
file: " "clang-cl.exe" "rc.exe" -DUNICODE ... /fo <res> <src>` — a leading
space where the Ninja generator's RC dependency scanner belongs. CMake
resolves `cmcldeps.exe` next to its own executable
(cmSystemTools::FindCMakeResources) and clears the path when the file is
missing; cmNinjaTargetGenerator then emits the rule with an empty scanner
prefix, so cmd runs `RC` from PATH with the scanner's seven positional
arguments, and rc.exe rejects them.

The Windows seed step copied only cmake.exe and its share/ tree, so the
seeded cmake had no scanner. Our own packager selected the same set, so a
published Windows SDK could never have bootstrapped an RC build either.

- source-sdk: the Windows seed copies cmcldeps.exe beside cmake.exe; the
  asset usability check requires it (and clang-cl/lld-link, which cmake's
  MSVC-style build resolves from the bootstrap prefix); the self-check
  refuses a seeded cmake without it, by name.
- build/sdk.w: the Windows package selects bin/cmcldeps.exe and the
  bootstrap set requires it together with clang-cl.exe and lld-link.exe.

The previous commit on this branch (CMAKE_RC_COMPILER) was a misdiagnosis:
the pre-fix lanes already used the Kit 26100 rc.exe. Naming the RC compiler
explicitly beside CMAKE_MT is kept as toolchain explicitness, not as a fix.
@ehartford ehartford changed the title Windows SDK builds name the Windows Kit's rc.exe: CMAKE_RC_COMPILER beside CMAKE_MT Windows SDK builds keep cmcldeps.exe beside cmake.exe (seed, package, checks); name rc.exe beside CMAKE_MT Sep 22, 2026
@ehartford

Copy link
Copy Markdown
Contributor Author

Battery on 779a7102 (seed-driven, WITH=$PWD/src/main src/main build): build, :fixpoint, :test, :test-green, :last-green — all rc=0.

…ailed to start on a runner-bootstrapped SDK

With cmcldeps.exe in place, the Windows lanes build cmake through all
1071 targets and then fail at `cmake -P cmake_install.cmake`: the just-built
cmake.exe does not start ("The application has failed to start because its
side-by-side configuration is incorrect"), i.e. its embedded application
manifest is invalid.

With clang-cl (MSVC_VERSION > 1600) CMake's vs_link_exe takes the
LinkEmbedsManifest path and hands the linker
`/MANIFEST:EMBED,ID=1 /MANIFESTINPUT:cmake.version.manifest`; the linker
merges its own default manifest (a trustInfo/requestedExecutionLevel block)
with that file. lld-link emits the block without an xmlns, and a lld-link
built with libxml2 — the official LLVM Windows releases force it on, and
generation zero bootstraps from the runner's LLVM — merges it with LLVM's
internal WindowsManifestMerger, which tags the block's attributes with the
nearest default namespace (`ms_asmv1:level`); Windows rejects that
manifest. Our own lld (no libxml2) shells out to mt.exe and is not affected,
which is why the stage-2 SDK never hit it and the seed's cmake did.

cmake.version.manifest already carries the requestedExecutionLevel, so the
linker's block is redundant: `/MANIFESTUAC:NO` leaves it out and the merge
has nothing to mis-tag. Applied for every Windows cmake build so both
generations link the same way.
@ehartford

Copy link
Copy Markdown
Contributor Author

779a7102 got Windows past RC1107 (cmake built all 1071 targets) and exposed the next defect: the built cmake.exe does not start — side-by-side configuration is incorrect (invalid embedded manifest). Cause: with clang-cl, CMake's vs_link_exe passes the linker /MANIFEST:EMBED,ID=1 /MANIFESTINPUT:cmake.version.manifest; the runner's LLVM release lld-link (built with libxml2) merges its unprefixed UAC block with LLVM's internal WindowsManifestMerger and produces ms_asmv1:level attributes Windows rejects. Our own lld has no libxml2 (shells to mt.exe) — the same recipe under tools/build-cmake.ps1 most likely gave the published Windows asset its non-starting cmake.exe.

Fix 6c72dc8e: the Windows cmake build links with /MANIFESTUAC:NO (cmake.version.manifest already carries requestedExecutionLevel). Battery on 6c72dc8e running; verdict below.

@ehartford

Copy link
Copy Markdown
Contributor Author

Battery on 6c72dc8e (seed-driven): build, :fixpoint, :test, :test-green, :last-green — all rc=0.

@ehartford

Copy link
Copy Markdown
Contributor Author

6c72dc8e: the manifest fix held — Windows x86_64 built and installed cmake (420 s; the built cmake.exe runs). Next defect, LLVM stage-1 build, first MASM file (BLAKE3): CreateProcess failed — CMAKE_ASM_MASM_COMPILER is the bootstrap prefix's llvm-ml64.exe, which the seed step never seeded.

Fix 8340ee0e: one seed/usability list; Windows x86_64 adds llvm-ml64 (from the runner's llvm-ml64, else its llvm-ml under that name — LLVM's own alias); build/sdk.w Windows x86_64 bootstrap set names bin/llvm-ml64.exe. Battery on 8340ee0e running.

@ehartford

Copy link
Copy Markdown
Contributor Author

Battery on 8340ee0e (seed-driven): build, :fixpoint, :test, :test-green, :last-green — all rc=0.

@ehartford

Copy link
Copy Markdown
Contributor Author

Re-pushed 8340ee0e as e1c47712 (same tree df7af8f0; GitHub never started runs for the first push). The green battery above is on this tree.

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