Commit graph

88 commits

Author SHA1 Message Date
Hiroshi SHIBATA
d3822c9a8a Merge RubyGems/Bundler master.
Pick from 5ace20dbec
2023-01-31 10:49:08 +09:00
Hiroshi SHIBATA
a43f1d90c2 Merge RubyGems and Bundler master
from 0635c1423d
2023-01-10 15:53:07 +09:00
David Rodríguez
8f05e4f54b Update Bundler to 2.4.1 & and RubyGems to 3.4.1 2022-12-25 05:55:36 +09:00
Hiroshi SHIBATA
f6620037ba Merge RubyGems-3.4.0 and Bundler-2.4.0 2022-12-24 16:57:07 +09:00
Hiroshi SHIBATA
18ba89093a Merge RubyGems/Bundler master
Pick from ba3adad4d8
2022-12-20 13:15:02 +09:00
Hiroshi SHIBATA
49b0f3b024 Merge RubyGems/Bundler master
Pick from 084f7d1f21
2022-12-15 19:06:40 +09:00
Hiroshi SHIBATA
bbe56a6437 Merge RubyGems/Bundler master
from bfb0ae6977
2022-12-12 10:49:43 +09:00
Hiroshi SHIBATA
a4e14b9d9d Merge RubyGems/Bundler master
Pick from 823c776d95
2022-12-09 16:36:22 +09:00
Hiroshi SHIBATA
0a9d51ee9d Migrate our resolver engine to PubGrub
https://github.com/rubygems/rubygems/pull/5960

  Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
2022-11-12 07:40:31 +09:00
David Rodríguez
24fd2f73d0 Resync Bundler & RubyGems 2022-09-08 11:25:03 +09:00
Hiroshi SHIBATA
3eca1e438d Merge 16c3535413 2022-09-05 14:37:12 +09:00
Hiroshi SHIBATA
bfd09b1116 Merge rubygems master from 446cc57a7c 2022-07-29 15:46:15 +09:00
David Rodríguez
7b78aba53a [rubygems/rubygems] Account for default gems not having remote when caching
b93d4de2ff
2022-07-02 19:41:02 +09:00
David Rodríguez
9101269e94 [rubygems/rubygems] Move rubygems source specific logic to rubygems source
6aa4c422a7
2022-07-02 19:41:02 +09:00
David Rodríguez
12a5fa408b Sync RubyGems & Bundler with upstream repo 2022-06-24 10:52:02 +09:00
David Rodríguez
4f5eb48dea [rubygems/rubygems] Fix bundle package --no-install no longer skipping install
This is a regression from cf749f8ffa. The
funny thing is that we have a spec for this feature, so it was unclear
how we regressed here. It turns out there was a bug in one of our
negative matchers checking that gems ARE NOT included in a bundle.

This commit fixes the bug in the negative matcher and reverts
cf749f8ffa (with a slightly simpler diff).

3f9a4ff32a
2022-06-23 18:17:08 +09:00
David Rodríguez
7f9eb888a3 [rubygems/rubygems] Reuse package from the installer for extracting the specification
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
2022-06-11 18:43:28 +09:00
David Rodríguez
965c314e34 [rubygems/rubygems] Move security exception handling to the only place using it
ba975b3b7f
2022-06-11 18:43:27 +09:00
David Rodríguez
bf8dc36e40 [rubygems/rubygems] Swapping should not raise any errors
600a9ac658
2022-06-11 18:43:27 +09:00
David Rodríguez
6292b36529 [rubygems/rubygems] Remove unclear comment
This is the explanation of why we do the swapping, not of why we
download the gem.

1a25eb7e7b
2022-06-11 18:43:26 +09:00
David Rodríguez
52cc76d134 [rubygems/rubygems] Gem::Specification.loaded_from is already set by the installer
796eebfdbf
2022-06-11 18:43:26 +09:00
David Rodríguez
22c97ab8ae [rubygems/rubygems] Refactor some more duplicated logic
9bd389e1b6
2022-06-11 18:43:25 +09:00
David Rodríguez
95f5194b3c [rubygems/rubygems] Move no_install setting check to a more sensible place
It's only related to the `bundle cache` command, so it should be checked
there.

cf749f8ffa
2022-06-11 18:43:25 +09:00
David Rodríguez
3f69774b76 [rubygems/rubygems] No need to redownload if package already there
285ccbc07e
2022-06-11 18:43:24 +09:00
David Rodríguez
a9077af75b [rubygems/rubygems] No need to overwrite path when there's a remote
d86fb2c316
2022-06-11 18:43:24 +09:00
David Rodríguez
4a75849680 [rubygems/rubygems] Remove unnecessary spec.remote guard
It's checked before calling the method already.

4eb00e9586
2022-06-11 18:43:22 +09:00
David Rodríguez
d5288c8aad [rubygems/rubygems] Refactor ambiguous gems check
a00c79a4da
2022-06-11 18:43:22 +09:00
David Rodríguez
ea31c5bcd1 [rubygems/rubygems] Fix crash when installing gems with symlinks
If BUNDLE_PATH is configured to a symlinked path, installing gems with
symlinks would crash with an error like this:

