-
-
Notifications
You must be signed in to change notification settings - Fork 34.6k
meta: do not set a version string for cache entries of shared build workflows #61640
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
base: main
Are you sure you want to change the base?
Conversation
|
Review requested:
|
targos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I don't think this will actually have an impact. Builds are too different.
I have no idea how sccache works, but for ccache (used in Jenkins) sharing cache between shared and non-shared builds doesn't give any benefits because the arguments passed to the compiler/linker are different. If anything this will probably end up causing earlier eviction of cache entries that could have been reused. |
This will cause one-time invalidation of the shared build cache, for sure. Beyond that, it should be zero-impact at worst. |
I meant that if sccache is like ccache, then sharing the cache would lead to, e.g.
|
Probably poor nomenclature on my part – the cache storage itself (including any eviction limits) is shared between all our GHA builds irrespective of the version field in the entries, the version field is just metadata on the GHA storage side that enforces a cache miss on mismatch even if the keys match. So, shared and non-shared builds are currently guaranteed not to retrieve cache artifacts from the other – which will likely not change much, granted, but there's no real downside to this change either. |
meta: use SCCACHE_GHA_ENABLED for shared build workflows
The test-shared workflow currently sets
SCCACHE_GHA_VERSION=on; while this (non-canonically) enables the GHA cache, it also appends "-on" to the version tag of every uploaded cache entry, which prevents any cache entries from being shared with the non-shared workflows. Using the canonicalSCCACHE_GHA_ENABLEDdoesn't overwrite the version string, which means that shared and non-shared builds can share cache hits where available.