CI: Add MinGW/GCC build to Windows GHA
- Supersedes #91692
Initially, I wanted to integrate Windows CI for MinGW with both GCC and LLVM; however, the latter was a bit of a headache and one that stumped me at the time. This updated PR scales back the scope to focus exclusively on a GCC build, as LLVM is somewhat covered with clang-cl being officially supported. Windows MinGW compilation can be egregiously slow, so the target is template_release rather than editor.
As a side note, cross-compiling from Fedora 40, I get this warning, both with and without this PR:
WARNING: Couldn't parse version of `ar`.
That's because it's using Fedora (my host OS)'s /usr/bin/ar, which is has this version string:
$ ar --version
GNU ar version 2.41-37.fc40
Copyright (C) 2023 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
This diff seems to fix it, adding support for Fedora's AR version string.
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index 249d9540d7..c540fa29c8 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -662,7 +662,7 @@ def get_ar_version(env):
print_warning("Couldn't check version of `ar`.")
return ret
- match = re.search(r"GNU ar \(GNU Binutils\) (\d+)\.(\d+)(?:\.(\d+))?", output)
+ match = re.search(r"GNU ar(?: \(GNU Binutils\)| version) (\d+)\.(\d+)(?:\.(\d+))?", output)
if match:
ret["major"] = int(match[1])
ret["minor"] = int(match[2])
Also a bit brittle, but shouldn't harm to add this.
I'll take responsibility if anything borks