Skip to content

Commit

Permalink
open-pr: avoid caching error 127
Browse files Browse the repository at this point in the history
When the MSYS2-runtime version changed recently, the `msys-2.0.dll`
contents of the minimal SDK diverged from the contents of the same file
in the Git for Windows installation in `C:\Program Files`.

Since we adjust the `PATH` before caching, that matters because the
`gzip` executable that is found in the `PATH` by `tar -z` is the version
from the minimal SDK, which therefore insists on using the MSYS2 runtime
from the minimal SDK, while the `tar` executable used by @actions/cache
is the `C:\Program Files\Git\usr\bin\tar.exe` one and hence uses a
potentially-incompatible MSYS2 runtime version of the Git for Windows
installation.

In git-for-windows/msys2-runtime#48, we tried to
address this by teaching the MSYS2 runtime to avoid talking to a
different MSYS2 runtime version. But the indicator used in that Pull
Request is the version of the _Cygwin_ runtime on which it is based.
Which means that Git for Windows-only changes in the MSYS2 runtime are
not reflected in that indicator, and the MSYS2 runtime _still_ tries to
talk to the other version, and the only symptom the user gets is a terse
`Child returned status 127`.

Let's work around this here (taking the pressure off fixing the MSYS2
runtime logic) simply by adjusting the `PATH` only _after_ letting
@actions/cache do its thing.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Feb 21, 2023
1 parent 31969dc commit 8d36b48
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/open-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,14 @@ jobs:
# makepkg/updpkgsums expects `curl` to be present in `/usr/bin/`
printf '#!/bin/sh\n\nexec /mingw64/bin/curl.exe "$@"' >usr/bin/curl
- name: cache git-sdk-64 subset
if: ${{ steps.restore-g4w-sdk.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v3
env:
cache-name: cache-g4w-sdk
with:
path: .sdk
key: g4w-sdk-${{ steps.clone-g4w-sdk.outputs.rev }}
- name: use git-sdk-64 subset
shell: bash
run: |
Expand All @@ -128,14 +136,6 @@ jobs:
cygpath -aw "usr/bin" >>$GITHUB_PATH &&
cygpath -aw "mingw64/bin" >>$GITHUB_PATH &&
echo "MSYSTEM=MINGW64" >>$GITHUB_ENV
- name: cache git-sdk-64 subset
if: ${{ steps.restore-g4w-sdk.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v3
env:
cache-name: cache-g4w-sdk
with:
path: .sdk
key: g4w-sdk-${{ steps.clone-g4w-sdk.outputs.rev }}
- name: Clone ${{ env.REPO }}
shell: bash
run: |
Expand Down

0 comments on commit 8d36b48

Please sign in to comment.