Repository navigation
ci(rust): Cache cargo builds for clippy and Rust tests, drop unused protoc - #8593
Merged
Merged
Conversation
joshuarli
approved these changes
Oct 22, 2026
joshuarli
marked this pull request as ready for review
October 22, 2026 23:43
…rotoc Co-Authored-By: Joshua Li <joshua.li@sentry.io> Co-Authored-By: Elio Di Nino <52972357+ElioDiNino@users.noreply.github.com>
sentry-junior
Bot
force-pushed
the
ci/rust-build-cache
branch
from
October 24, 2026 00:48
667daee to
895b1cc
Compare
ElioDiNino
approved these changes
Oct 24, 2026
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.
Both Rust jobs compile the full dependency tree from scratch on every run.
Rust tests (
test_rustlane). The CI image only contains the release wheel, socargo testrebuilds the test profile every time. In this run the build took 2m05s and the 191 tests ran in 2.8s.The job now restores a dedicated target dir and bind-mounts it at
rust_snuba/targetinside the container:snuba-cidon't download it.Cargo.lock. On aCargo.lockchange, the job falls back to the newest cache for the same compiler.CARGO_INCREMENTAL=0keeps the cached dir smaller. Incremental state doesn't help a fresh checkout.Measured locally with the current master
snuba-ciimage (4 cores):testprofile buildrust_snuba/srctouched (like a fresh image)All 191 tests still run.
Clippy (
Linting - Rust). AddsSwatinem/rust-cache(already used across getsentry/relay), saving on master only. Clippy spent about 113s compiling in this run.protoc removed from
Linting - Rust.setup-protocwithout a pinned version queries GitHub for the latest23.xrelease on every run. That lookup has failed jobs (1, 2). Nothing inrust_snuba/Cargo.lockruns protoc at build time: there's noprost-build,tonic-build, orprotobuf-src, andsentry_protosships generated code. I confirmedcargo check --workspace --all-targets --lockedpasses inside the CI image after deletingprotoc. If you'd rather keep it, pinningversion: "23.4"also avoids the lookup.Cargo still evaluates the current checkout on every run; the cache only skips recompiling unchanged crates.
via Joshua Li.
--
View Junior Session in Sentry