From 6b73354a2d21e55629215a64b25324a813d17186 Mon Sep 17 00:00:00 2001 From: ScriptedAlchemy Date: Thu, 15 Oct 2026 10:24:21 +0000 Subject: [PATCH 1/2] ci: fetch git-pinned crates shallowly in the splice crate_universe clones every git dependency's full history into an empty CARGO_HOME on each splice; asupersync alone is about 1 GB. Cargo's shallow-deps fetch takes only the pinned commits. The splice runs the stable host cargo, so RUSTC_BOOTSTRAP lets it read the unstable option. Cold `bazel build --config=ci //:rustfmt_check` locally: 417 s and 364 s before, 75 s and 76 s after. The generated @c hub is byte-identical. With the fetch cheap again, restore the 15-minute Repository gates limit that #4017 raised to 30. --- .bazelrc | 12 +++++++++--- .github/workflows/ci.yml | 5 +---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.bazelrc b/.bazelrc index 05f620c612..d5dad2b6c5 100644 --- a/.bazelrc +++ b/.bazelrc @@ -5,10 +5,16 @@ startup --windows_enable_symlinks common --enable_bzlmod common --announce_rc common --show_progress_rate_limit=15 -# crate_universe re-fetches git dependencies on every splice. libgit2 indexes -# asupersync's ~1 GB history on one thread for over 25 minutes; the git CLI -# indexes it in about 2. +# crate_universe re-fetches git dependencies into an empty CARGO_HOME on every +# splice. libgit2 indexes asupersync's ~1 GB history on one thread for over 25 +# minutes; the git CLI indexes it in about 2. common --repo_env=CARGO_NET_GIT_FETCH_WITH_CLI=true +# Fetch only the pinned commit of each git dependency: 76 MB instead of 1.3 GB, +# and a cold splice drops from about 6 minutes to 1. The splice runs rules_rust's +# stable host cargo, which reads -Z options only under RUSTC_BOOTSTRAP. A nightly +# host cargo would download another 418 MB toolchain on every CI job. +common --repo_env=CARGO_UNSTABLE_GIT=shallow-deps +common --repo_env=RUSTC_BOOTSTRAP=1 # MODULE.bazel registers only nightly/2026-09-27. Without this, rules_rust # resolves the stable channel and the build fails closed. build --@rules_rust//rust/toolchain/channel=nightly diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 78d520bc11..e49a22ea42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -126,10 +126,7 @@ jobs: gates: name: Repository gates runs-on: ubuntu-latest - # The rustfmt build's crate_universe splice clones git-pinned crates from - # scratch. asupersync's full history alone took over 7 minutes on a hosted - # runner, so 15 minutes no longer fits. - timeout-minutes: 30 + timeout-minutes: 15 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: From b7b094fd88ca5bc55022a17d2d1c725c05fb7922 Mon Sep 17 00:00:00 2001 From: ScriptedAlchemy Date: Thu, 15 Oct 2026 10:45:55 +0000 Subject: [PATCH 2/2] ci: keep the 30-minute Repository gates limit The shallow fetch should bring the splice well under 15 minutes, but no CI run has confirmed it yet. Keep #4017's limit until one does. --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e49a22ea42..78d520bc11 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -126,7 +126,10 @@ jobs: gates: name: Repository gates runs-on: ubuntu-latest - timeout-minutes: 15 + # The rustfmt build's crate_universe splice clones git-pinned crates from + # scratch. asupersync's full history alone took over 7 minutes on a hosted + # runner, so 15 minutes no longer fits. + timeout-minutes: 30 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: