Skip to content

Commit 308763f

Browse files
committed
fixup! fixup! fixup! fixup! ci(windows/gnu): install mingw via msys2/setup-msys2
1 parent 8a54a65 commit 308763f

File tree

2 files changed

+52
-32
lines changed

2 files changed

+52
-32
lines changed

.github/workflows/ci.yaml

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ jobs:
3838
run_tests: YES
3939
- target: x86_64-pc-windows-gnu
4040
mingwdir: mingw64
41+
gcc: x86_64-w64-mingw32-gcc
42+
gcc_package: mingw-w64-x86_64-gcc
4143
steps:
4244
- uses: actions/checkout@v4
4345
# v2 defaults to a shallow checkout, but we need at least to the previous tag
@@ -60,20 +62,22 @@ jobs:
6062
if: matrix.mingwdir != ''
6163
with:
6264
msystem: ${{ matrix.mingwdir }}
65+
install: ${{ matrix.gcc_package }}
6366
- name: Add mingw tools to path
6467
shell: powershell
6568
if: matrix.mingwdir != ''
6669
run: |
67-
# https://github.com/actions/runner-images/issues/5459#issuecomment-1532856844
68-
Remove-Item -Recurse -Force "C:\mingw64"
69-
Remove-Item -Recurse -Force "C:\Strawberry"
7070
$(
71-
'C:\msys64\${{ matrix.mingwdir }}\bin' + "`r`n"
72-
'C:\msys64\usr\bin' + "`r`n"
73-
Get-Content $env:GITHUB_PATH -Raw
71+
'C:\msys64\${{ matrix.mingwdir }}\bin'
72+
'C:\msys64\usr\bin'
73+
Get-Content $env:GITHUB_PATH
7474
) | Set-Content $env:GITHUB_PATH
75-
Get-Command x86_64-w64-mingw32-gcc -ErrorAction SilentlyContinue
76-
Get-Command i686-w64-mingw32-gcc -ErrorAction SilentlyContinue
75+
Get-Content $env:GITHUB_PATH
76+
- name: Verify mingw gcc installation
77+
shell: powershell
78+
if: matrix.mingwdir != ''
79+
run: |
80+
Get-Command ${{ matrix.gcc }}
7781
- name: Set PATH
7882
run: |
7983
echo "%USERPROFILE%\.cargo\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
@@ -186,6 +190,8 @@ jobs:
186190
run_tests: YES
187191
- target: x86_64-pc-windows-gnu
188192
mingwdir: mingw64
193+
gcc: x86_64-w64-mingw32-gcc
194+
gcc_package: mingw-w64-x86_64-gcc
189195
steps:
190196
- uses: actions/checkout@v4
191197
# v2 defaults to a shallow checkout, but we need at least to the previous tag
@@ -208,20 +214,22 @@ jobs:
208214
if: matrix.mingwdir != ''
209215
with:
210216
msystem: ${{ matrix.mingwdir }}
217+
install: ${{ matrix.gcc_package }}
211218
- name: Add mingw tools to path
212219
shell: powershell
213220
if: matrix.mingwdir != ''
214221
run: |
215-
# https://github.com/actions/runner-images/issues/5459#issuecomment-1532856844
216-
Remove-Item -Recurse -Force "C:\mingw64"
217-
Remove-Item -Recurse -Force "C:\Strawberry"
218222
$(
219-
'C:\msys64\${{ matrix.mingwdir }}\bin' + "`r`n"
220-
'C:\msys64\usr\bin' + "`r`n"
221-
Get-Content $env:GITHUB_PATH -Raw
223+
'C:\msys64\${{ matrix.mingwdir }}\bin'
224+
'C:\msys64\usr\bin'
225+
Get-Content $env:GITHUB_PATH
222226
) | Set-Content $env:GITHUB_PATH
223-
Get-Command x86_64-w64-mingw32-gcc -ErrorAction SilentlyContinue
224-
Get-Command i686-w64-mingw32-gcc -ErrorAction SilentlyContinue
227+
Get-Content $env:GITHUB_PATH
228+
- name: Verify mingw gcc installation
229+
shell: powershell
230+
if: matrix.mingwdir != ''
231+
run: |
232+
Get-Command ${{ matrix.gcc }}
225233
- name: Set PATH
226234
run: |
227235
echo "%USERPROFILE%\.cargo\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
@@ -336,8 +344,12 @@ jobs:
336344
run_tests: YES
337345
- target: x86_64-pc-windows-gnu
338346
mingwdir: mingw64
347+
gcc: x86_64-w64-mingw32-gcc
348+
gcc_package: mingw-w64-x86_64-gcc
339349
- target: i686-pc-windows-gnu # skip-pr skip-master
340350
mingwdir: mingw32 # skip-pr skip-master
351+
gcc: i686-w64-mingw32-gcc # skip-pr skip-master
352+
gcc_package: mingw-w64-i686-gcc # skip-pr skip-master
341353
steps:
342354
- uses: actions/checkout@v4
343355
# v2 defaults to a shallow checkout, but we need at least to the previous tag
@@ -360,20 +372,22 @@ jobs:
360372
if: matrix.mingwdir != ''
361373
with:
362374
msystem: ${{ matrix.mingwdir }}
375+
install: ${{ matrix.gcc_package }}
363376
- name: Add mingw tools to path
364377
shell: powershell
365378
if: matrix.mingwdir != ''
366379
run: |
367-
# https://github.com/actions/runner-images/issues/5459#issuecomment-1532856844
368-
Remove-Item -Recurse -Force "C:\mingw64"
369-
Remove-Item -Recurse -Force "C:\Strawberry"
370380
$(
371-
'C:\msys64\${{ matrix.mingwdir }}\bin' + "`r`n"
372-
'C:\msys64\usr\bin' + "`r`n"
373-
Get-Content $env:GITHUB_PATH -Raw
381+
'C:\msys64\${{ matrix.mingwdir }}\bin'
382+
'C:\msys64\usr\bin'
383+
Get-Content $env:GITHUB_PATH
374384
) | Set-Content $env:GITHUB_PATH
375-
Get-Command x86_64-w64-mingw32-gcc -ErrorAction SilentlyContinue
376-
Get-Command i686-w64-mingw32-gcc -ErrorAction SilentlyContinue
385+
Get-Content $env:GITHUB_PATH
386+
- name: Verify mingw gcc installation
387+
shell: powershell
388+
if: matrix.mingwdir != ''
389+
run: |
390+
Get-Command ${{ matrix.gcc }}
377391
- name: Set PATH
378392
run: |
379393
echo "%USERPROFILE%\.cargo\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8

