Skip to content

build(cmake): adapt import std wiring to the CMake 4.5 model, unpin CI CMake - #1867

Merged
caomengxuan666 merged 2 commits into
mainfrom
fix/1865-import-std-cmake45
Nov 23, 2026
Merged

caomengxuan666 merged 2 commits into
mainfrom
fix/1865-import-std-cmake45

Conversation

@caomengxuan666

@caomengxuan666 caomengxuan666 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Refs #1865 — UNVERIFIED-BY-CAPTAIN

Outcome up front: the wiring is adapted to the CMake 4.5 model, but the unpin is blocked upstream and the 4.4.5 pins stay. A trial unpin on this branch (run 45226913688) proved both halves: the configure took the new native path on the image's CMake 4.5.0 and generated the full graph — and all four legs still died with the #1855 LNK1181 signature, because CMake 4.5.0's synthesized std targets on this image (MSVC 14.52) carry only BMI edges: the std.compat.ixx.obj compile edge is missing (6 BMI edges, 0 obj edges in the log) while link lines still reference it. That edge is synthesized by CMake from the MSVC modules metadata; with the wiring on the documented 4.5 model, the repo no longer participates in it. This is root cause #2 from the #1855 diagnosis, now confirmed independently of the wiring. The pins were therefore restored (second commit); their comment in build-winuxcmd.yml now states the new reason and the removal test (a trial unpin with all four legs green after a CMake/MSVC roll).

What this PR changes (final state vs main: 3 files, +39/−10)

  • cmake/enable_import_std.cmake (+15/−0): on CMake >= 4.5 the script states the native model and returns — no UUID gate, no CMAKE_CXX_MODULE_STD (inert in 4.5), no levels variable. The 3.30–4.4 path is byte-unchanged, including the build: pin CMake 4.4.5 in build-windows CI + FATAL_ERROR on unknown import-std CMake version #1855 FATAL_ERROR for an unknown version on that line. Under the restored pin (4.4.5) the new branch never executes; it activates for local >= 4.5 configures and for the eventual unpin.
  • CMakeLists.txt (+13/−3): the CXX26 dialect arm no longer decides levels from CMAKE_CXX_COMPILER_IMPORT_STD on CMake >= 4.5 (undefined there by design); it deliberately keeps the proven canary outcome until the CXX26 dialect is graduated separately.
  • .github/workflows/build-winuxcmd.yml (comment only): the pin step is byte-identical to main; its comment now records why the pin remains and how to remove it. The other three pin steps and all configure flags are byte-identical to main — the dead -D cleanup from the trial commit was restored with the pins so the pinned combination stays exactly the proven-green one; flag cleanup rides with the eventual unpin.

What this PR deletes

  • The configure's need to know a per-minor UUID for current CMake: the >= 4.5 branch is version-free, so no future CMake minor needs a table entry on that line.
  • The dialect block's read of a removed variable on the 4.5 line.
  • (Deferred, deliberately: the four pin steps and the dead -D flags — they leave with the unpin, once the upstream graph defect is fixed.)

Net lines: +39 / −10. No product source, no user-visible text (no i18n surface).

Evidence

  • 4.5 model, from Kitware's own docs: CMAKE_CXX_MODULE_STD "no longer has any effect" in 4.5, import std; is automatic with CXX_SCAN_FOR_MODULES; CMAKE_CXX_COMPILER_IMPORT_STD reporting removed in 4.5; 4.5 release notes: import std available for all C++20+ code with scanning enabled.
  • Local script-mode branch tests of the reworked script (version variables stubbed, file otherwise verbatim): 3.29 → not supported; 3.31 → UUID 0e5b6991 + MODULE_STD ON; 4.4.5 → UUID f35a9ac6 + ON (pinned path intact); 4.5.0 / 4.6.0 → native branch, no gate vars, no error.
  • Trial unpin run 45226913688 (head 9e16ca0): configure green on CMake 4.5.0 (native-path STATUS in log, MSVC 19.52), build reached 617 targets, then 3x LNK1181 on the same three targets as build: pin CMake 4.4.5 in build-windows CI + FATAL_ERROR on unknown import-std CMake version #1855 (locale-ctype-check, rust2-stream-driver, winuxcmd) against synth_0/synth_3 std.compat.ixx.obj; graph forensics: BMI edges present, obj edges zero — the diagnosis §1 shape, reproduced under correct 4.5 wiring.
  • Restored-pin run: see the checks on head 0bdd86e — expected job-for-job identical to the main baseline (run 45165743812, success), since the workflows again match main and the cmake changes are inert under 4.4.5.

What remains for #1865 after this PR

The unpin itself, gated on an upstream fix (a CMake and/or MSVC roll whose generated graph contains the std obj edge). When that lands: delete the four pin steps + the dead -D flags (the trial commit 9e16ca0 on this branch is exactly that change, ready to re-apply) and re-run the four legs. An upstream bug report (CMake issue tracker, with the 45226913688 graph evidence) is the other open follow-up.

…I CMake

CMake 4.5 graduated import std: no UUID gate, CMAKE_CXX_MODULE_STD is
inert, CMAKE_CXX_COMPILER_IMPORT_STD is gone. enable_import_std.cmake
now returns early on >= 4.5 (native model); the 3.30-4.4 experimental
UUID path and its FATAL_ERROR hardening are unchanged. The root
CMakeLists CXX26 dialect arm no longer decides levels from the removed
variable. All four #1855 CMake 4.4.5 pin steps (build-winuxcmd,
benchmark-speed-matrix, gnu-master-differential x2) and the dead
-DCMAKE_CXX_MODULE_STD / -DCMAKE_EXPERIMENTAL_CXX_MODULE_STD flags are
removed; CI now uses the windows-2025 image's CMake 4.5.

Refs #1865
Trial unpin (run 45226913688) proved the wiring adaptation correct and
the blocker upstream: on the image's CMake 4.5.0 the configure took the
native path and generated the full graph, but the synthesized std
targets carry only BMI edges -- the std.compat.ixx.obj compile edge is
missing while link lines still reference it, reproducing the #1855
LNK1181 signature verbatim on all four legs. That edge is synthesized
by CMake from the MSVC modules metadata; the repo wiring no longer
participates. Restore the pins (reason updated in build-winuxcmd.yml)
until a CMake/MSVC roll fixes the graph. The dead -D flags restored
with them keep the pinned combination byte-identical to the proven
green main; their removal rides with the eventual unpin.

Refs #1865
@caomengxuan666
caomengxuan666 merged commit ad4e40a into main Nov 23, 2026
32 checks passed
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