Skip to content

Use ccache for stage0 tool builds #136942

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2025
Merged

Conversation

Kobzol
Copy link
Contributor

@Kobzol Kobzol commented Feb 12, 2025

Now after the stage0 redesign, we can actually start ccaching the build of the compiler itself. We can also cache the bootstrap tools, since these are also built with the stage0 compiler.

Stage0 compiler builds are now being cached: https://github.com/rust-lang/rust/actions/runs/15397246267#summary-43321151192 (..bootstrap::core::build_steps::compile::Rustc 483.10s 40.41s -91.6%). It's not a gigantic win everywhere, but it should help. It seems to make the Linux jobs ~10 minute faster. It should be especially useful on PR builds after #141948.

r? @jieyouxu

try-job: x86_64-gnu-llvm-19*
try-job: x86_64-msvc*
try-job: x86_64-apple*
try-job: dist-x86_64-linux

@Kobzol
Copy link
Contributor Author

Kobzol commented Feb 12, 2025

@bors try

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Feb 12, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 12, 2025
Use ccache for stage0 tool builds

r? `@ghost`
@bors
Copy link
Collaborator

bors commented Feb 12, 2025

⌛ Trying commit 344800b with merge f0a58be...

@bors
Copy link
Collaborator

bors commented Feb 12, 2025

☀️ Try build successful - checks-actions
Build commit: f0a58be (f0a58bea3b65287ec3ea74e2bc2e2f3597d8daa7)

@Kobzol
Copy link
Contributor Author

Kobzol commented Feb 12, 2025

@bors try

@bors
Copy link
Collaborator

bors commented Feb 12, 2025

⌛ Trying commit 344800b with merge ed2acf1...

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 12, 2025
Use ccache for stage0 tool builds

r? `@ghost`
@bors
Copy link
Collaborator

bors commented Feb 12, 2025

☀️ Try build successful - checks-actions
Build commit: ed2acf1 (ed2acf1d5f29a81765ba5f0f28eaaa5d320e23ae)

@Kobzol
Copy link
Contributor Author

Kobzol commented Feb 13, 2025

@bors try

@bors
Copy link
Collaborator

bors commented Feb 13, 2025

⌛ Trying commit 52d0743 with merge 27f776f...

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 13, 2025
Use ccache for stage0 tool builds

r? `@ghost`
@Kobzol
Copy link
Contributor Author

Kobzol commented Feb 13, 2025

Looks like this will need a newer version of sccache, testing in a different PR.

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Feb 13, 2025
@Kobzol
Copy link
Contributor Author

Kobzol commented Feb 13, 2025

@bors try

@bors
Copy link
Collaborator

bors commented Feb 13, 2025

⌛ Trying commit d3d174f with merge 541316a...

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 13, 2025
Use ccache for stage0 tool builds

r? `@ghost`
@bors
Copy link
Collaborator

bors commented Feb 13, 2025

☀️ Try build successful - checks-actions
Build commit: 541316a (541316a5d6389f6ec6b88bd91423d9cfa3cdecb5)

@Kobzol
Copy link
Contributor Author

Kobzol commented Feb 13, 2025

@bors try

@bors
Copy link
Collaborator

bors commented Feb 13, 2025

⌛ Trying commit d3d174f with merge 5a084bf...

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 13, 2025
Use ccache for stage0 tool builds

r? `@ghost`
@bors
Copy link
Collaborator

bors commented Feb 13, 2025

☀️ Try build successful - checks-actions
Build commit: 5a084bf (5a084bff49c0e13d013f66731bd3c9412aa3ef27)

@Kobzol
Copy link
Contributor Author

Kobzol commented Feb 13, 2025

@bors try

Full build without Rust sccache.

@bors
Copy link
Collaborator

bors commented Feb 13, 2025

⌛ Trying commit 9aaa9f6 with merge 31c05b8...

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 13, 2025
Use ccache for stage0 tool builds

r? `@ghost`
@bors
Copy link
Collaborator

bors commented Feb 13, 2025

☀️ Try build successful - checks-actions
Build commit: 31c05b8 (31c05b827fb7f21f526972a60e5c87acab7f3c21)

@Kobzol
Copy link
Contributor Author

Kobzol commented Jun 2, 2025

@bors2 try

@rust-bors
Copy link

rust-bors bot commented Jun 2, 2025

