Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install default and bundled gems into dedicated directories #8761

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Nov 21, 2023

  1. Install default and bundled gems into dedicated directories

    Previously, all default/bundled gems were installed into single location
    such as `/usr/local/lib/ruby/gems/3.3.0+0`. However, the same location
    is used for user installed gems, which is not optimal.
    
    With this change, the default gems goes into
    `/usr/local/lib/ruby/default_gems/3.3.0+0` while the bundled gems goes
    into `/usr/local/lib/ruby/bundled_gems/3.3.0+0`. User installed gems
    continues to land in `/usr/local/lib/ruby/gems/3.3.0+0`.
    voxik committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    0034b22 View commit details
    Browse the repository at this point in the history

Commits on Nov 23, 2023

  1. Ignore default_path test cases for Ruby with custom configuration

    RubyGems provides means to override their defaults, such as
    `Gem.default_path` method. With such modified configuration, the
    following errors might be observed:
    
    ~~~
        1) Failure:
      TestGem#test_default_path_vendor_dir [/home/runner/work/ruby/ruby/src/test/rubygems/test_gem.rb:612]:
      <["/home/runner/work/ruby/ruby/build/tmp/test_rubygems_20231110-59661-qs43ch/gemhome",
       "/home/runner/work/ruby/ruby/build/tmp/test_rubygems_20231110-59661-qs43ch/vendor/gems/3.3.0+0"]> expected but was
      <["/home/runner/work/ruby/ruby/build/tmp/test_rubygems_20231110-59661-qs43ch/gemhome",
       "/home/runner/work/ruby/ruby/build/tmp/test_rubygems_20231110-59661-qs43ch/vendor/gems/3.3.0+0",
       "/usr/local/lib/ruby/bundled_gems/3.3.0+0",
       "/usr/local/lib/ruby/default_gems/3.3.0+0"]>.
      make: *** [uncommon.mk:943: yes-test-all] Error 4
    
        2) Failure:
      TestGem#test_default_path_missing_vendor [/home/runner/work/ruby/ruby/src/test/rubygems/test_gem.rb:592]:
      <["/home/runner/work/ruby/ruby/build/tmp/test_rubygems_20231110-59661-c41yb7/gemhome"]> expected but was
      <["/home/runner/work/ruby/ruby/build/tmp/test_rubygems_20231110-59661-c41yb7/gemhome",
       "/usr/local/lib/ruby/bundled_gems/3.3.0+0",
       "/usr/local/lib/ruby/default_gems/3.3.0+0"]>.
    
        3) Failure:
      TestGem#test_default_path_user_home [/home/runner/work/ruby/ruby/src/test/rubygems/test_gem.rb:600]:
      <["/home/runner/work/ruby/ruby/build/tmp/test_rubygems_20231110-59661-5mm6uc/userhome/.local/share/gem/ruby/3.3.0+0",
       "/home/runner/work/ruby/ruby/build/tmp/test_rubygems_20231110-59661-5mm6uc/gemhome"]> expected but was
      <["/home/runner/work/ruby/ruby/build/tmp/test_rubygems_20231110-59661-5mm6uc/userhome/.local/share/gem/ruby/3.3.0+0",
       "/home/runner/work/ruby/ruby/build/tmp/test_rubygems_20231110-59661-5mm6uc/gemhome",
       "/usr/local/lib/ruby/bundled_gems/3.3.0+0",
       "/usr/local/lib/ruby/default_gems/3.3.0+0"]>.
    
        4) Failure:
      TestGem#test_default_path [/home/runner/work/ruby/ruby/src/test/rubygems/test_gem.rb:582]:
      <["/home/runner/work/ruby/ruby/build/tmp/test_rubygems_20231110-59661-kan9o5/gemhome"]> expected but was
      <["/home/runner/work/ruby/ruby/build/tmp/test_rubygems_20231110-59661-kan9o5/gemhome",
       "/usr/local/lib/ruby/bundled_gems/3.3.0+0",
       "/usr/local/lib/ruby/default_gems/3.3.0+0"]>.
    ~~~
    
    Of course the `Gem.default_path` could be stubbed, but testing stub
    should not be the point.
    
    Therefore, just detect if `Gem.default_path` was customized and ignore
    the test cases.
    voxik committed Nov 23, 2023
    Configuration menu
    Copy the full SHA
    c03c566 View commit details
    Browse the repository at this point in the history