Skip to content

[tmp] toolchain dialect + MinGW ecosystem — Windows CI iteration (0.0.89)#209

Closed
Sunrisepeak wants to merge 8 commits into
mainfrom
tmp/dialect-mingw-ci
Closed

[tmp] toolchain dialect + MinGW ecosystem — Windows CI iteration (0.0.89)#209
Sunrisepeak wants to merge 8 commits into
mainfrom
tmp/dialect-mingw-ci

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

Temp iteration PR for the real 0.0.89 PR. Only ci-windows.yml (+release.yml for e2e 45's content assertion) kept. Do not merge.

…Part A)

New mcpp.toolchain.dialect: command-line *spellings* (gnu vs msvc) as a
value-type traits table — flags.cppm and ninja rule templates now spell
-I/-D/-std=/-c/-o/-O/-g/ar-invocations through it instead of hardcoding
GNU syntax. BmiTraits gains the module-flag spellings (compileModulesFlag,
stdBmiUsePrefix, moduleOutputPrefix, bmiSearchPrefix), replacing the
is_clang()/stdlib_id branches in flags.cppm. ProviderCapabilities gains
has_builtin_p1689_scan (drops ninja_backend's is_gcc gate). Toolchain gains
envOverrides (EnvVar list — std::pair member trips GCC-16 module pendings)
merged into ninja's child env; the MSVC backend will carry INCLUDE/LIB/PATH
through it. gcc::std_module_build_commands normalizes the provider surface
to the command-sequence shape clang already has. resolve_link_model returns
the empty PE model explicitly on Windows.

Zero-diff verified: build.ninja byte-identical (modulo the mcpp self-path
var) for GCC and LLVM toolchains on a multi-module import-std project;
mcpp test 31/31.
…) (0.0.89)

User-facing 'mingw' spec → xim:mingw-gcc (winlibs GCC 16.1.0 + MinGW-w64
14.0.0 UCRT standalone build, mirrored at xlings-res/mingw-gcc). Reuses the
GCC backend end-to-end (gcm module pipeline, bits/std.cc import std);
Windows adds static libstdc++/libgcc defaults so produced exes run
standalone, and -static under linkage="static". archive_tool resolves the
bundled ar.exe; std.cc lookup gains a version-dir scan fallback.

Fixes ridden along: toolchain list 'Available' + partial-version resolution
read xpkg versions for the HOST platform (was hardcoded linux — empty on
win/mac); toolchain install no longer pulls glibc/linux-headers on win/mac.

e2e 97 (requires: windows cap) + ci-windows MinGW step + unit tests
(dialect rows, mingw spec mapping); docs + CHANGELOG; version 0.0.89.
The Windows-host if-constexpr broke the linkmodel contract tests on
Windows CI (they resolve synthetic Linux-shaped toolchains anywhere).
Target-keyed is also the semantics a future cross build needs.
std::vprint_unicode's __open_terminal/__write_to_terminal live in
libstdc++exp.a on Windows-GCC targets — first real MinGW link on CI failed
with undefined references from bits/print.h.
winlibs POSIX-threads libstdc++ otherwise leaves produced exes depending on
libwinpthread-1.dll — the standalone-exe e2e caught it (empty output,
missing-DLL abort). -Wl,-Bstatic -lwinpthread -Wl,-Bdynamic is the standard
recipe; libwinpthread.a ships in the payload.
The silent standalone-run failure gave nothing to debug — inspect DLL
imports directly and dump them on any failure.
…cipe loses to driver implicit libs

CI import table still showed libwinpthread-1.dll after
-Wl,-Bstatic -lwinpthread; winlibs' documented answer for standalone exes
is a full -static link (system DLLs still resolve via import libs).
Gated on staticStdlib so [build] static_stdlib=false opts out.
@Sunrisepeak

Copy link
Copy Markdown
Member Author

Green on run 29233042340 (e2e 52/0 incl. 97 mingw full flow + dedicated MinGW/MSVC steps). Superseded by real PR #211 with all workflows restored.

@Sunrisepeak Sunrisepeak deleted the tmp/dialect-mingw-ci branch July 13, 2026 08:04
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