open-pr: avoid caching error 127#35
Merged
dscho merged 2 commits intoFeb 21, 2023
Merged
Conversation
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 <[email protected]>
We need this tool for pushing (to be precise, to generate the authorization header). For the same reason as explained in 8d36b48 (open-pr: avoid caching error 127, 2023-02-21) where the interplay of two incompatible MSYS2 runtime versions would cause an unhelpful exit code 127, calling Git for Windows' `base64.exe` from the SDK subset's Bash should be avoided. Signed-off-by: Johannes Schindelin <[email protected]>
dscho
marked this pull request as draft
February 21, 2023 08:48
dscho
marked this pull request as ready for review
February 21, 2023 08:54
rimrul
approved these changes
Feb 21, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This works around the problems identified in git-for-windows/git#4303 (comment).
Proof that caching works: https://github.com/git-for-windows/git-for-windows-automation/actions/runs/4230831858/jobs/7348623407#step:8:17
Proof that pushing works (or more correctly: generating the authorization header): https://github.com/git-for-windows/git-for-windows-automation/actions/runs/4230831858/jobs/7348623407#step:14:21