Skip to content

Commit 99a4df7

Browse files
committed
ci(windows/gnu): disable cargo's LTO for mingw
1 parent 0011afb commit 99a4df7

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
run_tests: YES
3939
- target: x86_64-pc-windows-gnu
4040
mingwdir: mingw64
41+
lto: off
4142
steps:
4243
- uses: actions/checkout@v4
4344
# v2 defaults to a shallow checkout, but we need at least to the previous tag
@@ -60,6 +61,12 @@ jobs:
6061
if: matrix.mingwdir != ''
6162
run: |
6263
choco install mingw -y --no-progress
64+
- name: Disable cargo's LTO for mingw
65+
shell: powershell
66+
if: matrix.mingwdir != ''
67+
run: |
68+
echo "CARGO_PROFILE_DEBUG_LTO=${{ matrix.lto }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
69+
echo "CARGO_PROFILE_RELEASE_LTO=${{ matrix.lto }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
6370
- name: Set PATH
6471
run: |
6572
echo "%USERPROFILE%\.cargo\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
@@ -172,6 +179,7 @@ jobs:
172179
run_tests: YES
173180
- target: x86_64-pc-windows-gnu
174181
mingwdir: mingw64
182+
lto: off
175183
steps:
176184
- uses: actions/checkout@v4
177185
# v2 defaults to a shallow checkout, but we need at least to the previous tag
@@ -194,6 +202,12 @@ jobs:
194202
if: matrix.mingwdir != ''
195203
run: |
196204
choco install mingw -y --no-progress
205+
- name: Disable cargo's LTO for mingw
206+
shell: powershell
207+
if: matrix.mingwdir != ''
208+
run: |
209+
echo "CARGO_PROFILE_DEBUG_LTO=${{ matrix.lto }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
210+
echo "CARGO_PROFILE_RELEASE_LTO=${{ matrix.lto }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
197211
- name: Set PATH
198212
run: |
199213
echo "%USERPROFILE%\.cargo\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
@@ -308,8 +322,10 @@ jobs:
308322
run_tests: YES
309323
- target: x86_64-pc-windows-gnu
310324
mingwdir: mingw64
325+
lto: off
311326
- target: i686-pc-windows-gnu # skip-pr skip-master
312327
mingwdir: mingw32 # skip-pr skip-master
328+
lto: off # skip-pr skip-master
313329
steps:
314330
- uses: actions/checkout@v4
315331
# v2 defaults to a shallow checkout, but we need at least to the previous tag
@@ -332,6 +348,12 @@ jobs:
332348
if: matrix.mingwdir != ''
333349
run: |
334350
choco install mingw -y --no-progress
351+
- name: Disable cargo's LTO for mingw
352+
shell: powershell
353+
if: matrix.mingwdir != ''
354+
run: |
355+
echo "CARGO_PROFILE_DEBUG_LTO=${{ matrix.lto }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
356+
echo "CARGO_PROFILE_RELEASE_LTO=${{ matrix.lto }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
335357
- name: Set PATH
336358
run: |
337359
echo "%USERPROFILE%\.cargo\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ jobs: # skip-master skip-pr skip-stable
2828
run_tests: YES
2929
- target: x86_64-pc-windows-gnu
3030
mingwdir: mingw64
31+
lto: off
3132
- target: i686-pc-windows-gnu # skip-pr skip-master
3233
mingwdir: mingw32 # skip-pr skip-master
34+
lto: off # skip-pr skip-master
3335
steps:
3436
- uses: actions/checkout@v4
3537
# v2 defaults to a shallow checkout, but we need at least to the previous tag
@@ -52,6 +54,12 @@ jobs: # skip-master skip-pr skip-stable
5254
if: matrix.mingwdir != ''
5355
run: |
5456
choco install mingw -y --no-progress
57+
- name: Disable cargo's LTO for mingw
58+
shell: powershell
59+
if: matrix.mingwdir != ''
60+
run: |
61+
echo "CARGO_PROFILE_DEBUG_LTO=${{ matrix.lto }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
62+
echo "CARGO_PROFILE_RELEASE_LTO=${{ matrix.lto }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
5563
- name: Set PATH
5664
run: |
5765
echo "%USERPROFILE%\.cargo\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8

0 commit comments

Comments
 (0)