Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Fix sccache --show-stats not working sometimes on windows (#48974)
Conrad Irwin11d812cd8717
diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 5e57f92661e..13cc3e912ad 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -137,7 +137,7 @@ jobs:run: cargo nextest run --workspace --no-fail-fastshell: 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_configif: always()@@ -234,7 +234,7 @@ jobs:run: ./script/clippy.ps1shell: pwsh- name: steps::show_sccache_stats- run: sccache --show-stats; exit 0+ run: '& $env:RUSTC_WRAPPER --show-stats; exit 0'shell: pwshtimeout-minutes: 60check_scripts:diff --git a/.github/workflows/release_nightly.yml b/.github/workflows/release_nightly.ymlindex 1cdc1d38b18..916b7078bc7 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-fastshell: 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_configif: always()@@ -90,7 +90,7 @@ jobs:run: ./script/clippy.ps1shell: pwsh- name: steps::show_sccache_stats- run: sccache --show-stats; exit 0+ run: '& $env:RUSTC_WRAPPER --show-stats; exit 0'shell: pwshtimeout-minutes: 60bundle_linux_aarch64:diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.ymlindex 66bc7f4356a..4279afbcb07 100644--- a/.github/workflows/run_tests.yml+++ b/.github/workflows/run_tests.yml@@ -166,7 +166,7 @@ jobs:run: ./script/clippy.ps1shell: pwsh- name: steps::show_sccache_stats- run: sccache --show-stats; exit 0+ run: '& $env:RUSTC_WRAPPER --show-stats; exit 0'shell: pwshtimeout-minutes: 60clippy_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_configif: always()diff --git a/script/setup-sccache.ps1 b/script/setup-sccache.ps1index 92a41be6bbd..cde6dee1d05 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 configuringdiff --git a/tooling/xtask/src/tasks/workflows/steps.rs b/tooling/xtask/src/tasks/workflows/steps.rsindex 25348fbc924..ff0b73b805f 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<Run> {pub fn show_sccache_stats(platform: Platform) -> Step<Run> {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"),}}