Skip to content

Add bootsnap handling for installs and upgrades #492

@jrafanie

Description

@jrafanie

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions