https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/assets/favicon-0e291875.ico2024-02-27T22:39:20ZRuby Issue Tracking SystemRuby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1070322024-02-27T22:39:20ZrubyFeedback (robert heiler)
<ul></ul><blockquote>
<p>ruby -run is one of cool feature of Ruby. Should we avoid uninstalling un gem?</p>
</blockquote>
<p>I think -run is kind of neat; it's a bit like a mini-DSL for the commandline.</p>
<p>(Having said that, I actually do not use it myself; I instead use a custom executable that calls methods in other .rb files, so I kind of have the same or similar functionality available without needing to use special commandline flags; and lots of aliases.)</p> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1070332024-02-28T00:48:15Zhsbt (Hiroshi SHIBATA)[email protected]
<ul><li><strong>Description</strong> updated (<a title="View differences" href="proxy.php?url=/journals/107033/diff?detail_id=66531">diff</a>)</li></ul> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1070342024-02-28T00:49:26Zhsbt (Hiroshi SHIBATA)[email protected]
<ul><li><strong>Description</strong> updated (<a title="View differences" href="proxy.php?url=/journals/107034/diff?detail_id=66532">diff</a>)</li></ul> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1070382024-02-28T04:28:14Zhsbt (Hiroshi SHIBATA)[email protected]
<ul><li><strong>Description</strong> updated (<a title="View differences" href="proxy.php?url=/journals/107038/diff?detail_id=66535">diff</a>)</li></ul> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1070402024-02-28T08:46:29Zretro (Josef Šimánek)
<ul></ul><p>I'm big fan (and user) of <code>ruby -run -e httpd . -p 1234</code>, this is also part of "local HTTP server oneliners" like <a href="proxy.php?url=https://gist.github.com/willurd/5720255" class="external">https://gist.github.com/willurd/5720255</a> and it will break various tutorials online if <code>un</code> is not installed with ruby by default.</p> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1070432024-02-28T11:14:27ZEregon (Benoit Daloze)
<ul></ul><p>hsbt (Hiroshi SHIBATA) wrote:</p>
<blockquote>
<ul>
<li>ostruct
<ul>
<li>I make ostruct as optional on json at <a href="proxy.php?url=https://github.com/flori/json/pull/565" class="external">https://github.com/flori/json/pull/565</a>
</li>
</ul>
</li>
</ul>
</blockquote>
<p>+1 since ostruct is already kind of deprecated.</p>
<blockquote>
<ul>
<li>irb
<ul>
<li>We need to consider how works <code>binding.irb</code> after Ruby 3.5.</li>
</ul>
</li>
</ul>
</blockquote>
<p>Will that break <code>binding.irb</code> under <code>bundle exec</code>? If so that seems a major problem.<br>
I would think it would break it if <code>binding.irb</code> is implemented as e.g. <code>gem "irb"; require "irb"; binding.irb</code>.</p>
<blockquote>
<ul>
<li>yaml (wrapper file for psych)
<ul>
<li>syck is retired today. I'm not sure what people uses <code>psych</code> directly, not <code>yaml</code>.</li>
</ul>
</li>
</ul>
</blockquote>
<p><code>psych</code> seems to be a default gem (and I guess will remain as so as a dependency of rubygems).<br>
If so, what is the advantage to make <code>yaml</code> a bundled gem?<br>
It's a <a href="proxy.php?url=https://github.com/ruby/ruby/blob/master/lib/yaml.rb" class="external">trivial wrapper</a> so I don't see advantage to make bundled instead of default gem, only overhead (adding <code>gem "yaml"</code> in Gemfiles which has no value as this code almost never changes) and troubles.</p>
<p>BTW I think most programs use <code>require "yaml"</code> instead of <code>require "psych"</code> and I think that's better as it is, psych is kind of an implementation detail, people want to load/dump YAML.<br>
It seems busy unproductive work to replace <code>require "yaml"</code> by <code>require "psych"</code> or to add <code>gem "yaml"</code> in Gemfiles, so I am very much against making <code>yaml</code> a bundled gem.</p>
<blockquote>
<ul>
<li>readline (wrapper file for readline-ext and reline)</li>
</ul>
</blockquote>
<p>Is the intention to have people do <code>require "reline"</code> instead of <code>require "readline"</code>?<br>
It seems weird if people add <code>gem "readline"</code> to solve this, when <code>gem "reline"</code> would make much more sense.<br>
It's a <a href="proxy.php?url=https://github.com/ruby/ruby/blob/master/lib/readline.rb" class="external">trivial wrapper</a>, so I think making it a bundled gem creates more problems/overhead than it solves.</p>
<blockquote>
<ul>
<li>un
<ul>
<li>
<code>ruby -run</code> is one of cool feature of Ruby. Should we avoid uninstalling <code>un</code> gem?</li>
</ul>
</li>
</ul>
</blockquote>
<p><code>ruby -run</code> would still work if <code>un</code> is a bundled gem, so I think that's OK.<br>
Maybe RubyGems should ask confirmation/extra warning when uninstalling a bundled gem.</p>
<blockquote>
<ul>
<li>singleton
<ul>
<li>This is famous design pattern. Should we enforce users add them to their Gemfile?</li>
</ul>
</li>
</ul>
</blockquote>
<p>IMO not worth it, it's pretty <a href="proxy.php?url=https://github.com/ruby/ruby/blob/master/lib/singleton.rb" class="external">trivial code</a> and too much overhead to ask users to add to Gemfile for something so basic.</p>
<blockquote>
<ul>
<li>weakref
<ul>
<li>I'm not sure how impact after migrating bundled gems.</li>
</ul>
</li>
</ul>
</blockquote>
<p><a href="proxy.php?url=https://github.com/ruby/ruby/blob/master/lib/weakref.rb" class="external">weakref</a> is very tightly bound to implementation details, such as <code>::ObjectSpace::WeakMap.new</code> on CRuby.<br>
The implementation is completely different on JRuby and TruffleRuby.<br>
It will cause problems to make this a bundled gem for alternative Ruby implementations.<br>
So I think it is not worth to make this a bundled gem.<br>
Also, that file is tiny and trivial, and had <a href="proxy.php?url=https://github.com/ruby/ruby/commits/master/lib/weakref.rb" class="external">very few changes</a>.</p>
<blockquote>
<ul>
<li>fcntl
<ul>
<li>Should we integrate these constants into ruby core?</li>
</ul>
</li>
</ul>
</blockquote>
<p>It seems low-level stuff so I think being behind a <code>require</code> is in general good.<br>
But between core and bundled gem I would prefer core.</p>
<hr>
<p>BTW the reasoning to change from default gem to bundled gem is at <a href="proxy.php?url=https://bugs.ruby-lang.org/issues/19351#note-16" class="external">https://bugs.ruby-lang.org/issues/19351#note-16</a></p> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1070442024-02-28T11:18:19ZEregon (Benoit Daloze)
<ul></ul><p>Eregon (Benoit Daloze) wrote in <a href="proxy.php?url=#note-6">#note-6</a>:</p>
<blockquote>
<blockquote>
<ul>
<li>fcntl
<ul>
<li>Should we integrate these constants into ruby core?</li>
</ul>
</li>
</ul>
</blockquote>
<p>It seems low-level stuff so I think being behind a <code>require</code> is in general good.<br>
But between core and bundled gem I would prefer core.</p>
</blockquote>
<p>I misremembered, I thought there was something like <code>Fcntl.fcntl</code>, but it's <code>IO#fcntl</code>.<br>
So <code>fcntl</code> is literally just a bunch of constants:<br>
<a href="proxy.php?url=https://github.com/oracle/truffleruby/blob/master/lib/truffle/fcntl.rb" class="external">https://github.com/oracle/truffleruby/blob/master/lib/truffle/fcntl.rb</a><br>
<a href="proxy.php?url=https://github.com/ruby/ruby/blob/master/ext/fcntl/fcntl.c" class="external">https://github.com/ruby/ruby/blob/master/ext/fcntl/fcntl.c</a></p>
<p>So I think this should be core then.</p> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1070462024-02-28T11:20:09ZEregon (Benoit Daloze)
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="proxy.php?url=/issues/20187">Feature #20187</a>: Bundled gems at Ruby 3.4</i> added</li></ul> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1070482024-02-28T11:21:05ZEregon (Benoit Daloze)
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="proxy.php?url=/issues/19351">Feature #19351</a>: Promote bundled gems at Ruby 3.3</i> added</li></ul> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1070512024-02-28T15:38:16Zjeremyevans0 (Jeremy Evans)[email protected]
<ul></ul><p>Eregon (Benoit Daloze) wrote in <a href="proxy.php?url=#note-6">#note-6</a>:</p>
<blockquote>
<p>hsbt (Hiroshi SHIBATA) wrote:</p>
<blockquote>
<ul>
<li>singleton
<ul>
<li>This is famous design pattern. Should we enforce users add them to their Gemfile?</li>
</ul>
</li>
</ul>
</blockquote>
<p>IMO not worth it, it's pretty <a href="proxy.php?url=https://github.com/ruby/ruby/blob/master/lib/singleton.rb" class="external">trivial code</a> and too much overhead to ask users to add to Gemfile for something so basic.</p>
</blockquote>
<p>On the other hand, it's almost always better to use a normal constant with a singleton object than the <code>singleton</code> library. <code>singleton</code>'s only advantage is you can delay initialization, and if you want that, you can use <code>autoload</code> for the file that defines the constant.</p>
<p>Instead of:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="k">class</span> <span class="nc">Klass</span>
<span class="kp">include</span> <span class="no">Singleton</span>
<span class="c1"># define methods</span>
<span class="k">end</span>
<span class="no">Klass</span><span class="p">.</span><span class="nf">instance</span>
</code></pre>
<p>Use:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="no">CONSTANT</span> <span class="o">=</span> <span class="no">Object</span><span class="p">.</span><span class="nf">new</span>
<span class="no">CONSTANT</span><span class="p">.</span><span class="nf">singleton_class</span><span class="p">.</span><span class="nf">class_eval</span> <span class="k">do</span>
<span class="c1"># define methods</span>
<span class="k">end</span>
</code></pre>
<p>I think we should encourage users to use the singleton object support built into Ruby core, as opposed to a separate library that accomplishes mostly the same thing. I think the main advantage of the <code>singleton</code> library over standard Ruby is that it supports marshalling, but I'm not sure how common is the need to marshal singleton objects.</p>
<p>I'm in favor of moving the <code>singleton</code> library to bundled gems mainly to discourage users from using it.</p> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1070542024-02-28T17:21:21ZEregon (Benoit Daloze)
<ul></ul><p><a class="user active user-mention" href="proxy.php?url=https://bugs.ruby-lang.org/users/1604">@jeremyevans0 (Jeremy Evans)</a> One issue with that replacement is it does not name the class of the object, so it's quite unclear if there is an exception with it.<br>
And also no easy way to define constants in that singleton class (and if one does <code>A = ...</code> there it will accidentally declare Object::A).</p>
<p>I think there is nothing wrong with the singleton stdlib, so I think we should not discourage using it.<br>
There are cases where it's best to initialize a constant eagerly and that's fine, those usages do not need <code>singleton</code>.</p> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1070552024-02-28T17:23:29ZEregon (Benoit Daloze)
<ul></ul><p>Also something I remembered now is YJIT <a href="proxy.php?url=https://github.com/Shopify/ruby/issues/552" class="external">does not compile singleton methods</a>, except singleton methods of modules and classes.<br>
So then that replacement can also be significantly slower.</p> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1072142024-03-14T04:54:46Zhsbt (Hiroshi SHIBATA)[email protected]
<ul><li><strong>Description</strong> updated (<a title="View differences" href="proxy.php?url=/journals/107214/diff?detail_id=66593">diff</a>)</li></ul> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1072402024-03-14T09:44:45Zhsbt (Hiroshi SHIBATA)[email protected]
<ul></ul><p>Thanks <a class="user active user-mention" href="proxy.php?url=https://bugs.ruby-lang.org/users/772">@Eregon (Benoit Daloze)</a> and <a class="user active user-mention" href="proxy.php?url=https://bugs.ruby-lang.org/users/1604">@jeremyevans0 (Jeremy Evans)</a> .</p>
<p>I mostly agreed your comments. And I discussed this at DevMeeting 2024/03/14.</p>
<ul>
<li>No one against about <code>ostruct</code>. I will do that.</li>
<li>We should consider to run <code>irb</code> without <code>gem "irb"</code> of Gemfile under the all of Bundler environment.
<ul>
<li>I will consider it with <code>irb</code>, <code>reline</code> and <code>io-console</code>.</li>
</ul>
</li>
<li>I try to run <code>make doc</code> before <code>make install</code> and use <code>rdoc</code> as bundled gems.
<ul>
<li>If I can do that, I will mark rdoc as bundled gems at Ruby 3.5.</li>
</ul>
</li>
<li>I'll extract another issue for <code>singleton</code>, <code>un</code>, <code>fcntl</code>.</li>
</ul>
<p>I will update this issue until finalised target libraries.</p> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1072482024-03-14T10:41:37ZEregon (Benoit Daloze)
<ul></ul><p><a class="user active user-mention" href="proxy.php?url=https://bugs.ruby-lang.org/users/572">@hsbt (Hiroshi SHIBATA)</a> What about <a href="proxy.php?url=https://github.com/ruby/yaml/blob/master/lib/yaml.rb" class="external">yaml</a> and <a href="proxy.php?url=https://github.com/ruby/readline/blob/master/lib/readline.rb" class="external">readline</a>?<br>
I think these are not worth moving to bundled gems, i.e. the gains are (AFAIK) very small while the costs and confusion are high.<br>
I think so because the code for these 2 trivial "loaders/wrappers" (see links above) almost never changes (so the overhead of keeping them in sync is basically 0, probably 0 security issues in that code, etc).<br>
There seems to be no value to use track <code>readline</code> 0.0.4 vs <code>readline</code> 0.0.5 in a Gemfile.lock for instance, as the only likely changes would be to adapt to some incompatible change in Ruby, and then that's useless since the right version would be shipped with Ruby.</p>
<p>The main problem there/my main concern is the cost, many people would need to add <code>gem "readline"</code> or <code>gem "yaml"</code> to their Gemfile for Ruby 3.5, and gain basically nothing from it, so it would be almost pure overhead.<br>
Also depending on <code>gem "yaml"</code> alone is not a good idea, because it doesn't mean any specific major version of <code>psych</code>. So one needs <code>gem "psych"</code> anyway, and the <code>gem "yaml"</code> is redundant.</p>
<p>To try to quantify that I looked at</p>
<ul>
<li>
<a href="proxy.php?url=https://rubygems.org/gems/readline/reverse_dependencies" class="external">https://rubygems.org/gems/readline/reverse_dependencies</a>: only 5 gems depend on readline right now. Yet there are 371+1158 matches for <code>gem-codesearch 'require "readline"'</code>+<code>gem-codesearch "require 'readline'"</code>. All these gems would need to add <code>gem "readline"</code>, for no gain.</li>
<li>
<a href="proxy.php?url=https://rubygems.org/gems/psych/reverse_dependencies" class="external">https://rubygems.org/gems/psych/reverse_dependencies</a> vs <a href="proxy.php?url=https://rubygems.org/gems/yaml/reverse_dependencies" class="external">https://rubygems.org/gems/yaml/reverse_dependencies</a>. There are about 18x (54M/3M) as much downloads for <code>psych</code> than <code>yaml</code>. RubyGems.org doesn't show a total count for reverse dependencies but it seems clear few gems depend on <code>yaml</code>, much much more depend on <code>psych</code>. All the gems depending on <code>psych</code> and not <code>yaml</code> would need changes.</li>
</ul>
<p>One more thing, as far as I can see, <code>psych</code> is a default gem. Having <code>yaml</code> as a bundled gem while <code>psych</code> is a default gem would lead to an awkward situation that when run under bundler and not adding either to the Gemfile, one can <code>require "psych"</code> but cannot <code>require "yaml"</code>. So they could use <code>Psych</code> in code but not <code>YAML</code> which feels a wrong limitation (people might just do YAML=Psych themselves as a workaround, but then that could cause warnings).<br>
So it seems clear <code>yaml</code> shouldn't become bundled gem before <code>psych</code> at least. And I think psych cannot become a bundled gem because RubyGems needs it.</p> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1072502024-03-14T10:55:51Zhsbt (Hiroshi SHIBATA)[email protected]
<ul></ul><blockquote>
<p>What about yaml and readline?</p>
</blockquote>
<p>There is no conclusion yet. I understood your concern. Do not rush this.</p> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1072662024-03-14T14:58:37ZEregon (Benoit Daloze)
<ul></ul><p>OK, thank you. I wanted to make sure my concern on that is clear.<br>
At least it seems useful to have some data and extra details on it (the last paragraph).</p> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1072782024-03-14T22:36:08Zhsbt (Hiroshi SHIBATA)[email protected]
<ul></ul><blockquote>
<p>At least it seems useful to have some data and extra details on it (the last paragraph).</p>
</blockquote>
<p>I see. Thanks for your investigation.</p>
<p>To be precise, there wasn't time to talk about wrapper files. We only discuss about <a href="proxy.php?url=https://bugs.ruby-lang.org/issues/20309#note-14" class="external">https://bugs.ruby-lang.org/issues/20309#note-14</a> yesterday.</p> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1073122024-03-19T09:15:08Zhsbt (Hiroshi SHIBATA)[email protected]
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="proxy.php?url=/issues/20347">Feature #20347</a>: Separate docs task from all</i> added</li></ul> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1086052024-06-04T06:24:14Zhsbt (Hiroshi SHIBATA)[email protected]
<ul><li><strong>Description</strong> updated (<a title="View differences" href="proxy.php?url=/journals/108605/diff?detail_id=67347">diff</a>)</li></ul> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1086332024-06-05T08:27:22Zhsbt (Hiroshi SHIBATA)[email protected]
<ul><li><strong>Description</strong> updated (<a title="View differences" href="proxy.php?url=/journals/108633/diff?detail_id=67368">diff</a>)</li></ul> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1087602024-06-09T11:47:57ZEregon (Benoit Daloze)
<ul></ul><p>I wonder if making <code>win32ole</code> a bundled gem is a good idea.</p>
<p>From what I have seen the consequence of such changes seems in most cases to encourage gems to drop the dependency on the newly-bundled gem.<br>
That may be good for e.g. ostruct which is kind of self-deprecated (due to horrible performance and messy semantics).<br>
But it may be bad for <code>win32ole</code>, because the alternatives may be slower or less reliable, e.g. see the discussion <a href="proxy.php?url=https://github.com/ruby-concurrency/concurrent-ruby/pull/1053" class="external">here</a> where it's all too easy to regress from 60ms to 1s, and potentially fail if neither <code>powershell</code> nor <code>wmic</code> are available.</p>
<p>I don't think many gems will consider adding <code>win32ole</code> as a dependency, because it looks very weird for usages of the gem on non-Windows.<br>
Even though the gem does seem to install OK on non-Windows, when installing CRuby on non-Windows, win32ole has never been installed as a default gem, so it looks unexpected to even install that gem.</p> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1095592024-08-29T21:37:16Zhsbt (Hiroshi SHIBATA)[email protected]
<ul><li><strong>Description</strong> updated (<a title="View differences" href="proxy.php?url=/journals/109559/diff?detail_id=67824">diff</a>)</li></ul> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1095612024-08-29T22:39:46ZEregon (Benoit Daloze)
<ul></ul><p>Regarding whether to make <code>benchmark</code> a bundled gem I think there are some downsides (from <a href="proxy.php?url=https://github.com/ruby/ruby/pull/11492" class="external">https://github.com/ruby/ruby/pull/11492</a>):</p>
<ul>
<li>I think it's valuable that <code>Benchmark.realtime { ... }</code> is available without needing a gem dependency. It's a convenient thing, in gems, in irb, when performance debugging, etc. Having to add a gem to the Gemfile/gemspec just for that is inconvenient. It starts to feel a bit like JS/npm when one needs a dependency for something so simple (or copy/paste the code around, which can be suboptimal e.g. <code>Benchmark.realtime</code> could be implemented internally more efficiently or e.g. it changed from Time.now to Process.clock_gettime). Also Benchmark.measure is less simple yet still convenient.</li>
<li>Every gem using <code>Benchmark</code> will have to choose whether to add a dependency on the benchmark gem (which seems a bit heavy given how small it is) or duplicating the code of <code>benchmark.rb</code>. The PRs linked at <a href="proxy.php?url=https://github.com/ruby/ruby/pull/11492" class="external">https://github.com/ruby/ruby/pull/11492</a> are a good illustration of the effect of making such small gems bundled: code duplication across many gems, if there is ever an issue with that copied code (unlikely in this case I admit) it will be that much harder to fix it.</li>
<li>I don't think there has ever been a security issue in benchmark.rb or a need for a CRuby release for benchmark.rb. It doesn't change much either, so sync issues don't seem a big deal here. So the gains to make it bundled instead of default seems very small (or am I missing something?).</li>
</ul> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1095682024-08-30T16:06:01ZEarlopain (Earlopain _)
<ul></ul><p>I guess I can share my opinion here.</p>
<p>There definitely is a benefit in bundling some gems, both from a ruby maintainer and security perspective. But with things like <code>benchmark</code>, <code>forwardable</code>, <code>singleton</code>, (or <code>base64</code>, <code>mutex_m</code> from the previous issue) I am hardpressed to actually include these into the dependency graph.</p>
<p>Many libraries depend on them, and usually the usage is trivial. For <code>base64</code>, it's just a different, though less beautifully named method invocation (if you don't use the url-safe variants). <code>singleton</code> and <code>forwardable</code> are what I would consider syntactic sugar. I'm not going to add a dependency just for that, I will instead forgoe the small ergonomics I'd gain and go with the manual solution.</p>
<p>Note this is purely from a library perspective. End consumers are free to do what they want but if I can do the same thing myself in maybe 1 or 2 lines more I'm just going to do that. From PRs I've opened against other projects, maintainers tend to agree. Adding a dependency just for that usually isn't justifiable.</p> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1096472024-09-05T11:24:51Zhsbt (Hiroshi SHIBATA)[email protected]
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-2 priority-4 priority-default" href="proxy.php?url=/issues/20714">Bug #20714</a>: Handle optional dependencies in `bundled_gems.rb`</i> added</li></ul> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1096572024-09-06T01:58:42Zhsbt (Hiroshi SHIBATA)[email protected]
<ul><li><strong>Description</strong> updated (<a title="View differences" href="proxy.php?url=/journals/109657/diff?detail_id=67867">diff</a>)</li></ul> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1096582024-09-06T01:59:12Zhsbt (Hiroshi SHIBATA)[email protected]
<ul><li><strong>Description</strong> updated (<a title="View differences" href="proxy.php?url=/journals/109658/diff?detail_id=67868">diff</a>)</li></ul> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1096682024-09-06T05:35:30Zhsbt (Hiroshi SHIBATA)[email protected]
<ul></ul><p>I will warn <code>benchmark</code>, <code>irb</code> and <code>reline</code> at Ruby 3.4. and make them and <code>readline</code> wrapper to bundled gems at Ruby 3.5 with September Dev Meeting. The current list is final proposal for Ruby 3.4.</p>
<p>I know <code>bundled_gems.rb</code> have some incomplete issues:</p>
<ul>
<li>Ignore to warn for declared dependencies like <code>reline</code> at <code>irb</code>.</li>
<li>Suppress warning for optional dependency
<ul>
<li>Related with <a href="proxy.php?url=https://github.com/ruby/ruby/pull/11550" class="external">https://github.com/ruby/ruby/pull/11550</a> or <a href="proxy.php?url=https://github.com/ruby/ruby/pull/11545" class="external">https://github.com/ruby/ruby/pull/11545</a>
</li>
</ul>
</li>
</ul>
<p>To Earlopain.</p>
<blockquote>
<p>singleton and forwardable are what I would consider syntactic sugar. I'm not going to add a dependency just for that</p>
</blockquote>
<p>Agreed. I withdraw them like <code>singleton</code> to make bundled gems.</p> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1096722024-09-06T14:48:39Zima1zumi (Mari Imaizumi)
<ul></ul><p>Does this change mean that even if Ruby is installed, the irb command will no longer be available?<br>
If that is the case, I oppose it for the following reasons:</p>
<ul>
<li>Existing learning materials will no longer work as-is, causing confusion for beginners.</li>
<li>IRB would need to be reinstalled every time Ruby is reinstalled.</li>
</ul>
<p>I believe removing IRB would significantly disadvantage users.</p> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1096872024-09-09T00:16:32Zhsbt (Hiroshi SHIBATA)[email protected]
<ul></ul><blockquote>
<p>Does this change mean that even if Ruby is installed, the irb command will no longer be available?</p>
</blockquote>
<p>No. <code>irb</code> is available as bundled gems.</p> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1096882024-09-09T02:35:02Zima1zumi (Mari Imaizumi)
<ul></ul><blockquote>
<p>No. irb is available as bundled gems.</p>
</blockquote>
<p>Sorry, I misunderstood.</p> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1097672024-09-13T17:44:07Zdeivid (David Rodríguez)
<ul></ul><p>Regarding <code>irb</code>, I find it concerning that we need to add code like this: <a href="proxy.php?url=https://github.com/ruby/ruby/blob/9afc6a981deae6e23d938cf5c2c4baadfeaafdb1/prelude.rb#L12-L44" class="external">https://github.com/ruby/ruby/blob/9afc6a981deae6e23d938cf5c2c4baadfeaafdb1/prelude.rb#L12-L44</a>. Those are internals of Bundler that are likely to break, and I can't even tell if that is doing what's intended?</p>
<p>The fact that we want <code>binding.irb</code> to work regardless of being in a <code>bundle exec</code> context or not feels like a sign that <code>irb</code> should probably stay as a default gem?</p> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1097942024-09-16T10:27:10ZEregon (Benoit Daloze)
<ul></ul><p>There is an additional issue with making fiddle a bundled gem: it means any usage now must have libffi headers available or it will fail to install.<br>
Before, it would just work because fiddle would have been built when CRuby was built.<br>
Seen in <a href="proxy.php?url=https://github.com/ffi/ffi/actions/runs/10881406447/job/30190385022?pr=1119" class="external">https://github.com/ffi/ffi/actions/runs/10881406447/job/30190385022?pr=1119</a>:</p>
<pre><code> extconf.rb:78:in `<main>': missing libffi. Please install libffi or use
--with-libffi-source-dir with libffi source location. (RuntimeError)
</code></pre>
<p>From <a href="proxy.php?url=https://github.com/ffi/ffi/pull/1119" class="external">https://github.com/ffi/ffi/pull/1119</a></p> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1098122024-09-16T20:35:10Zvo.x (Vit Ondruch)[email protected]
<ul></ul><p>Eregon (Benoit Daloze) wrote in <a href="proxy.php?url=#note-34">#note-34</a>:</p>
<blockquote>
<p>There is an additional issue with making fiddle a bundled gem: it means any usage now must have libffi headers available or it will fail to install.<br>
Before, it would just work because fiddle would have been built when CRuby was built.<br>
Seen in <a href="proxy.php?url=https://github.com/ffi/ffi/actions/runs/10881406447/job/30190385022?pr=1119" class="external">https://github.com/ffi/ffi/actions/runs/10881406447/job/30190385022?pr=1119</a>:</p>
<pre><code> extconf.rb:78:in `<main>': missing libffi. Please install libffi or use
--with-libffi-source-dir with libffi source location. (RuntimeError)
</code></pre>
<p>From <a href="proxy.php?url=https://github.com/ffi/ffi/pull/1119" class="external">https://github.com/ffi/ffi/pull/1119</a></p>
</blockquote>
<p>I don't think it is bad idea to start using <code>bundle install --local</code>, i.e. use gems which are already available on the system. And on top of that, stop using Bundler in containers for runtime in production use.</p> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1098162024-09-17T08:53:33Zhsbt (Hiroshi SHIBATA)[email protected]
<ul></ul><blockquote>
<p>The fact that we want binding.irb to work regardless of being in a bundle exec context or not feels like a sign that irb should probably stay as a default gem?</p>
</blockquote>
<p>I don't think so. Bundler should provide that feature for like <code>debug</code>, <code>stackprof</code> and <code>irb</code>. I and <a class="user active user-mention" href="proxy.php?url=https://bugs.ruby-lang.org/users/18">@mame (Yusuke Endoh)</a> discussed about that. We sometimes need to use that tools without updating Gemfile and its lockfile.</p> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1098182024-09-17T09:40:57Zdeivid (David Rodríguez)
<ul></ul><blockquote>
<p>I don't think so. Bundler should provide that feature for like debug, stackprof and irb. I and <a class="user active user-mention" href="proxy.php?url=https://bugs.ruby-lang.org/users/18">@mame (Yusuke Endoh)</a> (Yusuke Endoh) discussed about that. We sometimes need to use that tools without updating Gemfile and its lockfile.</p>
</blockquote>
<p>Yeah, that sounds reasonable to me, and you can already do that with default gems. My question is more, why does <code>irb</code> need to be converted into a bundled gem? I think the conversion does have a maintenance cost, so I want to make sure the benefits are worth that cost.</p>
<p>If we still want to do this, can we add some test somewhere that <code>binding.irb</code> works in a <code>bundle exec</code> context, to make sure we don't break that code in <code>prelude.rb</code>?</p> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1098192024-09-17T12:37:03ZEregon (Benoit Daloze)
<ul></ul><p>vo.x (Vit Ondruch) wrote in <a href="proxy.php?url=#note-35">#note-35</a>:</p>
<blockquote>
<p>I don't think it is bad idea to start using <code>bundle install --local</code>, i.e. use gems which are already available on the system. And on top of that, stop using Bundler in containers for runtime in production use.</p>
</blockquote>
<p>Do you mean <code>--prefer-local</code>? I don't think <code>--local</code> would work in general since that does not attempt to connect to rubygems.org at all.<br>
EDIT: From the docs <code>--prefer-local</code> seems the right thing, we should try it:</p>
<pre><code> --local
Do not attempt to connect to rubygems.org. Instead, Bundler will use the gems already present in Rubygems' cache or in vendor/cache. Note that if an
appropriate platform-specific gem exists on rubygems.org it will not be found.
--prefer-local
Force using locally installed gems, or gems already present in Rubygems' cache or in vendor/cache, when resolving, even if newer versions are available
remotely. Only attempt to connect to rubygems.org for gems that are not present locally.
</code></pre> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1098282024-09-18T06:30:40Zvo.x (Vit Ondruch)[email protected]
<ul></ul><p>Eregon (Benoit Daloze) wrote in <a href="proxy.php?url=#note-38">#note-38</a>:</p>
<blockquote>
<p>vo.x (Vit Ondruch) wrote in <a href="proxy.php?url=#note-35">#note-35</a>:</p>
<blockquote>
<p>I don't think it is bad idea to start using <code>bundle install --local</code>, i.e. use gems which are already available on the system. And on top of that, stop using Bundler in containers for runtime in production use.</p>
</blockquote>
<p>Do you mean <code>--prefer-local</code>? I don't think <code>--local</code> would work in general since that does not attempt to connect to rubygems.org at all.</p>
</blockquote>
<p>I was not aware of <code>--prefer-local</code> (I am trying to avoid Bundler as much as I can), but yes, that sounds as reasonable alternative.</p> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1117632025-02-06T09:22:33Zhsbt (Hiroshi SHIBATA)[email protected]
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li></ul><p>I migrated all of target gems to bundled gems in master branch.</p>
<p><a class="user active user-mention" href="proxy.php?url=https://bugs.ruby-lang.org/users/10073">@k0kubun (Takashi Kokubun)</a></p>
<p>FYI: I added workaround to load fiddle from bundled gems at rjit.rb now.</p>
<p><a href="proxy.php?url=https://github.com/ruby/ruby/blob/master/rjit.rb#L33" class="external">https://github.com/ruby/ruby/blob/master/rjit.rb#L33</a></p>
<p>This workaround should be removed from rjit.rb. I will do that until final release or Ruby 3.5.</p> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1137852025-06-18T10:08:00Zhsbt (Hiroshi SHIBATA)[email protected]
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="proxy.php?url=/issues/21442">Feature #21442</a>: Make tsort to bundled gems</i> added</li></ul> Ruby - Feature #20309: Bundled gems for Ruby 3.5https://bugs.ruby-lang.org/issues/20309?journal_id=1162392026-01-30T12:05:13ZEarlopain (Earlopain _)
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="proxy.php?url=/issues/21855">Bug #21855</a>: Bundle `win32-registry` or implement it without `fiddle`</i> added</li></ul>