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

Ensure that please.sh finds git.exe #952

Merged
merged 2 commits into from
Sep 10, 2024
Merged

Conversation

dscho
Copy link
Member

@dscho dscho commented Sep 10, 2024

We currently only add the /usr/bin/ directory to the PATH when running please.sh, but we need to add the directory that contains the native git.exe as well.

For simplicity, we just add all the candidate directories, expecting that exactly one of them will actually exist and contain git.exe.

This closes #951

@dscho dscho self-assigned this Sep 10, 2024
The `please.sh` script is supposed to be invoked with the `PATH` that
contains a working `git.exe`. However, the way it is currently invoked,
only the `/usr/bin/` directory is added to the `PATH`, but not the
clang/MINGW directory that contains the native `git.exe`.

This does not matter on GitHub-hosted runners because Git for Windows is
installed on those runners and therefore `git.exe` is _already_ in the
`PATH`.

However, on self-hosted runners, Git for Windows may not even be
installed, and even if it is, it may not have been added to the `PATH`.

Therefore, let's add those clang/MINGW directories.

Do not even bother testing whether those directories exist; Those will
simply be ignored anyway, and it is the simplest way to guarantee that
`please.sh` will find the intended `git.exe`.

This fixes git-for-windows#951.

Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
Copy link
Contributor

@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.

Works as expected, thank you!

@dscho dscho merged commit abc3197 into git-for-windows:main Sep 10, 2024
2 checks passed
@dscho dscho deleted the fix-on-arm64 branch September 10, 2024 17:27
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.

Error git: command not found on GitHub-hosted arm64 runner that got GfW installed at runtime
2 participants