Skip to content

armgit / zed

Public Imported from GitHub
0

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.yml
index 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-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 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-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 66bc7f4356a..4279afbcb07 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 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 configuring
diff --git a/tooling/xtask/src/tasks/workflows/steps.rs b/tooling/xtask/src/tasks/workflows/steps.rs
index 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"),
}
}