Reinstate mingw-w64-git, synchronizing the package definition from Git for Windows#26470
Reinstate mingw-w64-git, synchronizing the package definition from Git for Windows#26470dscho wants to merge 4 commits intomsys2:masterfrom
mingw-w64-git, synchronizing the package definition from Git for Windows#26470Conversation
|
@ognevny I notice that the CLANGARM64 job does not build any packages. Is there any trick to this? |
I've put a suggestion in proper place. there was a missing field |
|
|
Whoops. Will of course drop them when cleaning up this PR branch. |
You mean this: Wow, that required some digging. That |
66e13b0 to
191ac7e
Compare
Isn't this only part of the issue that |
It totally is. That's the reason for the For now, I'd like to get the build green so as to know what has to be done, and then fix |
de1149a to
2bc1458
Compare
This option was added in fa93bb2 (MinGW: Fix stat definitions to work with MinGW runtime version 4.0, 2013-09-11), i.e. a _long_ time ago. So long, in fact, that it still targeted MinGW. But we switched to mingw-w64 in 2015, which seems not to share the problem, and therefore does not require a fix. Even worse: This flag is incompatible with UCRT64, which we are about to support by way of upstreaming `mingw-w64-git` to the MSYS2 project, see msys2/MINGW-packages#26470 for details. So let's send that option into its well-deserved retirement. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
There are now a good deal of work-arounds for things in git-for-windows/git that need to be adjusted before we can mark msys2#26470 as ready for review. Better develop the patches directly in the Git repository than playing more of those `config.mak` and `sed` games. This here commit will of course be dropped as soon as things work and the git-for-windows/git patches made it into a tagged version of Git for Windows. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
There are now a good deal of work-arounds for things in git-for-windows/git that need to be adjusted before we can mark msys2#26470 as ready for review. Better develop the patches directly in the Git repository than playing more of those `config.mak` and `sed` games. This here commit will of course be dropped as soon as things work and the git-for-windows/git patches made it into a tagged version of Git for Windows. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
eaea93f to
394a6a5
Compare
There are now a good deal of work-arounds for things in git-for-windows/git that need to be adjusted before we can mark msys2#26470 as ready for review. Better develop the patches directly in the Git repository than playing more of those `config.mak` and `sed` games. This here commit will of course be dropped as soon as things work and the git-for-windows/git patches made it into a tagged version of Git for Windows. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
394a6a5 to
6ebbd8a
Compare
|
by the way, can we try to enable rust like in msys2/MSYS2-packages#5812? (but with mingw-w64-rust) |
Could we keep that as a separate second step? |
do you actually need it? I mean win7 target |
Good idea! Rust won't stay optional forever, Git's planning on making it mandatory by the end of next year. Maybe we should leave that for a follow-up PR, though. It'll take some work to get the fixes into Git for Windows, and I get the sense, after reading on the Git mailing list about the In other words, Rust isn't my highest priority right now :-) |
|
no hurries with Rust, just a suggestion |
Rust will be mandatory in Git soon and yes, we will need to keep supporting Windows 8.1 and I have been led to believe that this Rust toolchain version is the only one that could provide that support. |
Yes. We do intend to keep supporting Windows 8.1 for now, so it's either win7 targets on |
in next years older Windows support seems less relevant... I guess there could be issues with maintaining separate target for older systems edit: and it's only about MINGW{32,64} |
|
it seems you need to re-run |
Of course ;-) I keep forgetting that. |
I'd like to foster tighter collaboration between the Git for Windows and the MSYS2 project, as I documented here: msys2#16383 As part of that effort, here is the exact same package definition of the `mingw-w64-git` package as Git for Windows uses, as per https://github.com/git-for-window/MINGW-packages/commit/fa6b8ebc02 (Prepare some more for upstreaming `mingw-w64-git` to MSYS2 (git-for-windows#174), 2025-11-25). Note: As part of this effort, I have split out the Git for Windows-specific part from that package that would be highly inappropriate in MSYS2's context: For example, Git for Windows comes with a `git-bash.exe` in the top-level directory, and it also installs its logo into `$MINGW_PREFIX/share/git/`. These now live in the `mingw-w64-git-for-windows-addons` package. This is not the first time that a `mingw-w64-git` package definition has lived in this here repository: Six years ago, such a definition was removed (as "deprecated"), in 446b69f (More cleanup for packages. Move all packages not provided by pacman and deprecated to new repo https://github.com/msys2/MINGW-packages-dev, 2019-06-03). The chances of success are much better now, though: Git for Windows is much more mature now, and already collaborates highly successfully with the MSYS2 project in the msys2-runtime repository. So there is precedent for fruitful and friendly working together. Besides, all of the blockers are resolved that would have let Git's test suite fail due to differences in the MSYS2 runtime or in other parts of the tree. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
13b6d77 to
e452dfe
Compare
|
Finally! This is it, at long last: ready for review. |
|
for me it's fine. some nits like metadata can be added in later PRs. waiting for others... |
Cool, cool. I'll synchronize those changes back to Git for Windows so that the |
This option was added in fa93bb2 (MinGW: Fix stat definitions to work with MinGW runtime version 4.0, 2013-09-11), i.e. a _long_ time ago. So long, in fact, that it still targeted MinGW. But we switched to mingw-w64 in 2015, which seems not to share the problem, and therefore does not require a fix. Even worse: This flag is incompatible with UCRT64, which we are about to support by way of upstreaming `mingw-w64-git` to the MSYS2 project, see msys2/MINGW-packages#26470 for details. So let's send that option into its well-deserved retirement. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Every once in a while, there are bug reports in Git for Windows' bug tracker that describe an issue running [inside MSYS2 proper](https://gitforwindows.org/install-inside-msys2-proper), totally ignoring the big, honking warning on top of [the page](https://gitforwindows.org/install-inside-msys2-proper) that spells out clearly that this is an unsupported use case. At the same time, we cannot easily deflect and say "just use MSYS2 directly" (and leave the "and stop pestering us" out). We cannot do that because there is only an _MSYS_ `git` package in MSYS2 (i.e. a Git that uses the quite slow POSIX emulation layer provided by the MSYS2 runtime), but no `mingw-w64-git` package (which would be equivalent in speed to Git for Windows). In msys2/MINGW-packages#26470, I am preparing to change that. As part of that PR, I noticed and fixed a couple of issues _in `git-for-windows/git` that prevented full support for `mingw-w64-git` in MSYS2, such as problems with CLANG64 and UCRT64. While at it, I simplified the entire setup to trust MSYS2's `MINGW_PREFIX` & related environment variables instead of hard-coding values like the installation prefix and what `MSYSTEM` to fall back on if it is unset.
|
I'd prefer if the .install file would be dropped, at least for now. It's depending on MINGW_PREFIX which is not the prefix of the package, but the environment you call pacman from, so installing is broken from the MSYS env, and broken when installing from a different env. The files it creates are not namespaced, so uninstalling might break another env. The first one can be fixed by having an .install file per env, like we do in all packages, the later I don't know, depends on what it's trying to achieve. I get this when installing in MSYS: I get this when installing in the matching env: Unrelated to that, uninstalling gave me: |
Oh wow, this should only have been part of the
True; It should probably hard-code the |
mingw-w64-git/PKGBUILD
Outdated
| "${MINGW_PACKAGE_PREFIX}-openssl" | ||
| "${MINGW_PACKAGE_PREFIX}-pcre2" | ||
| "${MINGW_PACKAGE_PREFIX}-asciidoctor") | ||
| install=git.install |
There was a problem hiding this comment.
using git-${MSYSTEM}.install files with hard-coded prefixes can probably help
There was a problem hiding this comment.
Right. I actually went for MINGW_PACKAGE_PREFIX instead, and generate it on the fly, but the idea is the same.
There was a problem hiding this comment.
Hmm. That did work locally, but not in CI...
There was a problem hiding this comment.
better write these install files manually
2cd2136 to
de3acc5
Compare
This file's goal is to ensure that the compatibility wrapper is
installed into the `<top>\bin\` directory so that e.g.
D:\path\to\msys2\bin\sh.exe -lc "echo Hello"
would work. These wrappers are totally inappropriate for the
mingw-w64-git package and should therefore not be installed via the
`.install` script.
Instead, let's move it to the place that is totally appropriate a place
for this: the mingw-w64-git-for-windows-addons package which already
installs wrappers like `<top>\git-bash.exe`.
This commit is best viewed with `--color-moved`.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
7961e62 to
e40689c
Compare
The idea of the Git wrapper is that it is installed into various places
(as part of the `mingw-w64-git-for-windows-addons` package), e.g. into
`<msys64>\git-bash.exe`. This executable will then set up the required
environment variables and spawn the actual `bash.exe`.
Likewise, the Git wrapper is installed into `<msys64>\cmd\git.exe`
where it can be called directly from, say, a PowerShell, without needing
to add all the correct `PATH` entries and without setting `MSYSTEM`: the
wrapper will do all that, and then spawn the actual `git.exe` in the
correct subdirectory.
Now, grace to Git for Windows' history, which started out before MSYS2
was invented and was based on MSys and MinGW instead, the actual logic
grew organically. In the early days, when Git for Windows only supported
i686 builds, all of those environment variable values were hardcoded.
Later, when Git for Windows was moved on top of MSYS2, only two values
were possible: "MINGW64" and "MINGW32". When timid steps were taken to
support Windows/ARM64, a third option was added: "CLANGARM64".
All this was unnecessary, though: The environment variable `MSYSTEM` is
set when building the mingw-w64-git package, and it is guaranteed to be
set to the very value the Git wrapper wants to use at run-time.
So let's stop hard-coding the MINGW{32,64} values, and drop the hack we
needed in Git for Windows while the clangarm64 builds were only
experimental.
Instead, just use the value in the environment variable `MSYSTEM` at
build time, hard-coding _that_ into the binary. This will allow the Git
wrapper to find the executables that were put into the corresponding
`mingw-w64-git-*` packages.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
e40689c to
8679563
Compare
|
Good that y'all pointed me to the If you hadn't pointed me to this, I wouldn't have verified that they work for, say, the UCRT64 version. I did test that, realized that some major changes were still needed in |
This option was added in fa93bb2 (MinGW: Fix stat definitions to work with MinGW runtime version 4.0, 2013-09-11), i.e. a _long_ time ago. So long, in fact, that it still targeted MinGW. But we switched to mingw-w64 in 2015, which seems not to share the problem, and therefore does not require a fix. Even worse: This flag is incompatible with UCRT64, which we are about to support by way of upstreaming `mingw-w64-git` to the MSYS2 project, see msys2/MINGW-packages#26470 for details. So let's send that option into its well-deserved retirement. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Every once in a while, there are bug reports in Git for Windows' bug tracker that describe an issue running [inside MSYS2 proper](https://gitforwindows.org/install-inside-msys2-proper), totally ignoring the big, honking warning on top of [the page](https://gitforwindows.org/install-inside-msys2-proper) that spells out clearly that this is an unsupported use case. At the same time, we cannot easily deflect and say "just use MSYS2 directly" (and leave the "and stop pestering us" out). We cannot do that because there is only an _MSYS_ `git` package in MSYS2 (i.e. a Git that uses the quite slow POSIX emulation layer provided by the MSYS2 runtime), but no `mingw-w64-git` package (which would be equivalent in speed to Git for Windows). In msys2/MINGW-packages#26470, I am preparing to change that. As part of that PR, I noticed and fixed a couple of issues _in `git-for-windows/git` that prevented full support for `mingw-w64-git` in MSYS2, such as problems with CLANG64 and UCRT64. While at it, I simplified the entire setup to trust MSYS2's `MINGW_PREFIX` & related environment variables instead of hard-coding values like the installation prefix and what `MSYSTEM` to fall back on if it is unset.
This option was added in fa93bb2 (MinGW: Fix stat definitions to work with MinGW runtime version 4.0, 2013-09-11), i.e. a _long_ time ago. So long, in fact, that it still targeted MinGW. But we switched to mingw-w64 in 2015, which seems not to share the problem, and therefore does not require a fix. Even worse: This flag is incompatible with UCRT64, which we are about to support by way of upstreaming `mingw-w64-git` to the MSYS2 project, see msys2/MINGW-packages#26470 for details. So let's send that option into its well-deserved retirement. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Every once in a while, there are bug reports in Git for Windows' bug tracker that describe an issue running [inside MSYS2 proper](https://gitforwindows.org/install-inside-msys2-proper), totally ignoring the big, honking warning on top of [the page](https://gitforwindows.org/install-inside-msys2-proper) that spells out clearly that this is an unsupported use case. At the same time, we cannot easily deflect and say "just use MSYS2 directly" (and leave the "and stop pestering us" out). We cannot do that because there is only an _MSYS_ `git` package in MSYS2 (i.e. a Git that uses the quite slow POSIX emulation layer provided by the MSYS2 runtime), but no `mingw-w64-git` package (which would be equivalent in speed to Git for Windows). In msys2/MINGW-packages#26470, I am preparing to change that. As part of that PR, I noticed and fixed a couple of issues _in `git-for-windows/git` that prevented full support for `mingw-w64-git` in MSYS2, such as problems with CLANG64 and UCRT64. While at it, I simplified the entire setup to trust MSYS2's `MINGW_PREFIX` & related environment variables instead of hard-coding values like the installation prefix and what `MSYSTEM` to fall back on if it is unset.
Ever since I moved Git for Windows from MSys to MSYS2 in 2015, I have dreamed of this: To share the identical package definition of
mingw-w64-gitwith MSYS2. This will allow MSYS2 users to benefit from Git for Windows within their regular MSYS2 setup, while allowing existing Git for Windows users to continue using the official installer to install and upgrade.This here PR is a vital part of the initiative laid out in #16383.