Skip to content

Instantly share code, notes, and snippets.

@zunda
Last active December 13, 2023 23:06
Show Gist options
  • Save zunda/ecdc7f8b1b8a90b83fbd72d4f5aea30b to your computer and use it in GitHub Desktop.
Save zunda/ecdc7f8b1b8a90b83fbd72d4f5aea30b to your computer and use it in GitHub Desktop.
ruby-masterでbootsnap
$ cd ~/c/src/github.com/ruby/ruby
$ git switch master
$ git pull
$ git rev-parse HEAD
31c0ea20e5492925ac971991937e30524da5043d
$ git clean -dxf
$ ./autogen.sh
$ mkdir build && cd build
$ mkdir ~/.rubies
$ ../configure --prefix="${HOME}/.rubies/ruby-master" --disable-install-doc
$ make
$ make install
$ make test-all
:
Finished tests in 703.527219s, 37.6574 tests/s, 8969.5648 assertions/s.
26493 tests, 6310333 assertions, 0 failures, 0 errors, 102 skips
ruby -v: ruby 3.3.0dev (2023-12-13T19:15:09Z master 31c0ea20e5) [x86_64-linux]
$ mkdir /tmp/b
$ cd /tmp/b
$ ~/.rubies/ruby-master/bin/bundle init
$ echo "gem 'bootsnap', require: false" >> Gemfile
$ ~/.rubies/ruby-master/bin/bundle install
$ ~/.rubies/ruby-master/bin/bundle exec ~/.rubies/ruby-master/bin/ruby --version
ruby 3.3.0dev (2023-12-13T19:15:09Z master 31c0ea20e5) [x86_64-linux]
$ vi test.rb
$ cat test.rb
require 'bootsnap'
Bootsnap.setup(
cache_dir: 'tmp/cache',
ignore_directories: ['node_modules'],
development_mode: true,
load_path_cache: true,
compile_cache_iseq: true,
compile_cache_yaml: true,
compile_cache_json: true,
readonly: true,
)
require 'csv'
$ ~/.rubies/ruby-master/bin/bundle exec ~/.rubies/ruby-master/bin/ruby test.rb
/home/zunda/.rubies/ruby-master/lib/ruby/3.3.0+0/bundled_gems.rb:120:in `<': comparison of String with nil failed (ArgumentError)
msg = " #{RUBY_VERSION < SINCE[gem] ? "will no longer be" : "is not"} part of the default gems since Ruby #{SINCE[gem]}."
^^^^^^^^^^
from /home/zunda/.rubies/ruby-master/lib/ruby/3.3.0+0/bundled_gems.rb:120:in `build_message'
from /home/zunda/.rubies/ruby-master/lib/ruby/3.3.0+0/bundled_gems.rb:116:in `warning?'
from /home/zunda/.rubies/ruby-master/lib/ruby/3.3.0+0/bundled_gems.rb:65:in `block (2 levels) in replace_require'
from /tmp/b/vendor/bundle/ruby/3.3.0+0/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from test.rb:12:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment