Skip to content

Conversation

mukilan
Copy link
Member

@mukilan mukilan commented May 21, 2024

This was previously disabled in #30508 due to sccache not working well with crown. The sccache issue (mozilla/sccache#861) linked in that PR is now closed and testing on my fork also seems to indicated we should be able to turn on sccache again.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes do not require tests because they only modify CI build configuration.

This was previously disabled in servo#30508 due to sccache not
working well with crown. The sccache issue (mozilla/sccache#861)
linked in that PR is now closed and [testing][1] on my fork also
seems to indicated we should be able to turn on sccache again.

[1]: https://github.com/mukilan/servo/actions/runs/9154196647

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
@mukilan mukilan requested a review from sagudev May 21, 2024 05:36
Copy link
Member

@sagudev sagudev left a comment

Choose a reason for hiding this comment

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

I completely forgot about it (and I helped to fix sccache, but it wasn't released yet)

IIRC sccache wasn't working on windows before, but maybe it works now? We could try it in followup.

@mukilan mukilan added this pull request to the merge queue May 21, 2024
@nicoburns
Copy link
Contributor

Out of interest, where is the cache data stored?

@sagudev
Copy link
Member

sagudev commented May 21, 2024

Out of interest, where is the cache data stored?

GitHub runners have special cached artifacts that can be used across runs: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows

@nicoburns
Copy link
Contributor

Do we not run into this:

GitHub will remove any cache entries that have not been accessed in over 7 days. There is no limit on the number of caches you can store, but the total size of all caches in a repository is limited to 10 GB. Once a repository has reached its maximum cache storage, the cache eviction policy will create space by deleting the oldest caches in the repository.

Most Rust repos I'm involved in are using https://github.com/Swatinem/rust-cache (sccache may well be better for Servo's use case), but my Servo target directory very quickly exceeds 10GB and I would imagine this would happen especially quickly with multiple PRs compiling different versions of the code. Perhaps using artifacts rather than the built-in caching works around this?

Merged via the queue into servo:main with commit 1bcb478 May 21, 2024
@mukilan mukilan deleted the enable-sccache-for-rust-compilation branch May 21, 2024 10:20
@mukilan
Copy link
Member Author

mukilan commented May 21, 2024

my Servo target directory very quickly exceeds 10GB and I would imagine this would happen especially quickly with multiple PRs compiling different versions of the code.

From what I understand, sscache caches each compilation artifact individually, as separate entries in the Action cache, so hopefully there is still some sharing even in the presence of multiple versions of code.

That said, Swatinem/rust-cache or artifact based cache is also something we can explore. rust-cache seems to support caching the cargo registry which could be complimentary to sccache.

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