windows.mingw_w64_headers: fix building against msvcrt

Previously we relied on the default CRT selected by upstream. This
broke builds against MSVCRT starting with 12.0, as the default was
changed to UCRT

We can instead manually configure the CRT based on our `stdenv` to
ensure there is no discrepancy between the CRT we want to use and that
being targeted by the build
This commit is contained in:
seth 2024-12-13 18:55:03 -05:00
parent d237fee665
commit 6f73c037aa
No known key found for this signature in database
GPG key ID: D31BD0D494BBEE86

View file

@ -2,6 +2,7 @@
lib,
stdenvNoCC,
fetchurl,
crt ? stdenvNoCC.hostPlatform.libc,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
@ -13,6 +14,10 @@ stdenvNoCC.mkDerivation (finalAttrs: {
hash = "sha256-zEGJiqxLbo3Vz/1zMbnZUVuRLfRCCjphK16ilVu+7S8=";
};
configureFlags = [
(lib.withFeatureAs true "default-msvcrt" crt)
];
preConfigure = ''
cd mingw-w64-headers
'';