All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cmake(windows): accommodate for Git for Windows' migration to UCRT64
@ 2026-09-13 20:41 Johannes Schindelin via GitGitGadget
  0 siblings, 0 replies; only message in thread
From: Johannes Schindelin via GitGitGadget @ 2026-09-13 20:41 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-13 20:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-13 20:41 [PATCH] cmake(windows): accommodate for Git for Windows' migration to UCRT64 Johannes Schindelin via GitGitGadget

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.