From 11d812cd87176daed5678aba8e312e8c5e1d91e4 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Wed, 11 Feb 2026 14:40:42 -0700 Subject: [PATCH] Fix sccache --show-stats not working sometimes on windows (#48974) Closes #ISSUE - [ ] Tests or screenshots needed? - [ ] Code Reviewed - [ ] Manual QA Release Notes: - N/A --- .github/workflows/release.yml | 4 ++-- .github/workflows/release_nightly.yml | 4 ++-- .github/workflows/run_tests.yml | 4 ++-- script/setup-sccache.ps1 | 4 ++-- tooling/xtask/src/tasks/workflows/steps.rs | 4 +++- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5e57f92661e97f17b34bb57441670196f6feec88..13cc3e912ad27797c4e5fbe87f3906200323457c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -137,7 +137,7 @@ jobs: run: cargo nextest run --workspace --no-fail-fast shell: pwsh - name: steps::show_sccache_stats - run: sccache --show-stats; exit 0 + run: '& $env:RUSTC_WRAPPER --show-stats; exit 0' shell: pwsh - name: steps::cleanup_cargo_config if: always() @@ -234,7 +234,7 @@ jobs: run: ./script/clippy.ps1 shell: pwsh - name: steps::show_sccache_stats - run: sccache --show-stats; exit 0 + run: '& $env:RUSTC_WRAPPER --show-stats; exit 0' shell: pwsh timeout-minutes: 60 check_scripts: diff --git a/.github/workflows/release_nightly.yml b/.github/workflows/release_nightly.yml index 1cdc1d38b18fc1996e0c0339b545f4beee137b58..916b7078bc79b3dfe691ecf5b2c998e7fa155d50 100644 --- a/.github/workflows/release_nightly.yml +++ b/.github/workflows/release_nightly.yml @@ -57,7 +57,7 @@ jobs: run: cargo nextest run --workspace --no-fail-fast shell: pwsh - name: steps::show_sccache_stats - run: sccache --show-stats; exit 0 + run: '& $env:RUSTC_WRAPPER --show-stats; exit 0' shell: pwsh - name: steps::cleanup_cargo_config if: always() @@ -90,7 +90,7 @@ jobs: run: ./script/clippy.ps1 shell: pwsh - name: steps::show_sccache_stats - run: sccache --show-stats; exit 0 + run: '& $env:RUSTC_WRAPPER --show-stats; exit 0' shell: pwsh timeout-minutes: 60 bundle_linux_aarch64: diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 66bc7f4356a7093089c6a65a8c118f53ce1dd292..4279afbcb0751527a37b591e8d3689d85b5b03c1 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -166,7 +166,7 @@ jobs: run: ./script/clippy.ps1 shell: pwsh - name: steps::show_sccache_stats - run: sccache --show-stats; exit 0 + run: '& $env:RUSTC_WRAPPER --show-stats; exit 0' shell: pwsh timeout-minutes: 60 clippy_linux: @@ -271,7 +271,7 @@ jobs: run: cargo nextest run --workspace --no-fail-fast${{ needs.orchestrate.outputs.changed_packages && format(' -E "{0}"', needs.orchestrate.outputs.changed_packages) || '' }} shell: pwsh - name: steps::show_sccache_stats - run: sccache --show-stats; exit 0 + run: '& $env:RUSTC_WRAPPER --show-stats; exit 0' shell: pwsh - name: steps::cleanup_cargo_config if: always() diff --git a/script/setup-sccache.ps1 b/script/setup-sccache.ps1 index 92a41be6bbdeeea7588c391f41c8006a2e2127ac..cde6dee1d05ea2ac6b06df24e8a2c46f42ba3217 100644 --- a/script/setup-sccache.ps1 +++ b/script/setup-sccache.ps1 @@ -63,8 +63,8 @@ function Install-Sccache { function Configure-Sccache { if (-not $env:R2_ACCOUNT_ID) { - Write-Host "::error::R2_ACCOUNT_ID not set, cannot configure sccache" - exit 1 + Write-Host "R2_ACCOUNT_ID not set, skipping sccache configuration" + return } # Verify sccache is available before configuring diff --git a/tooling/xtask/src/tasks/workflows/steps.rs b/tooling/xtask/src/tasks/workflows/steps.rs index 25348fbc92414a73c4cd00f14122512ce1fa2557..ff0b73b805fcbb83d1f81c303bd4301c0ead6c78 100644 --- a/tooling/xtask/src/tasks/workflows/steps.rs +++ b/tooling/xtask/src/tasks/workflows/steps.rs @@ -170,7 +170,9 @@ pub fn setup_sccache(platform: Platform) -> Step { pub fn show_sccache_stats(platform: Platform) -> Step { match platform { - Platform::Windows => named::pwsh("sccache --show-stats; exit 0"), + // Use $env:RUSTC_WRAPPER (absolute path) because GITHUB_PATH changes + // don't take effect until the next step in PowerShell + Platform::Windows => named::pwsh("& $env:RUSTC_WRAPPER --show-stats; exit 0"), Platform::Linux | Platform::Mac => named::bash("sccache --show-stats || true"), } }