-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Fixes required to build Git for Windows with MSys2 #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
MSys2's strace facility is very useful for debugging... With this patch, the bash will be executed through strace if the environment variable GIT_STRACE_COMMANDS is set, which comes in real handy when investigating issues in the test suite. Signed-off-by: Johannes Schindelin <[email protected]>
MSys2' Git build script has some changes we should put into Git for Windows' source code proper. Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
MSys2 already has that structure. Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
The unsetenv code has no idea to update our environ_size, therefore causing segmentation faults when environment variables are removed without compat/mingw.c's knowing (MinGW's optimized lookup would try to strcmp() against NULL in such a case). Signed-off-by: Johannes Schindelin <[email protected]>
With MSys2, the "TZ" environment variable gets filtered out when calling non-MSys2 executables. The reason is that Windows' time zone handling is substantially different from the POSIX one. However, we just taught Git for Windows' fork of the MSys2 runtime to pass on the timezone in a different environment variable, MSYS2_TZ for the sole purpose of Git being able to reinterpret it correctly. Signed-off-by: Johannes Schindelin <[email protected]>
MSys2 actually allows to create files or directories whose names contain tabs, newlines or colors, even if plain Win32 API cannot access them. As we are using an MSys2 bash to run the tests, such files or directories are created successfully, but Git has no chance to work with them because it is a regular Windows program, hence limited by the Win32 API. Signed-off-by: Johannes Schindelin <[email protected]>
With MSys2, there is actually an implementation of mkfifo available. The only problem is that it is only emulating named pipes through the MSys2 runtime; The Win32 API has no idea about named pipes, hence the Git executable cannot access those pipes either. The symptom is that Git fails with a '<name>: No such file or directory' because MSys2 emulates named pipes through special-crafted '.lnk' files. The solution is to tell the test suite explicitly that we cannot use named pipes when we want to test a MinGW Git. Signed-off-by: Johannes Schindelin <[email protected]>
MSys2's `tr` does not introduce any CRLFs... This reverts commit 01a6f1b. Signed-off-by: Johannes Schindelin <[email protected]>
This test is susceptible to MSys2's posix-to-windows path mangling; Let's just use POSIX paths throughout and let the tests pass. Signed-off-by: Johannes Schindelin <[email protected]>
There is a really useful debugging technique developed by Sverre Rabbelier that inserts "bash &&" somewhere in the test scripts, letting the developer interact at given points with the current state. Another debugging technique, used a lot by this here coder, is to run certain executables via gdb by guarding a "gdb -args" call in bin-wrappers/git. Both techniques were disabled by 781f76b(test-lib: redirect stdin of tests). Let's reinstate the ability to run an interactive shell by making the redirection optional: setting the TEST_NO_REDIRECT environment variable will skip the redirection. Signed-off-by: Johannes Schindelin <[email protected]>
When shell scripts access a $TMP variable containing backslashes, they will be mistaken for escape characters. Let's not let that happen by converting them to forward slashes. This fixes t7800 with MSys2. Signed-off-by: Johannes Schindelin <[email protected]>
This fixes t7800 with MSys2. Signed-off-by: Johannes Schindelin <[email protected]>
This test assumed that there are no two equivalent directory separators. However, on Windows, the back slash and the forward slash *are* equivalent. Let's paper over this issue by converting the backward slashes to forward ones in the test that fails with MSys2 otherwise. Signed-off-by: Johannes Schindelin <[email protected]>
Fixes required to build Git for Windows with MSys2
FYI, it seems this merge started to break 7 more tests on our CI for the MSYS1-based Git SDK, see https://dscho.cloudapp.net/job/sdk-test-git/111/. Probably not a big issue with us going for MSYS2 now, but it still bothers me a bit and I wonder whether we could have made it so that tests work for both MSYS1 and MSYS2. |
Booh! I will have a look next week. |
Quick hunch: I think that (partially) reverting 3153820 might fix it. Ideally, we would guard the case "$(uname -r)" in
2.*)
# MSys2's tr works well
;;
*)
[...]
;;
esac |
I have to admit that I have no clue so far about And |
Update: compiling the code as of #27 in my |
Fixes required to build Git for Windows with MSys2
Fixes required to build Git for Windows with MSys2
I couldn't resist and did have a deeper look into why Anyway, again for the record: When using the same Git-SDK artifact and Git artifact as the test build I can reproduce the failure locally. However, when using the previous Git artifact with the same Git-SDK the failure disappears. Even just swapping the So my hunch is that a part of the toolchain was changed in a way that it broke something related to UTF-8 encoding when building Git. At this point I'll stop as I'm confident this is not easy to fix. |
Fixes required to build Git for Windows with MSys2
Fixes required to build Git for Windows with MSys2
This Pull Request, in conjunction with git-for-windows/msys2-runtime#1, makes Git for Windows compile with MSys2 and to pass the test suite.