git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] cmake(windows): accommodate for Git for Windows' migration to UCRT64

From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Date
Sep 13, 2026, 20:41 UTC
Message-ID
<pull.2228.git.1789332072051.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>

Git for Windows needs to ship with a lot of Unix tools that Git takes for granted, such as `sed`, `awk`, a C compiler and a Unix shell, just to name a few. In Git for Windows, these are provided by the MSYS2 project.

Part of these tools (such as `bash.exe`) use a POSIX emulation layer ("MSYS2 runtime", a friendly fork of the Cygwin runtime), but others target a native Win32 toolchain, e.g. `git.exe`. There are multiple flavors of that toolchain, and historically Git for Windows used MINGW64 on x64 Windows. This toolchain uses the old MSVC runtime, and therefore the MSYS2 project deprecated it.

As a consequence, Git for Windows switches to UCRT64 with v2.56.0. That flavor still uses GCC to compile native Win32 binaries, but targets the Universal C Runtime ("UCRT"). Internally, this means that the new `git.exe` is installed into a new prefix, `/ucrt64/`, whereas the old `git.exe` was installed into `/mingw64/`.

A recently-upstreamed commit hard-codes this expectation even into the CMake-based build, so that the built `git.exe` "knows where it lives" and can ensure that the tools it expects on the `PATH` are found.

Naturally, this hard-coded MINGW64 needs to change to UCRT64 now, too.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
    cmake(windows): accommodate for Git for Windows' migration to UCRT64
    
    I could not squash this patch into the previous patch series (merged via
    bca240abc334 (Merge branch 'js/mingw-build-updates', 2026-09-11))
    because that patch series was supposed to be merged into Git's master
    before the MINGW64 -> UCRT64 migration completed, to allow for that
    migration to go forward without breaking Git's CI builds, whereas this
    here patch is only correct after that migration. I completed that
    migration (see https://github.com/git-for-windows/git-sdk-64/pull/117)
    on September 10th, 2026, so now I can send this follow-up.
    
    Technically, it would not be required in core Git (because it skips the
    vs-build CI job), but it is required in git-for-windows/git (because it
    does not skip that CI job).
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2228%2Fdscho%2Fadapt-cmake-after-the-mingw-to-ucrt64-migration-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2228/dscho/adapt-cmake-after-the-mingw-to-ucrt64-migration-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/2228
 contrib/buildsystems/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt
index e76bd19b65..7874e5a326 100644
--- a/contrib/buildsystems/CMakeLists.txt
+++ b/contrib/buildsystems/CMakeLists.txt
@@ -258,7 +258,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
 				OVERRIDE_STRDUP MMAP_PREVENTS_DELETE USE_WIN32_MMAP
 				HAVE_WPGMPTR HAVE_RTLGENRANDOM)
 	if(CMAKE_GENERATOR_PLATFORM STREQUAL "x64")
-		add_compile_definitions(ENSURE_MSYSTEM_IS_SET="MINGW64" MINGW_PREFIX="mingw64")
+		add_compile_definitions(ENSURE_MSYSTEM_IS_SET="UCRT64" MINGW_PREFIX="ucrt64")
 	elseif(CMAKE_GENERATOR_PLATFORM STREQUAL "arm64")
 		add_compile_definitions(ENSURE_MSYSTEM_IS_SET="CLANGARM64" MINGW_PREFIX="clangarm64")
 	elseif(CMAKE_GENERATOR_PLATFORM STREQUAL "x86")

base-commit: 47ce80527c56f462cb97db4ca8125342204d3783
-- 
gitgitgadget
Message 1 of 1 in “cmake(windows): accommodate for Git for Windows' migration to UCRT64”
  1. cmake(windows): accommodate for Git for Windows' migration to UCRT64Johannes Schindelin via GitGitGadget, Sep 13, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.