You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running a rake test task with verbose set to true, outputs the warning ".../ruby-3.2.2@nagano3/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:8: warning: method redefined; discarding old require"
Here is an example of such a setting
Rake::TestTask.new(:quick_check) do |t|
# ...
t.verbose = true
end
Launching a Rails console with RUBYOPT=-w also has the same warning.
I guess there could be race conditions if you first #undef the method. I wonder if you could turn this into a module that is #prepend to Kernel?
Bootsnap version: 1.17.0
Ruby version: 3.2.2
Rails version: 7.0.8
The text was updated successfully, but these errors were encountered:
I wonder if you could turn this into a module that is #prepend to Kernel?
No it's not possible because rubygems uses a similar alias_method chain, and it doesn't mix well with prepend. Zeitwerk also alias method chain require, so we'd need to coordinate all this which is practically not possible.
In the meantime I can silence that warning using the alias_method trick:
Fix: #461
Also neither Rubygems nor Zeitwerk bother decorating
`Kernel.require`, and no-one requires with `Kernel.require` so
likely not worth it, and if anything that offers an escape hatch to
bypass Bootsnap.
Running a rake test task with verbose set to true, outputs the warning ".../ruby-3.2.2@nagano3/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:8: warning: method redefined; discarding old require"
Here is an example of such a setting
Launching a Rails console with
RUBYOPT=-w
also has the same warning.I guess there could be race conditions if you first
#undef
the method. I wonder if you could turn this into a module that is#prepend
toKernel
?Bootsnap version: 1.17.0
Ruby version: 3.2.2
Rails version: 7.0.8
The text was updated successfully, but these errors were encountered: