diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2021-10-13 12:55:48 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-10-13 10:36:17 -0700 |
commit | 7491ef619844ff2a47f962e1ad83ef163f9c9b38 (patch) | |
tree | 5bf5f10eed332367a3aa50ee74e6bc39a569e41e /.github/workflows | |
parent | Git 2.33.1 (diff) | |
download | tgif-7491ef619844ff2a47f962e1ad83ef163f9c9b38.tar.xz |
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>
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/main.yml | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b053b01c66..4e75701be9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -88,7 +88,7 @@ jobs: env: HOME: ${{runner.workspace}} NO_PERL: 1 - run: ci/make-test-artifacts.sh artifacts + run: . /etc/profile && ci/make-test-artifacts.sh artifacts - name: zip up tracked files run: git archive -o artifacts/tracked.tar.gz HEAD - name: upload tracked files and build artifacts @@ -115,7 +115,7 @@ jobs: - uses: git-for-windows/setup-git-for-windows-sdk@v1 - name: test shell: bash - run: ci/run-test-slice.sh ${{matrix.nr}} 10 + run: . /etc/profile && ci/run-test-slice.sh ${{matrix.nr}} 10 - name: ci/print-test-failures.sh if: failure() shell: bash @@ -199,7 +199,7 @@ jobs: env: NO_SVN_TESTS: 1 GIT_TEST_SKIP_REBASE_P: 1 - run: ci/run-test-slice.sh ${{matrix.nr}} 10 + run: . /etc/profile && ci/run-test-slice.sh ${{matrix.nr}} 10 - name: ci/print-test-failures.sh if: failure() shell: bash |