```
Gem::Package::SymlinkError: installing symlink 'man/man0/README.markdown' pointing to parent path /usr/home/stevewi/srv/mail/lib/tools/.vendor/ruby/3.1.0/gems/binman-5.1.0/README.markdown of /srv/mail/lib/tools/.vendor/ruby/3.1.0/gems/binman-5.1.0 is not allowed
```

This commit fixes the problem by changing the bundle path to be the
realpath of the configured value, right after we're sure the path has
been created.

3cd3dd142a
2022-05-30 17:42:39 +09:00
Hiroshi SHIBATA
aeea88174d
Merge RubyGems and Bundler HEAD
125415593e
2022-05-20 17:32:19 +09:00
David Rodríguez
4c9ddaac0d [rubygems/rubygems] Fix Gemfile.lock versions leaking to bundler/inline install output
The lockfile is completely ignored in inline mode, yet the previous
output would suggest it wasn't.

763125a745
2022-05-13 15:23:56 +09:00
David Rodríguez
4962e5c417 [rubygems/rubygems] Normalize parameter name
The other sources use `options` which reads better.

a672f9d602
2022-05-13 15:23:56 +09:00
Hiroshi SHIBATA
1056489ea3 Merge 3f7d0352e8 2022-04-28 19:08:49 +09:00
Hiroshi SHIBATA
678d58c850 Merge rubygems master 1e4eda741d732ca1bd7031aef0a16c7348adf7a5 2022-04-28 19:08:49 +09:00
Hiroshi SHIBATA
d6311cb1ca Track RubyGems 3.4.0dev and Bundler 2.4.0dev 2021-12-27 10:45:36 +09:00
Nobuyoshi Nakada
9736cb890b
Check if Kernel#untaint is defined instead of version comparison
Probably `RUBY_VERSION` seems overwritten somewhere in the tests.
2021-12-27 08:56:00 +09:00
Hiroshi SHIBATA
69dc2ea465 Merge RubyGems-3.3.0 and Bundler-2.3.0 2021-12-21 15:27:05 +09:00
David Rodríguez
26303c31f0 [rubygems/rubygems] Pass "--" to git commands to separate positional and optional args
To make sure git uri's specified in Gemfile are never misinterpreted as
optional arguments, potentially allowing for local code execution.

90b1ed8b9f
2021-12-07 23:27:59 +09:00
David Rodríguez
248fae0ec4 [rubygems/rubygems] Improve sources representation
We have two representations of a source. Once used for sorting, which
should not depend on the source's state, but solely on its static
information, like remotes. Another one used for error and informational
messages, which should properly inform about the exact state of the
source when the message is printed.

This commit makes the latter be the default implementation of `to_s`, so
that error and informational messages are more accurate by default.

b5f2b88957
2021-12-03 20:00:50 +09:00
Hiroshi SHIBATA
0b53a8895f
Merge rubygems master fd676ac464491afaa0baf5435cb11b3f86229cbd 2021-12-01 11:00:10 +09:00
David Rodríguez
f634d1ee00 [rubygems/rubygems] Better error when installing a git lockfile and git not present
28f4842196
2021-10-30 06:11:39 +09:00
David Rodríguez
d8e97169ba [rubygems/rubygems] Only delete cached gem when it's corrupted
Rescuing all errors here might end up hiding other errors if the
deletion of the cached gem itself raises an error for some reason. Let's
be more conservative.

3d80dfba08
2021-10-29 02:40:35 +09:00
David Rodriguez
7073870dfa
[rubygems/rubygems] Improve readability by splitting updating the cache and searching it
d0df25bb0f
2021-10-25 20:48:51 +09:00
David Rodriguez
f7f85c1feb
[rubygems/rubygems] Manage global gem cache directly
Previously, it was maintained in sync with the standard cache. That was
less efficient, and it caused some error messages to point to non
existent files.

931f8cb8a9
2021-10-25 20:48:51 +09:00
David Rodriguez
4fc29d17b3
[rubygems/rubygems] Cached gem path resolution should consider default gems
83b2b845b3
2021-10-25 20:48:51 +09:00
David Rodriguez
4edcda67b3
[rubygems/rubygems] Simplify gem downloading inside bundler
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
2021-10-25 20:48:51 +09:00
David Rodriguez
9b1b171866
[rubygems/rubygems] Use Gem::Specification#file_name consistently
13b933f49a
2021-10-25 20:48:50 +09:00
David Rodriguez
38542cfffc
[rubygems/rubygems] Extract a default_cache_path helper
8319305d58
2021-10-25 20:48:50 +09:00
David Rodriguez
edc1813190
[rubygems/rubygems] Small refactor
Extract final cache path to a variable and pass that to `download_gem`.
It actually fits better the parameters documentation since it's the
final directory where the downloaded gem will be placed.

1429db6a04
2021-10-25 20:48:50 +09:00
Jean Boussier
5af3f7f357
[rubygems/rubygems] Vendor a pure ruby implementation of SHA1
This allows `Source::Git` to no longer load the `digest` gem as it is causing
issues on Ruby 3.1.

c19a9f2ff7
2021-10-25 20:24:32 +09:00
David Rodriguez
0f1f95a3e3 [rubygems/rubygems] Fix bundle install to force reinstallation of deleted gems
8950631f02
2021-10-13 16:21:42 +09:00