⌛ Trying commit 0505ee5 with merge 9e018f5

rust-bors bot added a commit that referenced this pull request Jun 2, 2025
Use ccache for stage0 tool builds

r? `@ghost`

try-job: `x86_64-gnu-llvm-19*`
try-job: `x86_64-msvc*`
try-job: `x86_64-apple*`
try-job: `dist-x86_64-linux`
try-job: `mingw-check-*`
@rust-bors
Copy link

rust-bors bot commented Jun 2, 2025

💔 Test failed

@Kobzol
Copy link
Contributor Author

Kobzol commented Jun 2, 2025

@bors2 try

@rust-bors
Copy link

rust-bors bot commented Jun 2, 2025

⌛ Trying commit 0505ee5 with merge 019d956

rust-bors bot added a commit that referenced this pull request Jun 2, 2025
Use ccache for stage0 tool builds

r? `@ghost`

try-job: `x86_64-gnu-llvm-19*`
try-job: `x86_64-msvc*`
try-job: `x86_64-apple*`
try-job: `dist-x86_64-linux`
@rust-bors
Copy link

rust-bors bot commented Jun 2, 2025

☀️ Try build successful (CI)
Build commit: 019d956 (019d956392e0affd955ae71068fa00c6a2667c89)

@Kobzol
Copy link
Contributor Author

Kobzol commented Jun 2, 2025

@bors2 try

@rust-bors
Copy link

rust-bors bot commented Jun 2, 2025

⌛ Trying commit 0505ee5 with merge 78bd761

rust-bors bot added a commit that referenced this pull request Jun 2, 2025
Use ccache for stage0 tool builds

r? `@ghost`

try-job: `x86_64-gnu-llvm-19*`
try-job: `x86_64-msvc*`
try-job: `x86_64-apple*`
try-job: `dist-x86_64-linux`
@rust-bors
Copy link

rust-bors bot commented Jun 2, 2025

☀️ Try build successful (CI)
Build commit: 78bd761 (78bd7613c58bb259c68a29b9ff47e6bbb71e775a)

@Kobzol Kobzol marked this pull request as ready for review June 3, 2025 06:22
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine, thanks

@jieyouxu
Copy link
Member

jieyouxu commented Jun 3, 2025

@bors r+ rollup=iffy

@bors
Copy link
Collaborator

bors commented Jun 3, 2025

📌 Commit 0505ee5 has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 3, 2025
@bors
Copy link
Collaborator

bors commented Jun 3, 2025

⌛ Testing commit 0505ee5 with merge aae43c4...

@bors
Copy link
Collaborator

bors commented Jun 3, 2025

☀️ Test successful - checks-actions
Approved by: jieyouxu
Pushing aae43c4 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 3, 2025
@bors bors merged commit aae43c4 into rust-lang:master Jun 3, 2025
11 checks passed
@rustbot rustbot added this to the 1.89.0 milestone Jun 3, 2025
Copy link

github-actions bot commented Jun 3, 2025

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 2f17612 (parent) -> aae43c4 (this PR)

Test differences

No test diffs found

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard aae43c4532690153af7465227816c93036bb1604 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. x86_64-apple-2: 5161.8s -> 6338.6s (22.8%)
  2. dist-x86_64-apple: 8649.8s -> 10397.8s (20.2%)
  3. i686-gnu-nopt-2: 6736.8s -> 5394.3s (-19.9%)
  4. dist-ohos-aarch64: 4593.0s -> 5361.3s (16.7%)
  5. mingw-check-1: 2109.7s -> 1796.4s (-14.9%)
  6. dist-apple-various: 7333.7s -> 8351.2s (13.9%)
  7. dist-ohos-x86_64: 4691.8s -> 4043.1s (-13.8%)
  8. x86_64-apple-1: 6848.4s -> 5946.8s (-13.2%)
  9. x86_64-gnu-nopt: 5714.1s -> 5027.8s (-12.0%)
  10. i686-gnu-1: 8229.7s -> 9146.4s (11.1%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@Kobzol Kobzol deleted the stage0-sccache branch June 3, 2025 16:52
@Kobzol
Copy link
Contributor Author

Kobzol commented Jun 3, 2025

PR CI before:
image

PR CI after:
image

The aarch64 GNU jobs don't run on auto builds, so they don't benefit from caching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants