Repository navigation
ci: fetch git-pinned crates shallowly in the splice - #4019
Merged
Merged
Conversation
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.
|
ScriptedAlchemy
enabled auto-merge
October 15, 2026 10:29
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Since #3983 pinned asupersync to a git rev, every CI job's crate_universe splice clones the full history of each git dependency into an empty
CARGO_HOME. asupersync alone is about 1 GB, and the clone ran past 7 minutes on a hosted runner. #4017 raised the Repository gates limit to 30 minutes as a stopgap.Cargo's
shallow-depsgit option fetches only the pinned commit of each git dependency. The splice runs rules_rust's stable host cargo (1.98.0), which ignores unstable options unlessRUSTC_BOOTSTRAP=1is set, so.bazelrcsets both through--repo_env. The mechanism covers every git dependency, so it stays in place after asupersync 0.6.0 reaches crates.io.Scope
.bazelrc: add--repo_env=CARGO_UNSTABLE_GIT=shallow-depsand--repo_env=RUSTC_BOOTSTRAP=1next to the existingCARGO_NET_GIT_FETCH_WITH_CLI..github/workflows/ci.yml: revert ci: give Repository gates room for the git crate fetch #4017. Repository gates goes back totimeout-minutes: 15.Tradeoffs
rust_host_tools.host_tools(version = "nightly/2026-09-27")pluscrate.from_cargo(host_tools = ...)) also works withoutRUSTC_BOOTSTRAP. It downloads a second 418 MB toolchain on every job, because a nightly without pinned checksums never hits the repository cache. Cold build 108 s against 75 s.CARGO_BAZEL_ISOLATED=falseand a sharedCARGO_HOME, and still restores 1.3 GB of history. The shallow fetch is 76 MB.--filter=blob:nonehas no git config that applies to cargo's URL fetches, and cargo checks out with libgit2, which cannot read a partial clone.Blast Radius
The variables reach repository rules and module extensions only, not build actions. The generated
@chub is byte-identical before and after. If the 15-minute limit proves too tight, Repository gates times out and blocks merges until the limit goes back up.Verification
Cold
bazel build --config=ci //:rustfmt_check(expunged output base, noMODULE.bazel.lock): 417 s → 75 s. The splice: 389 s → 62 s. Git databases: 1.3 GB → 76 MB.