feat(toolchain): native MSVC cl.exe build backend + graph-global dialect flags (#210) — 0.0.90#213
Merged
Merged
Conversation
…ole module graph (#210) [build].cxxflags like -freflection change what libstdc++ headers DECLARE (<meta> is gated on __cpp_impl_reflection) — they are module-graph dialect, same nature as -std=. They now ride -std='s channels: the global $cxxflags (every TU incl. dependency modules — fixes the fmt.gcm-class secondary failure), the std/std.compat prebuild command, and scans. Known-list auto-promotion (reflection/contracts/char8_t/_GLIBCXX_USE_CXX11_ABI) + explicit [build] dialect_cxxflags escape hatch. The fingerprint already keyed these flags — only the command construction was missing them. Also: cppStandardFlag is now spelled per-dialect (std_flag_for — msvc /std:c++20 | /std:c++latest), groundwork for the native MSVC backend. Verified: issue #210's exact repro prints 'x 2 / y 3' via import std on gcc@16.1.0; e2e 98 covers both variants + std-module.json assertion.
- C1 env model: find_windows_sdk() + build_env_for_cl() synthesize INCLUDE/LIB/PATH/VSLANG=1033 from the detected VC tools + SDK (no vcvarsall run); enrich_toolchain_from_cl fills tc.envOverrides; missing SDK keeps detection working and fails the BUILD with guidance (replaces the 0.0.88 'not yet supported' gate — the gate is gone). - C2 emission: SeparateLinker rules (link.exe /OUT + rspfile — cmd's 8191 limit), lib.exe archives, /DLL+/IMPLIB shared, deps=msvc via /showIncludes, /interface /TP for .cppm module units, /std: mapping (std_flag_for), /MD|/MT CRT model, /Od, /nologo /EHsc /utf-8 baseline, .obj object extension end to end (plan objExt + std staging names). - C3 std/std.compat staging: single-cl commands (/ifcOutput), ifc.cache layout, registry-dispatched staged paths (clang hardcoding removed), stdmod executes with the toolchain env (capture_with_env). - C4 scanning: /scanDependencies as the third builtin P1689 producer (provider capability + ninja scan rule); dyndep ifc-parameterized as-is. - C8 fast path: '@env' multi-var encoding in the build cache env slot so incremental msvc builds re-create INCLUDE/LIB for ninja. - cd /d in std stage commands (cmd.exe won't change drive without it; D: workspace + C: BMI cache is the real CI layout). Zero-diff gate re-verified for GCC and LLVM vs the 0.0.89 release binary.
…rsion/docs - e2e 99 (requires: msvc): default msvc → modules build/run → import std → incremental; 95's build-gate assertion flips to a real build+run; the ci-windows MSVC step now drives 99. - mingw: windows-only guard with a clear message (was 'invalid xpkg target xim:mingw-gcc@'); e2e 97 objdump path unhardcoded; doctor gains Windows SDK + mingw sections. - release.yml publish-ecosystem timeout 20→30 (backstop for the fixed mirror script's worst case). - version 0.0.90 + CHANGELOG + docs/03 MSVC build section.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the FULL
.agents/docs/2026-07-13-post-089-roadmap-and-std-dialect-flags-design.mdin one PR (step plan:2026-07-13-single-pr-090-implementation-plan.md).Native MSVC builds (the 0.0.88 gate is GONE)
mcpp toolchain default msvc+mcpp build/runnow compile with cl.exe:find_windows_sdk()+ INCLUDE/LIB/PATH/VSLANG synthesized from detected VC tools + SDK (no vcvarsall); missing SDK → detection still works, build fails with guidance; doctor reports SDK + mingw status./ifcOutput(ifc.cache),.cppmunits via/interface /TP, consumption via/ifcSearchDir,/scanDependenciesas the third builtin P1689 scanner for dyndep./DLL /IMPLIB;deps=msvc(/showIncludes, VSLANG=1033);/MD|/MTCRT;/std:mapping;.objend-to-end; fast-path cache learns an@envmulti-var encoding so msvc incrementals keep INCLUDE/LIB.Dialect-class flags are module-graph-global (fixes #210)
-freflection& friends ride -std='s channels (global cxxflags for ALL TUs incl. dependency modules, std BMI prebuild, scans). Known-list auto-promotion +[build] dialect_cxxflagsescape hatch. Verified: the issue's exact repro printsx 2 / y 3; e2e 98 covers the dep-module (fmt.gcm-class) variant.Also
Evidence (temp PR #212, one-round green, run 29245851464)
PASS: native MSVC build — modules, import std, incremental(e2e 99)PASS: msvc@system detection, selection, guidance, and native build(95)PASS: mingw toolchain — install, default, modules build/run, standalone exe(97)Version
0.0.90 (mcpp.toml + fingerprint.cppm + CHANGELOG). Closes #210.