Use Bootsnap compiler namespaces for hook caches - #5
Merged
Conversation
Bootsnap 1.24 adds a namespace to each compiler cache. Require Hooks now wraps the selected compiler for hooked paths and uses the hook configuration hash as its namespace. This avoids changes to the process-wide cache directory. Older Bootsnap versions use the fetch cache_dir argument instead. Preserve prior compiler selectors and add regression coverage. Fixes ruby-next#3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of this pull request?
Fixes #3.
#2 isolates transformed ISeq entries through changes to
Bootsnap::CompileCache::ISeq.cache_dir.The Bootsnap getter returns a path with the
-iseqsuffix. The setterappends that suffix again. Cache directory restoration can therefore
corrupt the process-wide path.
Bootsnap 1.24 introduced per-compiler cache namespaces in
rails/bootsnap#535.
This pull request uses that API and leaves the global cache directory
unchanged.
What changes did you make? (overview)
fetchcache_dirargument.Is there anything you'd like reviewers to focus on?
Please review the composition with existing Bootsnap compiler selectors.
Please also review the fallback for Bootsnap versions before 1.24.
Verification
bundle exec bin/mspec: 300 examples and 964 expectations passed.Checklist