startup/bootsnap: slim load path cache
This commit is contained in:
parent
78fcf30d1a
commit
329f8c7ca3
@ -32,8 +32,17 @@ if homebrew_bootsnap_enabled
|
|||||||
cache = ENV.fetch("HOMEBREW_CACHE", nil) || ENV.fetch("HOMEBREW_DEFAULT_CACHE", nil)
|
cache = ENV.fetch("HOMEBREW_CACHE", nil) || ENV.fetch("HOMEBREW_DEFAULT_CACHE", nil)
|
||||||
raise "Needs HOMEBREW_CACHE or HOMEBREW_DEFAULT_CACHE!" if cache.nil? || cache.empty?
|
raise "Needs HOMEBREW_CACHE or HOMEBREW_DEFAULT_CACHE!" if cache.nil? || cache.empty?
|
||||||
|
|
||||||
|
# We never do `require "vendor/bundle/ruby/..."` or `require "vendor/portable-ruby/..."`,
|
||||||
|
# so let's slim the cache a bit by excluding them.
|
||||||
|
# Note that gems within `bundle/ruby` will still be cached - these are when directory walking down from above.
|
||||||
|
ignore_directories = [
|
||||||
|
(HOMEBREW_LIBRARY_PATH/"vendor/bundle/ruby").to_s,
|
||||||
|
(HOMEBREW_LIBRARY_PATH/"vendor/portable-ruby").to_s,
|
||||||
|
]
|
||||||
|
|
||||||
Bootsnap.setup(
|
Bootsnap.setup(
|
||||||
cache_dir: cache,
|
cache_dir: cache,
|
||||||
|
ignore_directories: ignore_directories,
|
||||||
load_path_cache: true,
|
load_path_cache: true,
|
||||||
compile_cache_iseq: true,
|
compile_cache_iseq: true,
|
||||||
compile_cache_yaml: true,
|
compile_cache_yaml: true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user