{"thread":{"id":"66323","subject":"[PATCH] cmake(windows): accommodate for Git for Windows' migration to UCRT64","startedAt":"2026-09-13T20:41:14Z","lastAt":"2026-09-13T20:41:14Z","messageCount":1,"participants":["Johannes Schindelin via GitGitGadget"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"552653","messageId":"pull.2228.git.1789332072051.gitgitgadget@gmail.com","threadId":"66323","inReplyTo":null,"subject":"[PATCH] cmake(windows): accommodate for Git for Windows' migration to UCRT64","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-09-13T20:41:12Z","receivedAt":"2026-09-13T20:41:14Z","isPatch":true,"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nGit for Windows needs to ship with a lot of Unix tools that Git takes\nfor granted, such as `sed`, `awk`, a C compiler and a Unix shell, just\nto name a few. In Git for Windows, these are provided by the MSYS2\nproject.\n\nPart of these tools (such as `bash.exe`) use a POSIX emulation layer\n(\"MSYS2 runtime\", a friendly fork of the Cygwin runtime), but others\ntarget a native Win32 toolchain, e.g. `git.exe`. There are multiple\nflavors of that toolchain, and historically Git for Windows used MINGW64\non x64 Windows. This toolchain uses the old MSVC runtime, and therefore\nthe MSYS2 project deprecated it.\n\nAs a consequence, Git for Windows switches to UCRT64 with v2.56.0. That\nflavor still uses GCC to compile native Win32 binaries, but targets the\nUniversal C Runtime (\"UCRT\"). Internally, this means that the new\n`git.exe` is installed into a new prefix, `/ucrt64/`, whereas the old\n`git.exe` was installed into `/mingw64/`.\n\nA recently-upstreamed commit hard-codes this expectation even into the\nCMake-based build, so that the built `git.exe` \"knows where it lives\"\nand can ensure that the tools it expects on the `PATH` are found.\n\nNaturally, this hard-coded MINGW64 needs to change to UCRT64 now, too.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n    cmake(windows): accommodate for Git for Windows' migration to UCRT64\n    \n    I could not squash this patch into the previous patch series (merged via\n    bca240abc334 (Merge branch 'js/mingw-build-updates', 2026-09-11))\n    because that patch series was supposed to be merged into Git's master\n    before the MINGW64 -> UCRT64 migration completed, to allow for that\n    migration to go forward without breaking Git's CI builds, whereas this\n    here patch is only correct after that migration. I completed that\n    migration (see https://github.com/git-for-windows/git-sdk-64/pull/117)\n    on September 10th, 2026, so now I can send this follow-up.\n    \n    Technically, it would not be required in core Git (because it skips the\n    vs-build CI job), but it is required in git-for-windows/git (because it\n    does not skip that CI job).\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-2228%2Fdscho%2Fadapt-cmake-after-the-mingw-to-ucrt64-migration-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2228/dscho/adapt-cmake-after-the-mingw-to-ucrt64-migration-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/2228\n\n contrib/buildsystems/CMakeLists.txt | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt\nindex e76bd19b65..7874e5a326 100644\n--- a/contrib/buildsystems/CMakeLists.txt\n+++ b/contrib/buildsystems/CMakeLists.txt\n@@ -258,7 +258,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL \"Windows\")\n \t\t\t\tOVERRIDE_STRDUP MMAP_PREVENTS_DELETE USE_WIN32_MMAP\n \t\t\t\tHAVE_WPGMPTR HAVE_RTLGENRANDOM)\n \tif(CMAKE_GENERATOR_PLATFORM STREQUAL \"x64\")\n-\t\tadd_compile_definitions(ENSURE_MSYSTEM_IS_SET=\"MINGW64\" MINGW_PREFIX=\"mingw64\")\n+\t\tadd_compile_definitions(ENSURE_MSYSTEM_IS_SET=\"UCRT64\" MINGW_PREFIX=\"ucrt64\")\n \telseif(CMAKE_GENERATOR_PLATFORM STREQUAL \"arm64\")\n \t\tadd_compile_definitions(ENSURE_MSYSTEM_IS_SET=\"CLANGARM64\" MINGW_PREFIX=\"clangarm64\")\n \telseif(CMAKE_GENERATOR_PLATFORM STREQUAL \"x86\")\n\nbase-commit: 47ce80527c56f462cb97db4ca8125342204d3783\n-- \ngitgitgadget\n"}]}