Git Bash: support running on ARM64 without ARM64 binaries again#46
Conversation
By mistake, a camelCased function name was introduced. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
c2c0990 to
36a87e9
Compare
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
mingw-w64-git/git-wrapper.c
Outdated
| WCHAR msystem_bin2[64]; | ||
|
|
||
| /* Maybe we are on ARM64 but don't have the binaries? */ | ||
| swprintf(msystem_bin2, sizeof(msystem_bin2), L"mingw%d\\bin", (int) sizeof(void *) * 8); |
There was a problem hiding this comment.
Shouldn't this check for the arm64\bin folder instead? If that doesn't exist, we're running on ARM64 but don't have the binaries, correct?
There was a problem hiding this comment.
Yes, and we're already in the clause where we determined that arm64/bin does not exist. So we're falling back, looking for mingw<bitness>/bin here.
|
Sure, will test later today! |
Thank you! |
BTW I should have said this earlier: I am trying a slightly patched |
|
Tried with the generated binaries from your CI run (https://github.com/dscho/git/actions/runs/561141041), but the fork bomb is still there unfortunately. Tried building locally based on this PR just to be sure, but then ran into https://github.com/git-for-windows/git-sdk-32/issues/7😞 tried fixing it for an hour by installing/removing all kinds of pacman packages, to no avail |
BTW which |
|
Getting a warning while compiling |
|
Okay, so it probably does not detect the correct top-level directory. Maybe patch the
Yeah, I stumbled over this, too, but it is harmless. I thought that casting to The main worry is what is going wrong, and I could imagine that it makes most sense to patch And then you could even compile it using |
|
Can't we simply do a |
We don't know the absolute path, then. Remember, we could call this via absolute path, or via |
|
That's why I implemented it at that point: 2ecdd7e |
|
BTW we'll want to add this in an extra commit, I think: diff --git a/mingw-w64-git/git-wrapper.c b/mingw-w64-git/git-wrapper.c
index 130fc1adc..68bc73bd2 100644
--- a/mingw-w64-git/git-wrapper.c
+++ b/mingw-w64-git/git-wrapper.c
@@ -712,7 +712,7 @@ int main(void)
is_git_command = 1, full_path = 1, skip_arguments = 0,
allocate_console = 0, show_console = -1,
append_quote_to_cmdline = 0;
- WCHAR exepath[MAX_PATH], exe[MAX_PATH], top_level_path[MAX_PATH];
+ WCHAR exepath[MAX_PATH], exe_bup[MAX_PATH], exe[MAX_PATH], top_level_path[MAX_PATH];
LPWSTR cmd = NULL, exep = exe, prefix_args = NULL, basename;
LPWSTR working_directory = NULL;
@@ -729,6 +729,7 @@ int main(void)
/* get the installation location */
/* GetModuleFileName(NULL, exepath, MAX_PATH); */
find_exe_realpath(exepath, MAX_PATH);
+ wcscpy(exe_bup, exepath);
if (!PathRemoveFileSpec(exepath)) {
fwprintf(stderr, L"Invalid executable path: %s\n", exepath);
ExitProcess(1);
@@ -830,6 +831,11 @@ int main(void)
}
}
+ if (!wcscmp(exe_bup, exep)) {
+ fwprintf(stderr, L"BUG (fork bomb): %s\n", exep);
+ ExitProcess(1);
+ }
+
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
|
|
Just added some Output is only So the |
|
Aargh, you're right! We're calling |
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
There has been a report that `bin/git.exe` spawns itself over and over again. This is clearly a bug, and to avoid it from making a user's machine sluggish, let's error out early in that case. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
It was reported that the x86 version of Git for Windows v2.30.1 fork bombs on ARM64. The reason is that we are looking for the ARM64 binaries, but they are not bundled in the x86 version. Let's fall be careful before enabling ARM64 mode. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
git-wrapper.c changed, after all. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
36a87e9 to
dd83c3c
Compare
|
I think I've got something. If we call |
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
|
Nice!! It works without the Let me just double-check the case when the |
|
Bingo! Also works when the |
|
Awesome! I also kicked off a build here: https://github.com/dscho/git/actions/runs/562531927, and intend to let the (private...) reporter test before merging. |
That test also succeeded. |




I have no way to test this. @dennisameling, could you?