Project

General

Profile

Actions

Bug #19885

closed

Invalid Warning for Default Gems That Will Move to Bundled Gems

Added by jeremyevans0 (Jeremy Evans) 8 months ago. Updated 7 months ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 3.3.0preview2 (2023-09-14 master e50fcca9a7) [x86_64-openbsd]
[ruby-core:114782]

Description

Starting in ruby 3.3.0-preview2, attempting to require bigdecimal, mutex_m, base64, or other libraries that will move to bundled gems in Ruby 3.4.0 results in a warning, even when bundler is not in use:

$ ruby33 -v -r bigdecimal -e ''
ruby 3.3.0preview2 (2023-09-14 master e50fcca9a7) [x86_64-openbsd]
warning: bigdecimal which will be not part of the default gems since Ruby 3.4.0

I think such warnings are bugs if bundler is not in use. When a library is moved from a default gem to a bundled gem, such code will work fine if not using bundler. It is only when using bundler where such code would have problems, and therefore, if Ruby warns at all, it should only warn when bundler is in use.

The only time such a warning would make sense if bundler is not in use is if the library was not going to be a bundled gem. In that case, first the library should be moved from a default gem to a bundled gem, then the bundled gem that ships with Ruby should provide the warning, which you can avoid by installing an updated gem version.

Note that you also get the warning when loading a gem that has bigdecimal as a runtime dependency (this example uses Sequel 5.72.0, which has a runtime dependency on bigdecimal as you can see at https://rubygems.org/gems/sequel/versions/5.72.0):

$ ruby33 -v -r sequel -e ''
ruby 3.3.0preview2 (2023-09-14 master e50fcca9a7) [x86_64-openbsd]
/usr/local/lib/ruby/gems/3.3/gems/sequel-5.72.0/lib/sequel/core.rb:3: warning: bigdecimal which will be not part of the default gems since Ruby 3.4.0

This warning makes even less sense, because even if bigdecimal was removed as both a default gem and a bundled gem, installing Sequel 5.72.0 would install bigdecimal as a dependency.


Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #19776: Warn bundled gems when it called from `require`Closedhsbt (Hiroshi SHIBATA)Actions
Actions

Also available in: Atom PDF

Like1
Like0Like0Like0Like0Like0Like0