Skip to content
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

ARM64: fix /bin/bash.exe and /bin/sh.exe not starting #95

Merged
merged 1 commit into from
Oct 20, 2023

Conversation

rimrul
Copy link
Member

@rimrul rimrul commented Oct 19, 2023

There is a long standing known issue in @dennisameling test builds

When using the installer and selecting the "Add a Git Bash Profile to Windows Terminal" option, the profile is added to Windows Terminal, but it crashes on launch.

Turns out it's a caching issue.

is_running_on_arm64() currently checks two distinct things:
 - is this process running on ARM64 hardware?
 - is there a clangarm64/bin directory in the specified parent directory?

While the answer to the first question won't change during execution,
the answer to the second question can change depending on function
parameters. We currently cache the result of both in one variable.
Due to this, once we checked in one directory, we're ignoring all
subsequent directories.

This causes /bin/sh.exe and /bin/bash.exe to fail with the message
"Top-level not found" on ARM64.

To fix this, split is_running_on_arm64() into two parts and cache only
the result of the hardware part.

Signed-off-by: Matthias Aßhauer <[email protected]>
Copy link
Member

@dscho dscho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, well reasoned.

Copy link

@dennisameling dennisameling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me too. Thanks for looking into this!

@rimrul rimrul merged commit e32d5db into git-for-windows:main Oct 20, 2023
3 checks passed
@rimrul rimrul deleted the arm64-bash-fix branch October 20, 2023 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants