Skip to content

Commit

Permalink
ci(windows/gnu): disable cargo's LTO for mingw
Browse files Browse the repository at this point in the history
  • Loading branch information
rami3l committed May 31, 2024
1 parent 0011afb commit 99a4df7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
run_tests: YES
- target: x86_64-pc-windows-gnu
mingwdir: mingw64
lto: off
steps:
- uses: actions/checkout@v4
# v2 defaults to a shallow checkout, but we need at least to the previous tag
Expand All @@ -60,6 +61,12 @@ jobs:
if: matrix.mingwdir != ''
run: |
choco install mingw -y --no-progress
- name: Disable cargo's LTO for mingw
shell: powershell
if: matrix.mingwdir != ''
run: |
echo "CARGO_PROFILE_DEBUG_LTO=${{ matrix.lto }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
echo "CARGO_PROFILE_RELEASE_LTO=${{ matrix.lto }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
- name: Set PATH
run: |
echo "%USERPROFILE%\.cargo\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
Expand Down Expand Up @@ -172,6 +179,7 @@ jobs:
run_tests: YES
- target: x86_64-pc-windows-gnu
mingwdir: mingw64
lto: off
steps:
- uses: actions/checkout@v4
# v2 defaults to a shallow checkout, but we need at least to the previous tag
Expand All @@ -194,6 +202,12 @@ jobs:
if: matrix.mingwdir != ''
run: |
choco install mingw -y --no-progress
- name: Disable cargo's LTO for mingw
shell: powershell
if: matrix.mingwdir != ''
run: |
echo "CARGO_PROFILE_DEBUG_LTO=${{ matrix.lto }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
echo "CARGO_PROFILE_RELEASE_LTO=${{ matrix.lto }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
- name: Set PATH
run: |
echo "%USERPROFILE%\.cargo\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
Expand Down Expand Up @@ -308,8 +322,10 @@ jobs:
run_tests: YES
- target: x86_64-pc-windows-gnu
mingwdir: mingw64
lto: off
- target: i686-pc-windows-gnu # skip-pr skip-master
mingwdir: mingw32 # skip-pr skip-master
lto: off # skip-pr skip-master
steps:
- uses: actions/checkout@v4
# v2 defaults to a shallow checkout, but we need at least to the previous tag
Expand All @@ -332,6 +348,12 @@ jobs:
if: matrix.mingwdir != ''
run: |
choco install mingw -y --no-progress
- name: Disable cargo's LTO for mingw
shell: powershell
if: matrix.mingwdir != ''
run: |
echo "CARGO_PROFILE_DEBUG_LTO=${{ matrix.lto }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
echo "CARGO_PROFILE_RELEASE_LTO=${{ matrix.lto }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
- name: Set PATH
run: |
echo "%USERPROFILE%\.cargo\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
Expand Down
8 changes: 8 additions & 0 deletions ci/actions-templates/windows-builds-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ jobs: # skip-master skip-pr skip-stable
run_tests: YES
- target: x86_64-pc-windows-gnu
mingwdir: mingw64
lto: off
- target: i686-pc-windows-gnu # skip-pr skip-master
mingwdir: mingw32 # skip-pr skip-master
lto: off # skip-pr skip-master
steps:
- uses: actions/checkout@v4
# v2 defaults to a shallow checkout, but we need at least to the previous tag
Expand All @@ -52,6 +54,12 @@ jobs: # skip-master skip-pr skip-stable
if: matrix.mingwdir != ''
run: |
choco install mingw -y --no-progress
- name: Disable cargo's LTO for mingw
shell: powershell
if: matrix.mingwdir != ''
run: |
echo "CARGO_PROFILE_DEBUG_LTO=${{ matrix.lto }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
echo "CARGO_PROFILE_RELEASE_LTO=${{ matrix.lto }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
- name: Set PATH
run: |
echo "%USERPROFILE%\.cargo\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
Expand Down

0 comments on commit 99a4df7

Please sign in to comment.