From: "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Johannes Schindelin <johannes.schindelin@gmx.de>,
Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: [PATCH] cmake(windows): accommodate for Git for Windows' migration to UCRT64
Date: Sun, 13 Sep 2026 20:41:12 +0000 [thread overview]
Message-ID: <pull.2228.git.1789332072051.gitgitgadget@gmail.com> (raw)
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
reply other threads:[~2026-09-13 20:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=pull.2228.git.1789332072051.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--cc=johannes.schindelin@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.