From 91c7b84774e3c8519076657ba44f8a8649c29dd2 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Tue, 1 Sep 2026 21:20:46 +0000 Subject: [PATCH] Download wasi-sdk before cleaning the target directory (#63579) Fix flacks like https://github.com/zed-industries/zed/actions/runs/33546906778/job/99987145940?pr=63573 `test_extension_store_with_test_extension` gives the extension builder `target` as its cache at `crates/extension_host/src/extension_store_test.rs:801`. `install_dev_extension` performs a real extension and grammar build at `crates/extension_host/src/extension_host.rs:1139`. When `target/wasi-sdk` is absent (e.g. after `target/` cleanup), the builder downloads and extracts it at `crates/extension/src/extension_builder.rs:511`. In the failed run, downloading and extracting the SDK consumed 59 seconds, grammar compilation began at 60 seconds, and the timeout fired immediately. Release Notes: - N/A --- .github/workflows/release.yml | 6 ++++-- .github/workflows/release_nightly.yml | 4 ++-- .github/workflows/run_tests.yml | 6 ++++-- tooling/xtask/src/tasks/workflows/run_tests.rs | 11 +++++++---- tooling/xtask/src/tasks/workflows/steps.rs | 2 +- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0e59362fdd..037bc5bda5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,6 +40,8 @@ jobs: tool: nextest - name: steps::clear_target_dir_if_large run: ./script/clear-target-dir-if-larger-than 350 200 + - name: steps::download_wasi_sdk + run: ./script/download-wasi-sdk - name: steps::setup_sccache run: ./script/setup-sccache env: @@ -78,8 +80,6 @@ jobs: path: ~/.rustup - name: steps::setup_linux run: ./script/linux - - name: steps::download_wasi_sdk - run: ./script/download-wasi-sdk - name: steps::setup_node uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e with: @@ -92,6 +92,8 @@ jobs: tool: nextest - name: steps::clear_target_dir_if_large run: ./script/clear-target-dir-if-larger-than 350 200 + - name: steps::download_wasi_sdk + run: ./script/download-wasi-sdk - name: steps::setup_sccache run: ./script/setup-sccache env: diff --git a/.github/workflows/release_nightly.yml b/.github/workflows/release_nightly.yml index 75f5708fe1..45cc17f970 100644 --- a/.github/workflows/release_nightly.yml +++ b/.github/workflows/release_nightly.yml @@ -57,8 +57,6 @@ jobs: path: ~/.rustup - name: steps::setup_linux run: ./script/linux - - name: steps::download_wasi_sdk - run: ./script/download-wasi-sdk - name: steps::setup_node uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e with: @@ -71,6 +69,8 @@ jobs: tool: nextest - name: steps::clear_target_dir_if_large run: ./script/clear-target-dir-if-larger-than 350 200 + - name: steps::download_wasi_sdk + run: ./script/download-wasi-sdk - name: steps::setup_sccache run: ./script/setup-sccache env: diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index d5b96c7615..bf7b83a7bf 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -394,8 +394,6 @@ jobs: path: ~/.rustup - name: steps::setup_linux run: ./script/linux - - name: steps::download_wasi_sdk - run: ./script/download-wasi-sdk - name: steps::setup_node uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e with: @@ -408,6 +406,8 @@ jobs: tool: nextest - name: steps::clear_target_dir_if_large run: ./script/clear-target-dir-if-larger-than 350 200 + - name: steps::download_wasi_sdk + run: ./script/download-wasi-sdk - name: steps::setup_sccache run: ./script/setup-sccache env: @@ -463,6 +463,8 @@ jobs: tool: nextest - name: steps::clear_target_dir_if_large run: ./script/clear-target-dir-if-larger-than 350 200 + - name: steps::download_wasi_sdk + run: ./script/download-wasi-sdk - name: steps::setup_sccache run: ./script/setup-sccache env: diff --git a/tooling/xtask/src/tasks/workflows/run_tests.rs b/tooling/xtask/src/tasks/workflows/run_tests.rs index ce44c05fc4..68470fe799 100644 --- a/tooling/xtask/src/tasks/workflows/run_tests.rs +++ b/tooling/xtask/src/tasks/workflows/run_tests.rs @@ -626,16 +626,19 @@ fn run_platform_tests_impl(platform: Platform, filter_packages: bool, harden: bo .when(platform == Platform::Linux, |this| { use_clang(this.add_step(steps::cache_rust_dependencies_namespace())) }) - .when( - platform == Platform::Linux, - steps::install_linux_dependencies, - ) + .when(platform == Platform::Linux, |job| { + job.add_step(steps::setup_linux()) + }) .add_step(steps::setup_node()) .when( platform == Platform::Linux || platform == Platform::Mac, |job| job.add_step(steps::cargo_install_nextest()), ) .add_step(steps::clear_target_dir_if_large(platform)) + .when( + platform == Platform::Linux || platform == Platform::Mac, + |job| job.add_step(steps::download_wasi_sdk()), + ) .add_step(steps::setup_sccache(platform)) .when(filter_packages, |job| { job.add_step( diff --git a/tooling/xtask/src/tasks/workflows/steps.rs b/tooling/xtask/src/tasks/workflows/steps.rs index 754995d9cb..d60a411966 100644 --- a/tooling/xtask/src/tasks/workflows/steps.rs +++ b/tooling/xtask/src/tasks/workflows/steps.rs @@ -322,7 +322,7 @@ pub fn setup_linux() -> Step { named::bash("./script/linux") } -fn download_wasi_sdk() -> Step { +pub(crate) fn download_wasi_sdk() -> Step { named::bash("./script/download-wasi-sdk") }