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

Add bootsnap handling for installs and upgrades #492

Open
jrafanie opened this issue Sep 5, 2024 · 0 comments
Open

Add bootsnap handling for installs and upgrades #492

jrafanie opened this issue Sep 5, 2024 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@jrafanie
Copy link
Member

jrafanie commented Sep 5, 2024

Like we do for the descendant loader for single table inheritance support and pre-compiling assets, I believe we need to handle how bootsnap works.

Bootsnap was added in najdorf and handles optimizing loading for ruby files. By default our gems are considered stable and not going to change:

The only directories considered "stable" are things under the Ruby install prefix (RbConfig::CONFIG['prefix'], e.g. /usr/local/ruby or ~/.rubies/x.y.z), and things under the Gem.path (e.g. ~/.gem/ruby/x.y.z) or Bundler.bundle_path. Everything else is considered "volatile".

From: https://github.com/Shopify/bootsnap?tab=readme-ov-file#path-pre-scanning

It doesn't look like we currently ship a bootsnap cache, so in production, I believe it will be built on first usage. If this is the case, it's possible any of these caches in locations considered "stable", such as our engine gems, could be changed in a rpm update but the bootsnap cache may be not cleared.

It sounds like they suggest to remove the cache directory whenever you want to rebuild the cache, so perhaps that should be done as part of the build and an rpm upgrade should know to clear the existing cache before installing the new files containing the new cache.

@jrafanie jrafanie added enhancement New feature or request help wanted Extra attention is needed labels Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant