Skip to content

Add remote caching option for build.ps1 #80423

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 2 commits into from
Apr 3, 2025

Conversation

brianmichel
Copy link
Contributor

When setting up sccache we can choose between local disk caching or remote caching via an S3-ish blob storage engine. To allow for backward compatibility for anyone that might be using the existing option for disk caching we leave it place and instead provide a new remote caching option.

This option assumes you've read the sccache documentation for setting up the correct environment variables for telling sccache where to find the bucket and how to authenticate to it.

When setting up sccache we can choose between local disk caching or
remote caching via an S3-ish blob storage engine. To allow for backward
compatibility for anyone that might be using the existing option for
disk caching we leave it place and instead provide a new remote caching
option.

This option assumes you've read the sccache documentation for setting up
the correct environment variables for telling sccache where to find the
bucket and how to authenticate to it.
@brianmichel
Copy link
Contributor Author

cc @compnerd

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

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

I'd rather not use ParameterSet here. You can only have a single parameter set, and I would rather that if we were to use it, it would apply to the pinned toolchain parameters.

What is the advantage to having -EnableRemoteCaching? Why not have a single -EnableCaching and make the user responsible for configuring the cache?

@brianmichel
Copy link
Contributor Author

I'd rather not use ParameterSet here. You can only have a single parameter set, and I would rather that if we were to use it, it would apply to the pinned toolchain parameters.

What is the advantage to having -EnableRemoteCaching? Why not have a single -EnableCaching and make the user responsible for configuring the cache?

@compnerd Could certainly do that! @jeffdav and I were talking and thought that maybe people are using -EnableCaching downstream and assume a specific behavior. I'm happy to rewrite those expectations. IMO -EnableCaching probably should have ever only just setup the sccache launchers in CMake. We defaulted to backward compatibility because that is the Windows way, lmk if you think it's okay to just reset expectations of EnableCaching!

@compnerd
Copy link
Member

compnerd commented Apr 1, 2025

The expected behavior AFAIK is that -EnableCaching will use sccache. The configuration of sccache itself however is beyond the scope of build.ps1.

EnableCaching should only configure cmake to allow for sccache usage, it
should not configure sccache itself in any way. Those configuration
options should be deferred into the environment variables that sccache
will look for when it starts up.
@brianmichel brianmichel requested a review from compnerd April 1, 2025 15:14
Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

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

I think that this makes sense.

@compnerd
Copy link
Member

compnerd commented Apr 1, 2025

@swift-ci please smoke test

@compnerd compnerd merged commit f3a7694 into swiftlang:main Apr 3, 2025
3 checks passed
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.

2 participants