From 99a4df7e406475353527cc7772deaad63754ea77 Mon Sep 17 00:00:00 2001 From: rami3l Date: Fri, 31 May 2024 16:56:07 +0800 Subject: [PATCH] ci(windows/gnu): disable `cargo`'s LTO for `mingw` --- .github/workflows/ci.yaml | 22 +++++++++++++++++++ .../windows-builds-template.yaml | 8 +++++++ 2 files changed, 30 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9dddbba189a..f22e36a8d7a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/ci/actions-templates/windows-builds-template.yaml b/ci/actions-templates/windows-builds-template.yaml index abd5e3a89fe..55e421f0157 100644 --- a/ci/actions-templates/windows-builds-template.yaml +++ b/ci/actions-templates/windows-builds-template.yaml @@ -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 @@ -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