Closes https://github.com/rubygems/rubygems/issues/7076
Bundler will now use the same (shared) remote fetcher instance that
RubyGems uses.
This will allow installs to use a shared connection pool, which
represents a significant performance improvement on a clean install.
cd87b40fe1
We have this code that started failing on 3.3.0-dev recently:
```
irb(main):002> require File.join(RbConfig::CONFIG["rubylibdir"], "observer.rb")
/opt/rubies/3.3.0-dev-09-29/lib/ruby/3.3.0+0/bundled_gems.rb:86:in `<': comparison of String with nil failed (ArgumentError)
end + " which #{RUBY_VERSION < SINCE[gem] ? "will be" : "is"} not part of the default gems since Ruby #{SINCE[gem]}"
^^^^^^^^^^
from /opt/rubies/3.3.0-dev-09-29/lib/ruby/3.3.0+0/bundled_gems.rb:86:in `warning?'
from /opt/rubies/3.3.0-dev-09-29/lib/ruby/3.3.0+0/bundled_gems.rb:92:in `block in <module:BUNDLED_GEMS>'
from <internal:/opt/rubies/3.3.0-dev-09-29/lib/ruby/3.3.0+0/rubygems/core_ext/kernel_require.rb>:42:in `block in require'
from <internal:/opt/rubies/3.3.0-dev-09-29/lib/ruby/3.3.0+0/rubygems/core_ext/kernel_require.rb>:39:in `synchronize'
from <internal:/opt/rubies/3.3.0-dev-09-29/lib/ruby/3.3.0+0/rubygems/core_ext/kernel_require.rb>:39:in `require'
from (irb):2:in `<main>'
from <internal:kernel>:187:in `loop'
from /opt/rubies/3.3.0-dev-09-29/lib/ruby/gems/3.3.0+0/gems/irb-1.8.1/exe/irb:9:in `<top (required)>'
from /Users/byroot/.gem/ruby/3.3.0/bin/irb:25:in `load'
from /Users/byroot/.gem/ruby/3.3.0/bin/irb:25:in `<main>'
```
d67eddb295
The dedicated method `File.path` to deal with pathname-like objects
has been provided since ruby 1.9.0.
Also adds a test for rubygems/rubygems#6837.
258c6eda80
Previously we would instantiate two different packages and extract the
specification from the package twice for each gem installed. We can
reuse the installer for this so that we just need to do it once.
e454f850b1
We can skip most stuff in `Gem::RemoteFetcher#download`, and use
`Gem::RemoteFetcher#update_cache_path` directly.
This has the benefit of allowing us to remove some workarounds to
support several rubygems versions, but also allows us to pass the target
folder where the gem should be downloaded directly and skip the logic
inside `Gem::RemoteFetcher#download` to infer the cache path. This will
be useful later to fix some issues with the `global_gem_cache` feature
flag.
8fe74a77e4
These methods rescue a constant defined by `rubygems/remote_fetcher`,
so they should technically require it.
The require is provided by `gem_remote_fetcher` anyways but I was
running a unit spec that stubs that method, so I was getting an
undefined constant error hiding another error.
8bedae4034
When `install_with_build_args` was added in
be96283985,
there were two versions of the method: the default version in the base class that still
used the locking `with_build_args`, and an override in the `Future`
class (for Rubygems 2.0 and up) that yielded without calling
`with_build_args`.
The `with_build_args` version of the method was removed in
8a5b71e3e8
while removing a bunch of the old Rubygems compatibility code.
This commit removes `with_build_args`, since it no longer appears to be
used (the build args are passed as a keyword argument to
`spec.source.install` instead, since
be96283985).
The commit also removes `install_with_build_args` and the conditional
around it, since the method wasn't doing anything different than
`install`, and it had a comment that was no longer accurate.
ba543a60eb