Skip to content

cmake(windows): accommodate for Git for Windows' migration to UCRT64 - #2228

Open
dscho wants to merge 1 commit into
gitgitgadget:masterfrom
dscho:adapt-cmake-after-the-mingw-to-ucrt64-migration
Open

cmake(windows): accommodate for Git for Windows' migration to UCRT64#2228
dscho wants to merge 1 commit into
gitgitgadget:masterfrom
dscho:adapt-cmake-after-the-mingw-to-ucrt64-migration

Conversation

@dscho

@dscho dscho commented Sep 13, 2026

Copy link
Copy Markdown
Member

I could not squash this patch into the previous patch series (merged via bca240a (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 git-for-windows/git-sdk-64#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).

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>
@dscho dscho self-assigned this Sep 13, 2026
@dscho

dscho commented Sep 13, 2026

Copy link
Copy Markdown
Member Author

/submit

@gitgitgadget

gitgitgadget Bot commented Sep 13, 2026

Copy link
Copy Markdown

Submitted as pull.2228.git.1789332072051.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-2228/dscho/adapt-cmake-after-the-mingw-to-ucrt64-migration-v1

To fetch this version to local tag pr-2228/dscho/adapt-cmake-after-the-mingw-to-ucrt64-migration-v1:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-2228/dscho/adapt-cmake-after-the-mingw-to-ucrt64-migration-v1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant