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

Invalidate Bootsnap cache on Gemfile.lock changes #18240

Merged
merged 1 commit into from
Sep 4, 2024
Merged

Conversation

Bo98
Copy link
Member

@Bo98 Bo98 commented Sep 4, 2024

The majority of the time, this isn't necessary. Bootsnap builds an incremental cache correctly.

However we get edge cases when a gem shadows a default gem only under certain gem groups and have occasionally had reports of Bootsnap randomly breaking after a while.

Let's just save ourselves the stress and more aggressively version the Bootsnap cache. Now the whole cache is invalidated whenever Gemfile.lock changes or Ruby is updated.

This does in turn have a benefit that brew cleanup is now smarter. Now that we version the cache we don't need to nuke the whole cache every time we run brew cleanup and can now detect what cache is stale and what isn't. As a result, I've now enabled it for periodic brew cleanup.

Probably unblocks at least the LoadError part of #18216.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Makes sense to me, good fix @Bo98!

@MikeMcQuaid MikeMcQuaid merged commit 8bf267c into master Sep 4, 2024
27 checks passed
@MikeMcQuaid MikeMcQuaid deleted the bootsnap-keyed branch September 4, 2024 07:40
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