ci/actions-templates/windows-builds-template.yaml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,12 @@ jobs: # skip-master skip-pr skip-stable
2828
run_tests: YES
2929
- target: x86_64-pc-windows-gnu
3030
mingwdir: mingw64
31+
gcc: x86_64-w64-mingw32-gcc
32+
gcc_package: mingw-w64-x86_64-gcc
3133
- target: i686-pc-windows-gnu # skip-pr skip-master
3234
mingwdir: mingw32 # skip-pr skip-master
35+
gcc: i686-w64-mingw32-gcc # skip-pr skip-master
36+
gcc_package: mingw-w64-i686-gcc # skip-pr skip-master
3337
steps:
3438
- uses: actions/checkout@v4
3539
# v2 defaults to a shallow checkout, but we need at least to the previous tag
@@ -52,20 +56,22 @@ jobs: # skip-master skip-pr skip-stable
5256
if: matrix.mingwdir != ''
5357
with:
5458
msystem: ${{ matrix.mingwdir }}
59+
install: ${{ matrix.gcc_package }}
5560
- name: Add mingw tools to path
5661
shell: powershell
5762
if: matrix.mingwdir != ''
5863
run: |
59-
# https://github.com/actions/runner-images/issues/5459#issuecomment-1532856844
60-
Remove-Item -Recurse -Force "C:\mingw64"
61-
Remove-Item -Recurse -Force "C:\Strawberry"
6264
$(
63-
'C:\msys64\${{ matrix.mingwdir }}\bin' + "`r`n"
64-
'C:\msys64\usr\bin' + "`r`n"
65-
Get-Content $env:GITHUB_PATH -Raw
65+
'C:\msys64\${{ matrix.mingwdir }}\bin'
66+
'C:\msys64\usr\bin'
67+
Get-Content $env:GITHUB_PATH
6668
) | Set-Content $env:GITHUB_PATH
67-
Get-Command x86_64-w64-mingw32-gcc -ErrorAction SilentlyContinue
68-
Get-Command i686-w64-mingw32-gcc -ErrorAction SilentlyContinue
69+
Get-Content $env:GITHUB_PATH
70+
- name: Verify mingw gcc installation
71+
shell: powershell
72+
if: matrix.mingwdir != ''
73+
run: |
74+
Get-Command ${{ matrix.gcc }}
6975
- name: Set PATH
7076
run: |
7177
echo "%USERPROFILE%\.cargo\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8

0 commit comments

Comments
 (0)