Project

General

Profile

Actions

Feature #19351

closed

Promote bundled gems at Ruby 3.3

Added by hsbt (Hiroshi SHIBATA) almost 2 years ago. Updated over 1 year ago.

Status:
Closed
Target version:
-
[ruby-core:111873]

Description

In Ruby 3.2, the default gems and bundled gems are changed only adding syntax_suggest. I and some committers are considering promote default gems to bundled gems again for Ruby 3.3+.

We hope to keep the current developer experience with dependency resolution and ignore the additional work like "Put gem "xxx" into your Gemfile" for developers.

Proposal for Ruby 3.3.0-preview2

I propose the following libraries will promote default gems to bundled gems at Ruby 3.3.0-preview2

abbrev
getoptlong
observable
resolv-replace
rinda
nkf (C-ext)
syslog (C-ext)
base64
drb
mutex_m
csv

Other default gems depends on make test-all or other standard libraries. It's hard to promote in this time. And I submit a PoC of bypass feature for Bundler and bundled gems: https://github.com/rubygems/rubygems/pull/6811

This feature add load_paths defined by Gem.bundled_gems that is pair list of Gem name and version under the Bundler environment. This mean user can require bundled gems like csv without gem "csv" on Gemfile.

And we need to warn like "'csv' is loaded without Gemfile, add "gem 'csv'" in your Gemfile" in require or other place. I have no idea how notice this yet.


Proposal

I propose the following libraries will promote default gems to bundled gems at Ruby 3.3. They are not the dependencies of Rails and RubyGems/Bundler.

abbrev
getoptlong
observable
resolv-replace
rinda
nkf (C-ext)
syslog (C-ext)

Update: I removed optparse and un from above list. Because they are used by Ruby build process.

optparse
un

Update 2: I also removed the following libraries. resolv and fcntl are used by test of Ruby internal like test_io.rb. And we don't have built process of C extension at Windows platform. I gave up to extract win32ole in this time.

resolv
fcntl (C-ext)
win32ole (C-ext)

Additional works

I also propose to promote rails dependencies without rubygems/bundler deps:

base64
drb
mutex_m

Update: delegate is used by tempfile. We need to keep delegate as default gems for build process. and I added reline into above list.

Update 2: The following libraries used by tests of ruby/ruby and other libraries like psych. I need to remove their dependency from ruby/ruby.

benchmark
forwardable
ipaddr
irb
reline
ostruct
rdoc
singleton
tsort
weakref
bigdecimal (C-ext)
date(datetime) (C-ext)

And gems maintained by @kou (Kouhei Sutou)

csv

Following gems also maintained by @kou (Kouhei Sutou), but they are used on RubyGems/Bundler or MJIT. Maybe, We couldn't promote them because RubyGems/Bundler couldn't bundle C-ext gems.

fiddle (C-ext): used by MJIT
stringio (C-ext) used by RubyGems/Bundler
strscan (C-ext) used by RubyGems/Bundler

Follow-up feature

But if we promote them to bundled gems, many of users need to add like gem "csv" into their Gemfile. I'm considering avoiding this situation.

Can we introduce the specific feature of bundled gems to RubyGems or Bundler? Example, bundler have allowed list for bundled gems. So, listed gems could be require without Gemfile under the bundle exec.


Related issues 8 (1 open7 closed)

Related to Ruby master - Bug #18567: Depending on default gems in stdlib gems when not needed considered harmfulClosedhsbt (Hiroshi SHIBATA)Actions
Related to Ruby master - Feature #16963: Remove English.rb from Ruby 2.8/3.0Closedhsbt (Hiroshi SHIBATA)Actions
Related to Ruby master - Bug #18169: Local copies of gemified libraries are being released out of sync with their gemsClosedhsbt (Hiroshi SHIBATA)Actions
Related to Ruby master - Feature #19702: Promote racc as bundled gemsClosedhsbt (Hiroshi SHIBATA)Actions
Related to Ruby master - Feature #19776: Warn bundled gems when it called from `require`Closedhsbt (Hiroshi SHIBATA)Actions
Related to Ruby master - Feature #19843: Promote bigdecimal as bundled gems at Ruby 3.4ClosedActions
Related to Ruby master - Feature #20187: Bundled gems at Ruby 3.4Closedhsbt (Hiroshi SHIBATA)Actions
Related to Ruby master - Feature #20309: Bundled gems for Ruby 3.5Assignedhsbt (Hiroshi SHIBATA)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0