- Require Ruby 2.7.
- Fix support for absolute paths in
BOOTSNAP_IGNORE_DIRECTORIES.
- Better fix for the
opendircrash. - Add
bootsnap/rakefor cleaning the bootsnap cache as part ofrake clobber.
- Prevent a Ruby crash while scanning load path if
opendirfails without settingerrno. According to the C spec this should not happen, but according to user reports, it did.
- Fix the
requiredecorator to handleBootsnap.unload_cache!being called. - Minor optimization: Eagerly clear cache buffers to appease the GC.
- Handle broken symlinks in load path scanning code.
Should fix
Errno::ENOENT fstatatissues some users have encountered after upgrading to 1.20.0.
- Optimized load path scanning with a C extension. Should be about 2x faster on supported platforms.
- Remove JSON parsing cache. Recent versions of the
jsongem are as fast asmsgpackif not faster.
- Fix cgroup CPU limits detection in CLI.
- Attempt to detect a QEMU bug that can cause
bootsnap precompileto hang forever when building ARM64 docker images from x86_64 machines. See #495. - Improve CLI to detect cgroup CPU limits and avoid spawning too many worker processes.
- Allow using bootsnap without bundler. See #488.
- Fix startup failure if the cache directory points to a broken symlink.
- Fix the cache corruption issue in the revalidation feature. See #474. The cache revalidation feature remains opt-in for now, until it is more battle tested.
- Disable stale cache entries revalidation by default as it seems to cause cache corruption issues. See #471 and #474. Will be re-enabled in a future version once the root cause is identified.
- Fix a potential compilation issue on some systems. See #470.
- Handle
EPERMerrors when opening files withO_NOATIME.
Bootsnap.instrumentationnow receive:hitevents.- Add
Bootsnap.log_stats!to print hit rate statistics on process exit. Can also be enabled withBOOTSNAP_STATS=1. - Revalidate stale cache entries by digesting the source content.
This should significantly improve performance in environments where
mtimeisn't preserved (e.g. CI systems doing a git clone, etc). See #468. - Open source files and cache entries with
O_NOATIMEwhen available to reduce disk accesses. See #469. bootsnap precompile --gemfilenow look for.rbfiles in the whole gem and not just thelib/directory. See #466.
- Fix a compatibility issue with the
prismlibrary that ships with Ruby 3.3. See #463. - Improved the
Kernel#requiredecorator to not cause a method redefinition warning. See #461.
- Ensure
$LOAD_PATH.dupis Ractor shareable to fix a conflict withdid_you_mean. - Allow to ignore directories using absolute paths.
- Support YAML and JSON CompileCache on TruffleRuby.
- Support LoadPathCache on TruffleRuby.
- Use
RbConfig::CONFIG["rubylibdir"]instead ofRbConfig::CONFIG["libdir"]to check for stdlib files. See #431. - Fix the cached version of
YAML.load_filebeing slightly more permissive than the defaultPsychone. See #434.DateandTimevalues are now properly rejected, as well as aliases. If this causes a regression in your application, it is recommended to load trusted YAML files withYAML.unsafe_load_file.
- Add a readonly mode, for environments in which the updated cache wouldn't be persisted. See #428 and #423.
- Require Ruby 2.6.
- Add a way to skip directories during load path scanning.
If you have large non-ruby directories in the middle of your load path, it can severely slow down scanning.
Typically this is a problem with
node_modules. See #277. - Fix
Bootsnap.unload_cache!, it simply wouldn't work at all because of a merge mistake. See #421.
-
Stop decorating
Kernel.load. This used to be very useful in development because the Rails "classic" autoloader was usingKernel.loadin dev andKernel.requirein production. But Zeitwerk is now the default, and it doesn't useKernel.loadat all.People still using the classic autoloader might want to stick to
bootsnap 1.12. -
Add
Bootsnap.unload_cache!. Applications can call it at the end of their boot sequence when they know no more code will be loaded to reclaim a bit of memory.
-
bootsnap precompileCLI will now also precompileRakefileand.rakefiles. -
Stop decorating
Module#autoloadas it was only useful for supporting Ruby 2.2 and older. -
Remove
unameand other platform specific version from the cache keys.RUBY_PLATFORM + RUBY_REVISIONshould be enough to ensure bytecode compatibility. This should improve caching for alpine based setups. See #409.
- Fix the
can't modify frozen Hasherror on load path cache mutation. See #411.
-
Drop dependency on
fileutils. -
Better respect
Kernel#requireduck typing. While it almost never comes up in practice,Kernel#requirefollow a fairly intricate duck-typing protocol on its argument implemented asrb_get_path(VALUE)in MRI. So when applicable we bindrb_get_pathand use it for improved compatibility. See #396 and #406. -
Get rid of the
Kernel.require_relativedecorator by resolving$LOAD_PATHmembers to their real path. This way we handle symlinks in$LOAD_PATHmuch more efficiently. See #402 for the detailed explanation. -
Drop support for Ruby 2.3 (to allow getting rid of the
Kernel.require_relativedecorator).
-
Fix Regexp and Date type support in YAML compile cache. (#400)
-
Improve the YAML compile cache to support
UTF-8symbols. (#398, #399) The defaultMessagePacksymbol serializer assumes all symbols are ASCII, because of this, non-ASCII compatible symbol would be restored withASCII_8BITencoding (AKABINARY). Bootsnap now properly cache them inUTF-8.Note that the above only apply for actual YAML symbols (e..g
--- :foo). The issue is still present for string keys parsed withYAML.load_file(..., symbolize_names: true), that is a bug inmsgpackthat will hopefully be solved soon, see: msgpack/msgpack-ruby#246 -
Entirely disable the YAML compile cache if
Encoding.default_internalis set to an encoding not supported bymsgpack. (#398)Psychcoerce strings toEncoding.default_internal, butMessagePackdoesn't. So in this scenario we can't provide YAML caching at all without returning the strings in the wrong encoding. This never came up in practice but might as well be safe.
-
Reduce the
Kernel.requireextra stack frames some more. Now bootsnap should only add one extra frame perrequirecall. -
Better check
freezeoption support in JSON compile cache. PreviouslyJSON.load_file(..., freeze: true)would be cached even when the msgpack version is missing support for it.
-
Fix
Kernel#autoload's fallback path always being executed. -
Consider
unlinkfailing withENOENTas a success.
-
Delay requiring
FileUtils. (#285)FileUtilscan be installed as a gem, so it's best to wait for bundler to have setup the load path before requiring it. -
Improve support of Psych 4. (#392) Since
1.8.0,YAML.load_filewas no longer cached when Psych 4 was used. This is becauseload_fileloads in safe mode by default, so the Bootsnap cache could defeat that safety. Now when precompiling YAML files, Bootsnap first try to parse them in safe mode, and if it can't fallback to unsafe mode, and the cache contains a flag that records whether it was generated in safe mode or not.YAML.unsafe_load_filewill use safe caches just fine, butYAML.load_filewill fallback to uncached YAML parsing if the cache was generated using unsafe parsing. -
Minimize the Kernel.require extra stack frames. (#393) This should reduce the noise generated by bootsnap on
LoadError.
-
Ignore absolute paths in the loaded feature index. (#385) This fixes a compatibility issue with Zeitwerk when Zeitwerk is loaded before bootsnap. It also should reduce the memory usage and improve load performance of Zeitwerk managed files.
-
Automatically invalidate the load path cache whenever the Ruby version change. (#387) This is to avoid issues in case the same installation path is re-used for subsequent ruby patch releases.
- Only disable the compile cache for source files impacted by Ruby 3.0.3 [Bug 18250]. This should keep the performance loss to a minimum.
- Disable compile cache if Ruby 3.0.3's ISeq cache bug is detected.
AKA
iseq.rb:13 to_binary: wrong argument type false (expected Symbol) - Fix
Kernel.loadbehavior: beforeload 'a'would loada.rb(and other tried extensions) and wouldn't loadaunlessdevelopment_mode: true, now onlyawould be loaded and files with extensions wouldn't be.
- Removed a forgotten debug statement in JSON precompilation.
- Added a compilation cache for
JSON.load_file. (#370)
- Fixed support for older Psych. (#369)
- Improve support for Psych 4. (#368)
- Fix
require_relativein evaled code on latest ruby 3.1.0-dev. (#366)
- Fix reliance on
setto be required. - Fix
Encoding::UndefinedConversionErrorerror for Rails applications when precompiling cache. (#364)
- Handle a regression of Ruby 2.7.3 causing Bootsnap to call the deprecated
untaintmethod. (#360) - Gracefully handle read-only file system as well as other errors preventing to persist the load path cache. (#358)
- Stop raising errors when encountering various file system errors. The cache is now best effort,
if somehow it can't be saved, bootsnap will gracefully fallback to the original operation (e.g.
Kernel.require). (#353, #177, #262)
- Disable YAML precompilation when encountering YAML tags. (#351)
- Fix compatibility with msgpack < 1. (#349)
- Warn Ruby 2.5 users if they turn ISeq caching on. (#327, #244)
- Disable ISeq caching for the whole 2.5.x series again.
- Better handle hashing of Ruby strings. (#318)
- Fix detection of YAML files in gems.
- Adds an instrumentation API to monitor cache misses.
- Allow to control the behavior of
require 'bootsnap/setup'using environment variables. - Deprecate the
disable_traceoption. - Deprecate the
ActiveSupport::Dependencies(AKA Classic autoloader) integration. (#344)
- Fix a Ruby 2.7/3.0 issue with
YAML.load_filekeyword arguments. (#342) bootsnap precompileCLI use multiple processes to complete faster. (#341)bootsnap precompileCLI also precompile YAML files. (#340)- Changed the load path cache directory from
$BOOTSNAP_CACHE_DIR/bootsnap-load-path-cacheto$BOOTSNAP_CACHE_DIR/bootsnap/load-path-cachefor ease of use. (#334) - Changed the compile cache directory from
$BOOTSNAP_CACHE_DIR/bootsnap-compile-cacheto$BOOTSNAP_CACHE_DIR/bootsnap/compile-cachefor ease of use. (#334)
- Workaround a Ruby bug in InstructionSequence.compile_file. (#332)
- Add a command line to statically precompile the ISeq cache. (#326)
- Various performance enhancements
- Fix race condition in heavy concurrent load scenarios that would cause bootsnap to raise
-
Fix bug that was erroneously considering that files containing
.in the names were being required if a different file with the same name was already being requiredExample:
require 'foo' require 'foo.en'Before bootsnap was considering
foo.ento be the same file asfoo -
Use glibc as part of the ruby_platform cache key
- MRI 2.7 support
- Fixed concurrency bugs
- Disable ISeq cache in
bootsnap/setupby default in Ruby 2.5
- Fix some cache permissions and umask issues after switch to mkstemp
- Fix bug when removing features loaded by relative path from
$LOADED_FEATURES - Fix bug with propagation of
NameErrorup from nested calls torequire
- Don't register change observers to frozen objects.
- When running in development mode, always fall back to a full path scan on LoadError, making bootsnap more able to detect newly-created files. (#230)
- Respect
$LOADED_FEATURES.deletein order to support code reloading, for integration with Zeitwerk. (#230) - Minor performance improvement: flow-control exceptions no longer generate backtraces.
- Better support for requiring from environments where some features are not supported (especially JRuby). (#226)k
- More robust handling of OS errors when creating files. (#225)
- Fix Spring + Bootsnap incompatibility when there are files with similar names.
- Fix
YAML.load_filemonkey patch to keep accepting File objects as arguments. - Fix the API for
ActiveSupport::Dependencies#autoloadable_module?. - Some performance improvements.
- Change load path scanning to more correctly follow symlinks.
- Handle cases where load path entries are symlinked (#136)
- Fix method visibility of
Kernel#require.
- Add
LoadedFeaturesIndexto preserve fix a common bug related toLOAD_PATHmodifications after loading bootsnap.
- Don't cache YAML documents with
!ruby/object - Fix cache write mode on Windows
- Create cache entries as 0775/0664 instead of 0755/0644
- Better handling around cache updates in highly-parallel workloads
- Assortment of minor bugfixes
- bugfix re-release of 1.1.4
- Avoid loading a constant twice by checking if it is already defined
- Properly resolve symlinked path entries
- Minor fix: deprecation warning
- Fix crash in
Native.compile_option_crc32=on 32-bit platforms.
- Add
bootsnap/setup - Support jruby (without compile caching features)
- Better deoptimization when Coverage is enabled
- Consider
Bundler.bundle_pathto be stable
- (none)
- Minor performance savings around checking validity of cache in the presence of relative paths.
- When coverage is enabled, skips optimization instead of exploding.
- Don't whitelist paths under
RbConfig::CONFIG['prefix']as stable; instead use['libdir'](#41). - Catch
EOFErrorwhen reading load-path-cache and regenerate cache. - Support relative paths in load-path-cache.
- Migrate CompileCache from xattr as a cache backend to a cache directory
- Adds support for Linux and FreeBSD
- Support more versions of ActiveSupport (
depend_on's signature varies; don't reiterate it) - Fix bug in handling autoloaded modules that raise NoMethodError