Skip to content

Commit 740687e

Browse files
committed
Get details on ARM Git for Windows on CI from Git itself
This replaces the more complicated `sigcheck` logic with runs of `git version --build-options` before and after upgrading Git for Windows in the ARM `test-fixtures-windows` job. The reason this wasn't done before was to avoid running the old version at all, to maximize the chance that Inno Setup would be able to remove it. On Windows, it is often difficult or infeasible to remove or replace a running executable or other open file, without terminating the executable or closing the file. However, this was not the best tradeoff. Running `git version` is unlikely to leave a danling process running. What we really want is to avoid using the old Git substantially, such as in `actions/checkout`, and this still avoids that. The other reason to upgrade Git before running `actions/checkout` is to verify that the new version of Git for Windows is working by having `actions/checkout` use it. This change also preserves that. Passing `--build-options` is important here because we do want to verify that both the version of Git for Windows being replaced, and (especially) the upgrade, are ARM64 builds. (The `windows-11-arm` image currently has x86-64 builds of some preinstalled software. But it's not expected to have a non-native build of Git for Windows. If it does, then there may be more steps that should be taken besides attempting to upgrade it.)
1 parent 586cf90 commit 740687e

File tree

1 file changed

+10
-20
lines changed

1 file changed

+10
-20
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -263,29 +263,20 @@ jobs:
263263
runs-on: ${{ matrix.os }}
264264

265265
steps:
266+
- name: Report version/build of Git in this runner image
267+
run: git version --build-options
266268
- name: Upgrade Git for Windows to latest stable release
267-
# TODO: Remove this step once `windows-11-arm` ships a new enough version of Git.
269+
# TODO: Remove this and related steps once `windows-11-arm` ships a new enough Git version.
268270
# (The Windows 11 ARM runner still ships Git 2.48.*, so it remains affected by #1849.)
269271
if: matrix.os == 'windows-11-arm'
270272
env:
271273
GH_TOKEN: ${{ github.token }}
272274
run: |
273-
# Software downloaded in this step will be placed, and run from, here.
274-
$workingDir = '~/dl'
275-
mkdir $workingDir | Out-Null
276-
cd $workingDir
277-
278-
# We use Sysinternals Sigcheck to show information about the installed Git for Windows
279-
# before and after upgrade. (We are not actually using it to check any signatures.)
280-
curl -LO 'https://live.sysinternals.com/sigcheck64.exe'
281-
Write-Output 'BEFORE upgrading Git for Windows:'
282-
.\sigcheck64.exe -accepteula -nobanner 'C:\Program Files\Git\clangarm64\bin\git.exe'
283-
284-
# Configuration for which Git for Windows installer to download and how to run it. See
285-
# https://jrsoftware.org/ishelp/index.php?topic=setupcmdline on the Inno Setup arguments.
275+
$workingDir = '~/git-dl'
286276
$repo = 'git-for-windows/git'
287277
$pattern = 'Git-*-arm64.exe'
288278
$log = 'setup-log.txt'
279+
# Inno Setup args reference: https://jrsoftware.org/ishelp/index.php?topic=setupcmdline
289280
$arguments = @(
290281
'/VERYSILENT',
291282
'/SUPPRESSMSGBOXES',
@@ -296,17 +287,16 @@ jobs:
296287
'/FORCECLOSEAPPLICATIONS'
297288
)
298289
299-
# Download the Git for Windows release from GitHub and run the Inno Setup installer.
290+
mkdir $workingDir | Out-Null
291+
cd $workingDir
300292
gh release download --repo $repo --pattern $pattern
301293
$installer = Get-Item $pattern
302294
Start-Process -FilePath $installer -ArgumentList $arguments -NoNewWindow -Wait
303295
304-
# Report the effect of the upgrade.
305-
Write-Output 'Tail of the upgrade log:'
306296
Get-Content -Path $log -Tail 50
307-
Write-Output 'AFTER upgrading Git for Windows:'
308-
.\sigcheck64.exe -nobanner 'C:\Program Files\Git\clangarm64\bin\git.exe'
309-
git version
297+
- name: Report version/build of Git after upgrade
298+
if: matrix.os == 'windows-11-arm'
299+
run: git version --build-options
310300
- uses: actions/checkout@v4
311301
- name: Install rustup
312302
if: matrix.os == 'windows-11-arm'

0 commit comments

Comments
 (0)