https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112021-03-10T12:59:36ZRuby Issue Tracking SystemRuby master - Feature #17684: Remove `--disable-gems` from release version of Rubyhttps://redmine.ruby-lang.org/issues/17684?journal_id=908192021-03-10T12:59:36Zchrisseaton (Chris Seaton)chris@chrisseaton.com
<ul></ul><p>How should people who were using it for performance migrate off the option?</p> Ruby master - Feature #17684: Remove `--disable-gems` from release version of Rubyhttps://redmine.ruby-lang.org/issues/17684?journal_id=908202021-03-10T13:00:56Znaruse (Yui NARUSE)naruse@airemix.jp
<ul></ul><p>Agreed. Unfortunately this increases the cost of development to support <code>--disable-gems</code>.<br>
In other words, this feature breaks the assumption that every Ruby has RubyGems.<br>
This feature should be removed.</p> Ruby master - Feature #17684: Remove `--disable-gems` from release version of Rubyhttps://redmine.ruby-lang.org/issues/17684?journal_id=908212021-03-10T13:02:45Znaruse (Yui NARUSE)naruse@airemix.jp
<ul></ul><p>chrisseaton (Chris Seaton) wrote in <a href="#note-1">#note-1</a>:</p>
<blockquote>
<p>How should people who were using it for performance migrate off the option?</p>
</blockquote>
<p><code>--disable-gems</code> should be just ignored in the future version, and the performance will be degraded.</p> Ruby master - Feature #17684: Remove `--disable-gems` from release version of Rubyhttps://redmine.ruby-lang.org/issues/17684?journal_id=908232021-03-10T13:21:40Zchrisseaton (Chris Seaton)chris@chrisseaton.com
<ul></ul><p>I don't have anything invested in this myself, but just for information to help the discussion, here's two examples of apps that use the option</p>
<ul>
<li><a href="https://github.com/Shopify/shopify-app-cli/blob/master/bin/shopify" class="external">https://github.com/Shopify/shopify-app-cli/blob/master/bin/shopify</a></li>
<li><a href="https://github.com/penelopezone/rubyfmt/blob/trunk/librubyfmt/script/run.sh" class="external">https://github.com/penelopezone/rubyfmt/blob/trunk/librubyfmt/script/run.sh</a></li>
</ul> Ruby master - Feature #17684: Remove `--disable-gems` from release version of Rubyhttps://redmine.ruby-lang.org/issues/17684?journal_id=908252021-03-10T13:35:10Zxtkoba (Tee KOBAYASHI)
<ul></ul><p>Will we be able to re-enable the <code>--disable-gems</code> option when we build <code>ruby</code> from source code? I think it is useful for narrowing problems down. For that purpose it might be sufficient that <code>miniruby</code> does not depend on Gems, though.</p>
<p>For performance we can use mruby (<a href="https://github.com/mruby/mruby" class="external">https://github.com/mruby/mruby</a>) after all.</p> Ruby master - Feature #17684: Remove `--disable-gems` from release version of Rubyhttps://redmine.ruby-lang.org/issues/17684?journal_id=908262021-03-10T14:53:52Zvo.x (Vit Ondruch)v.ondruch@tiscali.cz
<ul></ul><p>I'd love to see this clarified. IMO, there should be other ways to manage <code>$LOAD_PATH</code> then RubyGems. For such use cases, this option is useful IMO.</p> Ruby master - Feature #17684: Remove `--disable-gems` from release version of Rubyhttps://redmine.ruby-lang.org/issues/17684?journal_id=908272021-03-10T15:41:06Zdeivid (David Rodríguez)
<ul></ul><p>I disagree on removing this option, I don't think the benefits of removing it are strong enough, even if it didn't make any difference in performance.</p> Ruby master - Feature #17684: Remove `--disable-gems` from release version of Rubyhttps://redmine.ruby-lang.org/issues/17684?journal_id=908742021-03-11T00:40:44Zhsbt (Hiroshi SHIBATA)hsbt@ruby-lang.org
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/90874/diff?detail_id=59506">diff</a>)</li></ul> Ruby master - Feature #17684: Remove `--disable-gems` from release version of Rubyhttps://redmine.ruby-lang.org/issues/17684?journal_id=909032021-03-13T11:02:24ZNuriYuri (Youri Nouri)
<ul></ul><p>I'm also using the --disable-gems option. I make games on Ruby but I'm not using gems and since the main audience is Windows, I have to distribute portable Ruby version that HAS to work on any path (including those with accents). I noticed that the rubygems are causing a lot of issues when the game needs to load native extensions (FMOD, SFML, sockets...) so I disable the gems and if they're needed, we include them <strong>explicitely</strong> using the <code>require 'rubygems'</code> command.</p>
<p>I would suggest that people who needs gems require rubygems manually or that ruby load rubygems automatically only if the script has a Gemfile (I bet this might already be handled by bundler & the bundle exec command).</p> Ruby master - Feature #17684: Remove `--disable-gems` from release version of Rubyhttps://redmine.ruby-lang.org/issues/17684?journal_id=909042021-03-13T12:50:29ZEregon (Benoit Daloze)
<ul></ul><p>I think <code>--disable-gems</code> is also useful to investigate issues, e.g. RubyGems used to override <code>Kernel#warn</code> (fixed in Ruby 3).<br>
It can significantly simplify investigating issues with <code>require</code>.<br>
I agree it's not very common to need it for debugging, but it turned up useful a couple times.<br>
If it's not available for releases then it becomes inconvenient to investigate such cases.</p>
<p>Also the impact on startup time is still significant, so for very short scripts it can be noticeable (especially if calling out to subprocesses or running many small scripts).<br>
That's something that can potentially be improved in CRuby and/or RubyGems.<br>
For instance by loading RubyGems lazily (<code>autoload :Gem</code>, try loading <code>rubygems</code> the first time <code>require</code> fails), which TruffleRuby does.</p>
<p>Finally, I guess for JITs it's quite useful to limit the amount of Ruby code loaded and run on startup, so having <code>--disable-gems</code> to investigate JIT issues seems useful.<br>
If it only works on development builds, then again it's inconvenient to investigate a bug report from a user using a release.</p> Ruby master - Feature #17684: Remove `--disable-gems` from release version of Rubyhttps://redmine.ruby-lang.org/issues/17684?journal_id=909312021-03-15T17:41:49Ztenderlovemaking (Aaron Patterson)tenderlove@ruby-lang.org
<ul></ul><p>I like using <code>--disable-gems</code> for scripts that need to be fast. For example, I call <code>ruby</code> from Vim to get some information about the Ruby environment:</p>
<pre><code>" Add stdlib of environment's ruby to path
let g:stdlib = system('ruby --disable-gems -rrbconfig -e"print RbConfig::CONFIG[\"rubylibdir\"]"')
let &path .= "," . stdlib
let g:ruby_path = &path
</code></pre>
<p>Adding 60ms (or more) for these "fast commands" would be pretty annoying.</p>
<pre><code>[aaron@tc-lan-adapter ~]$ time ruby --disable-gems -rrbconfig -e"print RbConfig::CONFIG[\"rubylibdir\"]"
/Users/aaron/.rubies/ruby-trunk/lib/ruby/3.1.0
________________________________________________________
Executed in 20.60 millis fish external
usr time 12.12 millis 146.00 micros 11.98 millis
sys time 6.33 millis 741.00 micros 5.59 millis
[aaron@tc-lan-adapter ~]$ time ruby -rrbconfig -e"print RbConfig::CONFIG[\"rubylibdir\"]"
/Users/aaron/.rubies/ruby-trunk/lib/ruby/3.1.0
________________________________________________________
Executed in 79.02 millis fish external
usr time 61.54 millis 115.00 micros 61.43 millis
sys time 14.46 millis 679.00 micros 13.78 millis
</code></pre> Ruby master - Feature #17684: Remove `--disable-gems` from release version of Rubyhttps://redmine.ruby-lang.org/issues/17684?journal_id=909322021-03-15T17:56:59Zlugray (Lisa Ugray)
<ul></ul><p>I also have a use case where I use <code>--disable-gems</code> for performance. I maintain a tool that provides some shell hooks in ruby, and any slow down in getting to a prompt is incredibly noticeable.</p> Ruby master - Feature #17684: Remove `--disable-gems` from release version of Rubyhttps://redmine.ruby-lang.org/issues/17684?journal_id=909342021-03-15T22:23:17ZEregon (Benoit Daloze)
<ul></ul><p>Another use case: Bundler's <code>--standalone</code> mode knows all gem directories and doesn't need to load either RubyGems or Bundler, which can save quite some time on application startup.<br>
It seems a shame if it would still load RubyGems needlessly due to removing <code>--disable-gems</code>.</p> Ruby master - Feature #17684: Remove `--disable-gems` from release version of Rubyhttps://redmine.ruby-lang.org/issues/17684?journal_id=909372021-03-15T23:31:39Ztenderlovemaking (Aaron Patterson)tenderlove@ruby-lang.org
<ul></ul><p>I forgot another place I use <code>--disable-gems</code>. I think RubyGems does lots of IO at startup, and IO is extremely slow on my Raspberry PI. I'm using Ruby on Raspberry PI for some IoT stuff around my house and I use <code>--disable-gems</code> in those environments. Here is the difference:</p>
<pre><code>pi@lcd-screen:~ $ time ruby -v --disable-gems -e' '
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [armv6l-linux-eabihf]
real 0m0.291s
user 0m0.118s
sys 0m0.082s
pi@lcd-screen:~ $ time ruby -v -e' '
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [armv6l-linux-eabihf]
real 0m2.395s
user 0m1.998s
sys 0m0.129s
</code></pre>
<p>My Ruby installation only has the default gems installed, but RubyGems adds 2 seconds to startup.</p> Ruby master - Feature #17684: Remove `--disable-gems` from release version of Rubyhttps://redmine.ruby-lang.org/issues/17684?journal_id=909622021-03-17T06:31:24Zshyouhei (Shyouhei Urabe)shyouhei@ruby-lang.org
<ul></ul><p>My gut feeling is that it's miserable for people to confuse <code>--disable-gems</code> as a zero-cost speed boost option. Maybe rubygems is too slow now.</p> Ruby master - Feature #17684: Remove `--disable-gems` from release version of Rubyhttps://redmine.ruby-lang.org/issues/17684?journal_id=909632021-03-17T06:37:08Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>Applied in changeset <a class="changeset" title="[Feature #17684] Declare --disable-gems is for debugging" href="https://redmine.ruby-lang.org/projects/ruby-master/repository/git/revisions/d58daad37bd5fd09c7ff74be17074fc51faac8d3">git|d58daad37bd5fd09c7ff74be17074fc51faac8d3</a>.</p>
<hr>
<p>[Feature <a class="issue tracker-2 status-2 priority-4 priority-default" title="Feature: Remove `--disable-gems` from release version of Ruby (Assigned)" href="https://redmine.ruby-lang.org/issues/17684">#17684</a>] Declare --disable-gems is for debugging</p> Ruby master - Feature #17684: Remove `--disable-gems` from release version of Rubyhttps://redmine.ruby-lang.org/issues/17684?journal_id=909642021-03-17T06:39:49Znaruse (Yui NARUSE)naruse@airemix.jp
<ul></ul><p>At this time we just update <code>--help</code>.<br>
The conclusion of ruby core's discussion is</p>
<ul>
<li>As the first step, let’s update the --help to explicitly state that --disable-gems is just for debugging</li>
<li>If rubygems startup becomes so fast in future, we can consider removal of --disable-gems (but still it is desirable for debugging)</li>
<li>Or someone who happen to report about --disable-gems again, we will consider again.</li>
</ul>
<p>We also discuss RubyGem accesses too many files in startup. We expect gem team improve that.<br>
<a href="https://gist.github.com/ko1/f0d8c899d580f7f69bb5608ab6d8215f" class="external">https://gist.github.com/ko1/f0d8c899d580f7f69bb5608ab6d8215f</a></p> Ruby master - Feature #17684: Remove `--disable-gems` from release version of Rubyhttps://redmine.ruby-lang.org/issues/17684?journal_id=950202021-12-02T08:10:39Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-1 priority-4 priority-default" href="/issues/18376">Feature #18376</a>: Version comparison API</i> added</li></ul> Ruby master - Feature #17684: Remove `--disable-gems` from release version of Rubyhttps://redmine.ruby-lang.org/issues/17684?journal_id=963502022-02-02T20:32:35ZEregon (Benoit Daloze)
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-7 priority-4 priority-default closed" href="/issues/18568">Feature #18568</a>: Explore lazy RubyGems boot to reduce need for --disable-gems</i> added</li></ul> Ruby master - Feature #17684: Remove `--disable-gems` from release version of Rubyhttps://redmine.ruby-lang.org/issues/17684?journal_id=1006112022-12-13T02:27:46Zhsbt (Hiroshi SHIBATA)hsbt@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Closed</i> to <i>Open</i></li></ul> Ruby master - Feature #17684: Remove `--disable-gems` from release version of Rubyhttps://redmine.ruby-lang.org/issues/17684?journal_id=1006122022-12-13T02:28:06Zhsbt (Hiroshi SHIBATA)hsbt@ruby-lang.org
<ul><li><strong>Related to</strong> <i><a class="issue tracker-5 status-5 priority-4 priority-default closed" href="/issues/19178">Misc #19178</a>: How does CRuby handle CVE issues in stdlib gems which get patched?</i> added</li></ul> Ruby master - Feature #17684: Remove `--disable-gems` from release version of Rubyhttps://redmine.ruby-lang.org/issues/17684?journal_id=1023392023-03-10T11:57:55Zhsbt (Hiroshi SHIBATA)hsbt@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>hsbt (Hiroshi SHIBATA)</i></li></ul>