From: "Dan0042 (Daniel DeLorme) via ruby-core" Date: 2023-11-24T21:46:31+00:00 Subject: [ruby-core:115477] [Ruby master Feature#19972] Install default/bundled gems into dedicated directories Issue #19972 has been updated by Dan0042 (Daniel DeLorme). > Although RubyGems know `vendor` dir, which is not even listed by `gem env`. I think it's only listed if present ``` - GEM PATHS: - /opt/ruby/3.2/lib/ruby/gems/3.2.0 - /home/dan42/.gem/ruby/3.2.0 - /opt/ruby/3.2/lib/ruby/vendor_ruby/gems/3.2.0 ``` > My proposal is to make this flexible enough to allow the situation as you describe I definitely appreciate this flexibility and I think it's a great design. > Please note that I deliberately not using terms such as "root-installed gems" And yet we need a word to describe those gems. If we have "default" gems and "bundled" gems, then what are "gems that are installed via rubygems to the lib/ruby/gems/ dir that may actually be configured to be something else" ? I used "root-installed" gems as the closest thing I could think of, but maybe "site" gems is the best word here? > Next I could think of was to shift the meaning a bit and rename `default_gems` => `std_lib` gems and `bundled_gems` => `default_gems`, which would have its own share of issues. I had a similar thought; what about using a "gems" subdir for everything? ``` lib/ruby/ for stdlib lib/ruby/gems/ for stdgems (default (and bundled?) gems) vendor_ruby/ vendor_ruby/gems/ already the case for `gem install --vendor` site_ruby/ site_ruby/gems/ for regular `gem install` ``` ---------------------------------------- Feature #19972: Install default/bundled gems into dedicated directories https://bugs.ruby-lang.org/issues/19972#change-105406 * Author: vo.x (Vit Ondruch) * Status: Assigned * Priority: Normal * Assignee: hsbt (Hiroshi SHIBATA) ---------------------------------------- I think that the current situation, where the same directory (lets call it `Gem.default_dir`) is used for default/bundled gems as well as for user installed gems, is suboptimal. During the times, this has caused us quite some issue on Fedora. Historically, we redefined the `Gem.default_dir` to user home directory, to avoid the mixing of system gems and user installed gems. Unfortunately, with advent of default/bundled gems, we were facing issues that these gems were suddenly not listed, etc. I am realizing this issue in full once again since the "user install" RubyGems feature has landed [1]. I also think that we have arrived to this situation by evolution, not by design. Therefore my proposal is: Keep the `Gem.default_dir` for user `gem install`ed gems and lets install default and bundled gems into separate dedicated directories. Have separate `Gem.bundled_gems_dir` and `Gem.default_gems_dir` structures. Of course, if `Gem.default_dir == Gem.bundled_gems_dir == Gem.default_gems_dir`, we still can have the current layout. I have a simple POC here: https://github.com/ruby/ruby/pull/8761 BTW I have reported it here, because I think that RubyGems provides all it is needed. So it is not RubyGems ticket after all. However, I believe that RubyGems could benefit from this long term and some simplifications/cleanups would be possible. [1]: https://github.com/rubygems/rubygems/pull/5327 -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/