Start support for MSYSTEM=ARM64#321
Conversation
|
@dennisameling I am slightly worried that we're using |
|
@dscho could you give me a bit more guidance as to how I can test this? I followed the steps in git-for-windows/git-sdk-32#6 (comment) and |
The What the If you have just cloned your 32-bit Git for Windows SDK, or if you pulled from it recently, you should be able to see via Once verified that those edits are there, it would be good if you could verify on a Windows/ARM64 machine that the |
|
Oh, and please also test whether installing |
| # Allow an i686 version of Git for Windows, augmented by `/arm64/*`, to serve | ||
| # as sort of an ARM64 version of Git for Windows (because Windows/ARM64 can run | ||
| # i686 executables via a built-in emulator). | ||
| test i686 != "$arch" || |
There was a problem hiding this comment.
Not sure about this line. Using the 64-bit SDK on another machine and then it doesn't work. When I remove this line, /etc/profile is updated correctly in the SDK root folder 🚀 Benefit of removing this line is that this patch will be applied both to git-sdk-32 and git-sdk-64, so then it doesn't matter which SDK folks use to build Git. This shouldn't hurt anyone unless their MSYSTEM is set to ARM64 😊
Will do some more tests later today, but at least for now /etc/profile is updated correctly 🎉
There was a problem hiding this comment.
Not sure about this line. Using the 64-bit SDK on another machine and then it doesn't work.
That's on purpose, actually: you will not find the case statement in the 64-bit SDK. Instead, it was moved to /etc/msystem there.
The reason why the 32-bit SDK has a different /etc/profile is that its MSYS part hasn't been updated in a long time. In other words, it does not reflect the newest filesystems package definition.
When I remove this line,
/etc/profileis updated correctly in the SDK root folder 🚀 Benefit of removing this line is that this patch will be applied both togit-sdk-32andgit-sdk-64, so then it doesn't matter which SDK folks use to build Git.
For the moment, I would rather leave out the complication of dealing with both git-sdk-32 and git-sdk-64, but focus on getting it working correctly only in the git-sdk-32 case.
There was a problem hiding this comment.
for now
/etc/profileis updated correctly
🎉
My one concern is that the MANPATH is now set exclusively to /arm64/{local,share}/man, but there is nothing there...
There was a problem hiding this comment.
So if I understand it correctly, MANPATH is for the Git for Windows manual files (https://git-scm.com/docs/git#Documentation/git.txt---man-path)? When is this variable actually being used?
There was a problem hiding this comment.
I created a portable installer and it correctly includes the updated /etc/profile 🚀
What would be the correct order of steps to build a portable installer with the arm64 binaries? Something like this?
sdk build mingw-w64-gitpacman -U mingw-w64-i686-git-2.30.0.2.f8cbc844b8-1-any.pkg.tar.xzsdk build git-extra(so that/etc/profilegets overwritten to include ARM64)pacman -U git-extra-1.1.513.20ab9a5-1-i686.pkg.tar.xz- (create the arm64 binaries now and output to
C:\git-sdk-32\arm64) - Build the portable installer with the
--cross-compile-arm64option, see portable: add arm64 artifact option #323 for details
There was a problem hiding this comment.
So if I understand it correctly,
MANPATHis for the Git for Windows manual files (https://git-scm.com/docs/git#Documentation/git.txt---man-path)? When is this variable actually being used?
When you call something like man bash in the SDK. This issue is not that important given that we ship Git for Windows without man.exe, but still...
There was a problem hiding this comment.
Shall we leave it as-is for now then?
Just to confirm, this is the updated section in /etc/profile after running sdk build git-extra:
MINGW32)
MINGW_MOUNT_POINT="${MINGW_PREFIX}"
PATH="${MINGW_MOUNT_POINT}/bin:${MSYS2_PATH}${ORIGINAL_PATH:+:${ORIGINAL_PATH}}"
PKG_CONFIG_PATH="${MINGW_MOUNT_POINT}/lib/pkgconfig:${MINGW_MOUNT_POINT}/share/pkgconfig"
ACLOCAL_PATH="${MINGW_MOUNT_POINT}/share/aclocal:/usr/share/aclocal"
MANPATH="${MINGW_MOUNT_POINT}/local/man:${MINGW_MOUNT_POINT}/share/man:${MANPATH}"
;;
MINGW64)
MINGW_MOUNT_POINT="${MINGW_PREFIX}"
PATH="${MINGW_MOUNT_POINT}/bin:${MSYS2_PATH}${ORIGINAL_PATH:+:${ORIGINAL_PATH}}"
PKG_CONFIG_PATH="${MINGW_MOUNT_POINT}/lib/pkgconfig:${MINGW_MOUNT_POINT}/share/pkgconfig"
ACLOCAL_PATH="${MINGW_MOUNT_POINT}/share/aclocal:/usr/share/aclocal"
MANPATH="${MINGW_MOUNT_POINT}/local/man:${MINGW_MOUNT_POINT}/share/man:${MANPATH}"
;;
ARM64)
MINGW_MOUNT_POINT="/arm64"
PATH="${MINGW_MOUNT_POINT}/bin:/mingw32/bin:${MSYS2_PATH}${ORIGINAL_PATH:+:${ORIGINAL_PATH}}"
PKG_CONFIG_PATH="${MINGW_MOUNT_POINT}/lib/pkgconfig:${MINGW_MOUNT_POINT}/share/pkgconfig"
ACLOCAL_PATH="${MINGW_MOUNT_POINT}/share/aclocal:/usr/share/aclocal"
MANPATH="${MINGW_MOUNT_POINT}/local/man:${MINGW_MOUNT_POINT}/share/man:${MANPATH}"
;;
There was a problem hiding this comment.
I wasn't happy leaving it as-is, in particular the rather non-intuitive sed invocation. @dennisameling could you please test again, and also sanity-check the new revision (it should be eminently more readable than before)?
There was a problem hiding this comment.
@dscho just tested again, the results:
✔️ Running sdk build git-extra and then pacman -U git-extra-...-tar.xz correctly updates /etc/profile in git-sdk-32:
ARM64)
MINGW_MOUNT_POINT="/arm64"
PATH="${MINGW_MOUNT_POINT}/bin:/mingw32/bin:${MSYS2_PATH}${ORIGINAL_PATH:+:${ORIGINAL_PATH}}"
PKG_CONFIG_PATH="${MINGW_MOUNT_POINT}/lib/pkgconfig:${MINGW_MOUNT_POINT}/share/pkgconfig:/mingw32/lib/pkgconfig:/mingw32/share/pkgconfig"
ACLOCAL_PATH="${MINGW_MOUNT_POINT}/share/aclocal:/mingw32/share/aclocal:/usr/share/aclocal"
MANPATH="${MINGW_MOUNT_POINT}/local/man:${MINGW_MOUNT_POINT}/share/man:/mingw32/local/man:/mingw32/share/man:${MANPATH}"
;;
✔️ Things are looking good in ARM64 Git:
Thanks! And yes, the code is much easier to understand now, thank you 😅
There was a problem hiding this comment.
Perfect. Time to merge, then.
Windows/ARM64 can run i686 executables via a built-in emulator. Since it is currently not possible to build much of anything in MSYS2 for Windows/ARM64, let's sort of support Windows/ARM64 via starting with an i686 version of Git for Windows' SDK, then augmenting it by Git artifacts built via Visual Studio and installed into `/arm64/*`. To allow for that, we now handle the special value `MSYSTEM=ARM64` to set up the environment accordingly. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
20ab9a5 to
a6b3a14
Compare
|
Just a quick headup, x64 emulation is coming soon. In fact, it's available now on the Windows Insider Dev channel. Once the x64 emulation is out in production, people are going to download the x64 version onto their arm64 machines. |
Yep, but I don't expect the emulator to be shipped "out of band", i.e. outside the twice-a-year feature updates. And it would be too late for the spring update, so it'll be fall. In any case, let's hammer it out with the i686 version and then work on x86_64. |
|
The build succeded in building and publishing |


This teaches
/etc/profileto handle the special valueMSYSTEM=ARM64to set up the environment such thatPATHprefers executables in/arm64/bin/but also falls back to/mingw32/bin/.The basis is still an i686 version of MSYS2: there is currently no toolchain support in MSYS2 to build executables targeting Windows/ARM64, but there is a built-in i686 emulator in WIndows/ARM64.