Skip to content
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

Use mozilla-actions/sccache-action for caching builds #411

Merged
merged 4 commits into from
Aug 13, 2024

Conversation

ulyssa
Copy link
Contributor

@ulyssa ulyssa commented Jul 26, 2024

There seems to be something weird with with how we're using the GitHub Action cache that both @kpfleming and I have hit today that's breaking the test CI. I've had a good experience using mozilla-actions/sccache-action elsewhere, so I've made this PR to try out using it instead of saving and restoring the target/ directories. I've adjusted actions/cache to only save ~/.cargo/registry.

@ulyssa ulyssa force-pushed the ulyssa/use-sccache-action branch from 4f09441 to ca4f63a Compare July 26, 2024 21:15
@ulyssa
Copy link
Contributor Author

ulyssa commented Jul 26, 2024

I ran the GitHub Action initially here, and then pushed a commit with an amended timestamp to get a new SHA so that it would run again using the cache it had created.

That re-ran here, but hit what looks like a test flake on macos-13 in cli/tests/integration/async_io.rs. I reran the job here.

The first initial run reported a total duration of 17m 54s, and the third run took 13m 58s. The "Post Run sccache-cache" step prints out stats about reuse. For example:

2024-07-26T21:37:43.6188195Z [command]/opt/hostedtoolcache/sccache/0.8.1/x64/sccache --show-stats --stats-format=json
2024-07-26T21:37:43.6221189Z {"stats":{"compile_requests":596,"requests_unsupported_compiler":0,"requests_not_compile":3,"requests_not_cacheable":171,"requests_executed":422,"cache_errors":{"counts":{},"adv_counts":{}},"cache_hits":{"counts":{"Rust":238,"C/C++":42},"adv_counts":{"rust":238,"c [gcc]":42}},"cache_misses":{"counts":{"Rust":130,"C/C++":2},"adv_counts":{"c [gcc]":2,"rust":130}},"cache_timeouts":0,"cache_read_errors":0,"non_cacheable_compilations":0,"forced_recaches":0,"cache_write_errors":125,"cache_writes":7,"cache_write_duration":{"secs":4,"nanos":367548795},"cache_read_hit_duration":{"secs":110,"nanos":338469583},"compiler_write_duration":{"secs":332,"nanos":92611740},"compile_fails":10,"not_cached":{"-":36,"unknown source language":14,"incremental":4,"missing input":4,"crate-type":113},"dist_compiles":{},"dist_errors":0},"cache_location":"ghac, name: sccache-v0.8.1, prefix: /sccache/","cache_size":null,"max_cache_size":null,"use_preprocessor_cache_mode":false,"version":"0.8.1"}
2024-07-26T21:37:43.6225285Z ##[endgroup]
2024-07-26T21:37:43.6254045Z ##[notice]68% - 280 hits, 132 misses, 0 errors
2024-07-26T21:37:43.6261380Z 
2024-07-26T21:37:43.6261607Z Full human-readable stats:
2024-07-26T21:37:43.6261963Z Compile requests                    596
2024-07-26T21:37:43.6262315Z Compile requests executed           422
2024-07-26T21:37:43.6262634Z Cache hits                          280
2024-07-26T21:37:43.6262954Z Cache hits (C/C++)                   42
2024-07-26T21:37:43.6263513Z Cache hits (Rust)                   238
2024-07-26T21:37:43.6263833Z Cache misses                        132
2024-07-26T21:37:43.6264143Z Cache misses (C/C++)                  2
2024-07-26T21:37:43.6264447Z Cache misses (Rust)                 130
2024-07-26T21:37:43.6264766Z Cache timeouts                        0
2024-07-26T21:37:43.6265083Z Cache read errors                     0
2024-07-26T21:37:43.6265410Z Forced recaches                       0
2024-07-26T21:37:43.6265734Z Cache write errors                  125
2024-07-26T21:37:43.6266053Z Compilation failures                 10
2024-07-26T21:37:43.6266379Z Cache errors                          0
2024-07-26T21:37:43.6266752Z Non-cacheable compilations            0
2024-07-26T21:37:43.6267130Z Non-cacheable calls                 171
2024-07-26T21:37:43.6267489Z Non-compilation calls                 3
2024-07-26T21:37:43.6267821Z Unsupported compiler calls            0
2024-07-26T21:37:43.6268169Z Average cache write               0.623 s
2024-07-26T21:37:43.6268544Z Average compiler                  2.515 s
2024-07-26T21:37:43.6268898Z Average cache read hit            0.394 s
2024-07-26T21:37:43.6269245Z Failed distributed compilations       0
2024-07-26T21:37:43.6269489Z 
2024-07-26T21:37:43.6269824Z Non-cacheable reasons:
2024-07-26T21:37:43.6270153Z crate-type                          113
2024-07-26T21:37:43.6270508Z -                                    36
2024-07-26T21:37:43.6270825Z unknown source language              14
2024-07-26T21:37:43.6271144Z missing input                         4
2024-07-26T21:37:43.6271452Z incremental                           4
2024-07-26T21:37:43.6271675Z 
2024-07-26T21:37:43.6271974Z Cache location                  ghac, name: sccache-v0.8.1, prefix: /sccache/
2024-07-26T21:37:43.6272444Z Version (client)                0.8.1

@ulyssa ulyssa marked this pull request as ready for review July 26, 2024 21:47
kpfleming
kpfleming previously approved these changes Jul 29, 2024
.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
Co-authored-by: Kevin P. Fleming <[email protected]>
@ulyssa ulyssa requested a review from kpfleming August 13, 2024 16:40
@ulyssa ulyssa enabled auto-merge (squash) August 13, 2024 16:41
Copy link
Contributor

@elliottt elliottt left a comment

Choose a reason for hiding this comment

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

:shipit:

@ulyssa ulyssa merged commit 9a2e8fe into main Aug 13, 2024
15 checks passed
@ulyssa ulyssa deleted the ulyssa/use-sccache-action branch August 13, 2024 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants