Skip to content

Look into MSys2 #25

Closed
Closed
@dscho

Description

@dscho

I am looking into using MSys2 for future Git for Windows development, for a couple of reasons:

  • MSys2 packages are much more up-to-date than MSys ones
  • MSys2 offers a nice, stable package management system, pacman (ported from Arch Linux)
  • MSys2 already ships with mintty, a powerful alternative to the cmd.exe command-line window
  • MSys2 has 64-bit support
  • MSys2 allows us to (re-)build Perl with Subversion bindings easily (at least that is the impression I got)

This ticket mainly serves as a notepad listing quirks and issues I find out while working on getting Git for Windows to build with MSys2.

It is quite easy to get started with MSys2:

  1. download and install MSys2 as mentioned on https://msys2.github.io/
  2. run the MINGW shell (not the MSys2 shell) from the Start Menu
  3. run pacman -Sy git mingw-w64-x86_64-gcc to install Git and GCC (-S means "synchronize", i.e. install, and -y does not mean "yes" but "refresh the package list before installing the newest versions of the specified packages")
  4. clone https://github.com/git-for-windows/MINGW-packages, say, into /usr/src/
  5. in MINGW-packages/mingw-w64-git/, run makepkg-mingw -s (the -s says: install all dependencies, including build time dependencies, via pacman)
  6. Play with the unpacked sources (they are in the src/build-x86_64/ or the src/build-i686/ subdirectory)

So it looks that it is pretty easy to get started, as well as to rebuild the MSys2 installer (which we might want to do in order to continue offering a net installer to contributors that avoids requiring manual steps).

Having said that, there are a few bumps on the road to heave: The following issues need to be solved before we can start bundling up even so much as a portable application:

  • tab completion in the MSys2 shell seems to be flakey (it sometimes does not find anything, and pressing the Tab key repeatedly will not do anything in that case, but often it helps to delete the last character, retype it, and then press the Tab key again). This did not happen with the MinGW shell, funnily enough, so it might not be a huge problem for us; However, it could indicate a more problematic, deeper bug
  • MSys2's openssh refuses to heed the HOME variable and always looks into /home/.ssh/
  • MinGW Git built with makepkg-mingw hardcodes the absolute exec path (e.g. C:/msys64/mingw64/git-core)
  • it seems that git ls-remote origin, run from a freshly-built and installed MinGW Git fails to be able to output anything, and git ls-remote origin | cat (a trick learned from working with old MSys'/MinGW's quirks) only says: output is not a tty (the exit code is 127, suggesting that some executable was not found, but it is very difficult to say which one because not even debug print statements to stderr are shown; It seems that in case of a crash or of a die(), stderr is not flushed)
  • we #define some S_* flags in mingw.h that mingw-w64's headers already define. This results in tons of compile warnings that might hide valid problems
  • MSys2's build recipe (called PKGBUILD; very similar to msysGit's home-brewn release.sh scripts) lists a dozen patches; We need to determine whether to reject them or whether to integrate them in our Git fork proper)
  • MSys2 builds Git with ./configure while our strategy has always been to enhance the configuration in config.mak.uname; We need to decide whether we want to follow the ./configure strategy or rather continue with our tried and tested approach
  • the mingw-w64-x86_64-gdb package is a 64-bit executable, but handles only 32-bit executables, it seems. This will make debugging substantially harder
  • we will also need to add support for the -f flag to MSys2's kill command (Note: MSys2's kill already knows the -f flag, but there is a Bash builtin that takes precedence when calling kill without an explicit path, and that kill does not know the -f flag)

I will keep updating this report as I find out more.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions