Bug #20450
closedRuby 3.3.1 broken with bootsnap
Description
The issue looks like https://bugs.ruby-lang.org/issues/20060
With the new release of ruby 3.1.1, bootsnap does not work anymore.
bin/rails aborted!
ArgumentError: 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]}."
^^^^^^^^^^
/usr/local/bundle/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
It's working with DISABLE_BOOTSNAP=1 with the following message : warning: parser/current is loading parser/ruby33, which recognizes 3.3.0-compliant syntax, but you are running 3.3.1.
Updated by hsbt (Hiroshi SHIBATA) 6 months ago
- Status changed from Open to Assigned
- Assignee set to hsbt (Hiroshi SHIBATA)
Can you provide your Gemfile
? I did confirm to work that with bootsnap and zeitwerk at https://github.com/ruby/ruby/pull/10347#issuecomment-2017204802
Updated by philippe.bs.noel@tutanota.com (Philippe Noel) 6 months ago
hsbt (Hiroshi SHIBATA) wrote in #note-1:
Can you provide your
Gemfile
? I did confirm to work that with bootsnap and zeitwerk at https://github.com/ruby/ruby/pull/10347#issuecomment-2017204802
$ cat Gemfile
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 7.1.0'
gem 'bootsnap', require: false
gem 'winrm'
Updated by eugeneius (Eugene Kenny) 6 months ago
I submitted a fix for this issue at https://github.com/ruby/ruby/pull/10619.
Updated by hsbt (Hiroshi SHIBATA) 6 months ago
- Subject changed from Ruby 3.1.1 broken with bootsnap to Ruby 3.3.1 broken with bootsnap
Updated by professor (Todd Sedano) 6 months ago
Thank you for fixing this. I confirmed that making this change fixed Ruby 3.3.1 for gusto
Updated by shan (Shannon Skipper) 6 months ago ยท Edited
For what it's worth, here are some untested install scripts using a minimalist version of @eugeneius's patch for ruby-install, RVM, rbenv and asdf.
ruby-install --patch https://gist.githubusercontent.com/havenwood/57ef01e562bc5ac2939477cc842cc9ad/raw/57ef01e562bc5ac2939477cc842cc9ad/raw/0509f4df6d7e8e5e4a16eae2ef43f903b2b265d6/delete_archdir_prefix.patch ruby-3.3.1
rvm install 3.3.1 --patch https://gist.githubusercontent.com/havenwood/57ef01e562bc5ac2939477cc842cc9ad/raw/57ef01e562bc5ac2939477cc842cc9ad/raw/0509f4df6d7e8e5e4a16eae2ef43f903b2b265d6/delete_archdir_prefix.patch
rbenv install --patch 3.3.1 < <(curl -s https://gist.githubusercontent.com/havenwood/57ef01e562bc5ac2939477cc842cc9ad/raw/0509f4df6d7e8e5e4a16eae2ef43f903b2b265d6/delete_archdir_prefix.patch)
RUBY_APPLY_PATCHES=$(curl -s https://gist.githubusercontent.com/havenwood/57ef01e562bc5ac2939477cc842cc9ad/raw/0509f4df6d7e8e5e4a16eae2ef43f903b2b265d6/delete_archdir_prefix.patch) asdf install ruby 3.3.1
Updated by hsbt (Hiroshi SHIBATA) 6 months ago
- Backport changed from 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN to 3.1: DONTNEED, 3.2: DONTNEED, 3.3: REQUIRED
Updated by eugeneius (Eugene Kenny) 6 months ago
- Status changed from Assigned to Closed
Applied in changeset git|67dd9af17e5c6c541a8cc84b1741deaf175fcf83.
[Bug #20450] Remove rubyarchdir from bootsnap paths
Updated by hsbt (Hiroshi SHIBATA) 6 months ago
Thanks all. I added https://github.com/ruby/ruby/pull/10619 to backport PR.
Sorry to your inconvenient experience for new stable version. https://bugs.ruby-lang.org/issues/20450#note-6 or https://github.com/ruby/ruby/pull/10619#issuecomment-2075896240 are good to temporary workaround for this issue until 3.3.2 release.
Updated by shan (Shannon Skipper) 6 months ago
RVM is now patching this by default for 3.3.1 installs. https://github.com/rvm/rvm/pull/5457
Updated by k0kubun (Takashi Kokubun) 5 months ago
- Backport changed from 3.1: DONTNEED, 3.2: DONTNEED, 3.3: REQUIRED to 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONE
I backported this to ruby_3_3
at 6edd65a080b.
Updated by k0kubun (Takashi Kokubun) 5 months ago
Ruby 3.3.2 has been released. It should have no issue with bootsnap.
Updated by jaruga (Jun Aruga) 5 months ago
Is this issue Ruby 3.3.1 specific or also happens in Ruby 3.3.0 too?
The issue looks like https://bugs.ruby-lang.org/issues/20060
The reporter mentioned the issue looked like #20060 introduced in Ruby 3.3.0-rc1. However, when I checked the ruby/ruby ruby_3_3 branch, the fixed commit https://github.com/ruby/ruby/commit/6edd65a080b156f1ce78fdcf57214c1644a049db for the lib/bundled_gems.rb
is included in Ruby 3.3.2, and the commit https://github.com/ruby/ruby/commit/2f654588d9e0cefff1c23529d2f2672029e1bd21 including the line in the lib/bundled_gems.rb
changed in the later commit 6edd65a080b156f1ce78fdcf57214c1644a049db was introduced in Ruby 3.3.1 first.