]> git.ipfire.org Git - thirdparty/git.git/commit
ci(windows): ensure that we do not pick up random executables
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 13 Oct 2021 12:55:48 +0000 (12:55 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 13 Oct 2021 17:36:17 +0000 (10:36 -0700)
commit7491ef619844ff2a47f962e1ad83ef163f9c9b38
tree5bf5f10eed332367a3aa50ee74e6bc39a569e41e
parentaf6d1d602a8f64164b266364339c4e936d5bbc33
ci(windows): ensure that we do not pick up random executables

On the Windows build agents, a lot of programs are installed, and added
to the PATH automatically.

One such program is Git for Windows, and due to the way it is set up,
unfortunately its copy of `gpg.exe` is also reachable via the PATH.

This usually does not pose any problems. To the contrary, it even allows
us to test the GPG parts of Git's test suite even if `gpg.exe` is not
delivered as part of `git-sdk-64-minimal`, the minimal subset of Git for
Windows' SDK that we use in the CI builds to compile Git.

However, every once in a while we build a new MSYS2 runtime, which means
that there is a mismatch between the copy in `git-sdk-64-minimal` and
the copy in C:\Program Files\Git\usr\bin. When that happens we hit the
dreaded problem where only one `msys-2.0.dll` is expected to be in the
PATH, and things start to fail.

Let's avoid all of this by restricting the PATH to the minimal set. This
is actually done by `git-sdk-64-minimal`'s `/etc/profile`, and we just
have to source this file manually (one would expect that it is sourced
automatically, but the Bash steps in Azure Pipelines/GitHub workflows
are explicitly run using `--noprofile`, hence the need for doing this
explicitly).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
.github/workflows/main.yml