Skip to content

Allow PR builds to read sccache entries from S3 #141948

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

Closed
wants to merge 1 commit into from

Conversation

Kobzol
Copy link
Contributor

@Kobzol Kobzol commented Jun 3, 2025

Should be useful especially after #136942. The option is documented here.

r? @marcoieni

@Kobzol
Copy link
Contributor Author

Kobzol commented Jun 3, 2025

Looks like it works. It can be landed separately from #136942.

@Kobzol Kobzol marked this pull request as ready for review June 3, 2025 07:52
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 3, 2025
@@ -235,6 +235,8 @@ jobs:
env:
AWS_ACCESS_KEY_ID: ${{ secrets.CACHES_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.CACHES_AWS_SECRET_ACCESS_KEY }}
# Allow reading (but not writing) sccache on PR builds
SCCACHE_S3_NO_CREDENTIALS: ${{ (needs.calculate_matrix.outputs.run_type == 'pr' && '1') || '0' }}
Copy link
Member

Choose a reason for hiding this comment

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

aren't we already setting this in

args="$args --env SCCACHE_S3_NO_CREDENTIALS=1"
?

If there's a reason why we need to set it also here, feel free to r=me

Copy link
Contributor Author

Choose a reason for hiding this comment

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

LOL. I was thinking to myself that this all sounded familiar. I was checking some jobs and the cache didn't have any hits, but now I checked the rest and there were some hits, so I just checked it wrong before 🤦

This PR would also make it work for non-Linux hosts, but we don't have those on PR builds anyway.

Good find!

@Kobzol Kobzol closed this Jun 3, 2025
bors added a commit that referenced this pull request Jun 3, 2025
Use ccache for stage0 tool builds

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`
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Jun 5, 2025
Use ccache for stage0 tool builds

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 rust-lang/rust#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`
lnicola pushed a commit to lnicola/rust-analyzer that referenced this pull request Jun 9, 2025
Use ccache for stage0 tool builds

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 rust-lang/rust#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`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants