From c09c5301b335350de280c0efad40d89cee03cbc4 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 13 Nov 2024 13:32:45 +0100 Subject: [PATCH] DEBUG: verify that the newly-patched MSYS2 runtime works around the Windows/ARM64 deadlocks I updated https://github.com/git-for-windows/msys2-runtime/pull/73 to build the newest iteration of the dead-lock workaround, which worked 100% in my tests. Let's verify that it works around the issues in `update-via-pacman.ps1`, too. Signed-off-by: Johannes Schindelin --- .github/workflows/sync.yml | 54 +++++++++++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 7 deletions(-) diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index be460f1f892..7444d8f652c 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -1,13 +1,7 @@ name: sync on: - schedule: - - cron: "57 2 * * *" - workflow_dispatch: - inputs: - debug_with_ssh_key: - description: 'Public SSH key to use to debug failures' - required: false + push: env: GIT_CONFIG_PARAMETERS: "'user.name=Git for Windows Build Agent' 'user.email=ci@git-for-windows.build' 'windows.sdk64.path=${{ github.workspace }}' 'windows.sdk32.path=' 'http.sslbackend=schannel' 'core.autocrlf=false' 'checkout.workers=16'" @@ -25,10 +19,56 @@ jobs: with: persist-credentials: true token: ${{ secrets.PUSH_TOKEN }} + - name: use git-sdk-arm64's Bash and Git for Windows' git.exe + run: "usr\\bin\\bash.exe -lc 'cygpath -aw /usr/bin >>$GITHUB_PATH && cygpath -aw /c/Program\\ Files/Git/cmd/ >>$GITHUB_PATH'" + - name: download patched MSYS2 runtime + id: download + shell: bash + env: + GH_TOKEN: ${{ github.token }} + run: | + # Only do this if `pacman` is prevented from being upgraded + grep '^ *IgnorePkg *= *pacman' etc/pacman.conf || exit 0 + + pacman -S --noconfirm mingw-w64-clang-aarch64-github-cli && + git add -A && + git commit -sm 'TO-DROP: install GitHub CLI' || exit 1 + export PATH=$PATH:/clangarm64/bin + + sha="$(gh api repos/git-for-windows/msys2-runtime/pulls/73 \ + --jq '.head.sha')" && + check_run_url="$(gh api repos/git-for-windows/msys2-runtime/commits/$sha/check-runs \ + --jq '.check_runs[] | select(.name=="build") | .url')" && + workflow_job_url="$(gh api "${check_run_url#https://api.github.com/}" --jq '.details_url')" && + workflow_run_url="${workflow_job_url%/job/*}" && + artifacts_url="$(gh api "repos/${workflow_run_url#https://github.com/}" --jq '.artifacts_url')" && + zip_url="$(gh api "${artifacts_url#https://api.github.com/}" --jq '.artifacts[].archive_download_url')" && + curl -H "Authorization: token ${{secrets.GITHUB_TOKEN}}" -#sLo /tmp/install.zip "$zip_url" && + echo "result=$(cygpath -aw /tmp/install.zip)" >>$GITHUB_OUTPUT + - name: unzip MSYS2 runtime + shell: pwsh + run: "C:\\Windows\\system32\\tar -xf ${{ steps.download.outputs.result }}" + - name: commit MSYS2 runtime + shell: bash + run: | + # Give the `/etc/profile.d/` scripts a chance to set things up + bash -lc 'uname -a' && + + git add -A && + git commit -m 'Install patches MSYS2 runtime' && + sed -i 's/^*\(IgnorePkg *=\).*/# &/' etc/pacman.conf && + git commit -m 'Allow `pacman` to be upgraded again' \ + -m 'It had been overridden with a version that does not deadlock on Windows/ARM64, but now an MSYS2 runtime has been installed that prevents that deadlock in a much better way' \ + etc/pacman.conf && + git push origin HEAD - name: Update all Pacman packages shell: pwsh run: | & .\update-via-pacman.ps1 + - name: Update all Pacman packages again, for good measure + shell: pwsh + run: | + & .\update-via-pacman.ps1 - name: use git-sdk-arm64's Bash and Git for Windows' git.exe run: "usr\\bin\\bash.exe -lc 'cygpath -aw /usr/bin >>$GITHUB_PATH && cygpath -aw /c/Program\ Files/Git/cmd/ >>$GITHUB_PATH'" - name: deal with large DLL files