Commit graph

1491 commits

Author SHA1 Message Date
pjsk
01ae9e4fb0
[rubygems/rubygems] implement fallback
e09a6ec815
2025-08-06 10:46:46 +09:00
pjsk
720ae3285e
[rubygems/rubygems] make things a bit more testable
29c085f5f5
2025-08-06 10:46:46 +09:00
Frank Olbricht
8691a4ada1
[rubygems/rubygems] Use IMDSv2 for S3 instance credentials
fa1c51ef59
2025-08-06 10:46:46 +09:00
Hiroshi SHIBATA
4d26ccd2af [rubygems/rubygems] Allow to use Gem::Deprecate#rubygems_deprecate and rubygems_deprecate_command without rubygems.rb
4925403686
2025-08-06 06:23:03 +09:00
Hiroshi SHIBATA
052b38a5d9 [rubygems/rubygems] Deprecate Gem::Specification#datadir and will remove it at RG 4.1
e99cdab171
2025-08-06 06:23:02 +09:00
Hiroshi SHIBATA
51f88f9922 [rubygems/rubygems] Added ability for changing deprecated version from only next major
15177de84e
2025-08-06 06:23:02 +09:00
Hiroshi SHIBATA
19336a6392 [rubygems/rubygems] Removed compatibility.rb that file is for Ruby 1.9.
120c174e7f
2025-08-06 06:23:01 +09:00
David Rodríguez
851a3e7724 [rubygems/rubygems] Restore treating "--" as an unknown platform
Rather than crashing when parsing it.

aa0064e4c7
2025-07-17 11:07:22 +09:00
David Rodríguez
7a03a02bee
[rubygems/rubygems] Fix more warnings when running old Bundler with latest RubyGems
Also fix platform warnings when Bundler's entrypoint is bundler's
binstub.

4b1df58403
2025-07-14 11:52:14 +09:00
David Rodríguez
c3d41492e1
[rubygems/rubygems] Avoid more warnings when using RubyGems with old Bundler
We were only avoiding them when the RUBYGEMS_GEMDEPS variable is used.
Avoid the warnings in general, whenever the entrypoint to Bundler is
`require`.

8683faef36
2025-07-14 11:52:14 +09:00
David Rodríguez
1c48aa6f4a
[rubygems/rubygems] Move loading Bundler without platform warnings to a method
e068f0649a
2025-07-14 11:52:14 +09:00
David Rodríguez
4651d235db
[rubygems/rubygems] No need to detect ancient binstubs either
346d491a11
2025-07-14 11:52:14 +09:00
David Rodríguez
15751af90b
[rubygems/rubygems] Improve some heredoc indentations
6ee3a33048
2025-07-14 11:52:13 +09:00
David Rodríguez
f1cbd58acc
[rubygems/rubygems] Stop generating binstubs with support for RubyGems before 2.6.2
RubyGems generated binstubs still provide support for this ancient
version. This makes no sense since we prevent downgrades to such old
versions.

089cdc3b77
2025-07-14 11:52:13 +09:00
Hiroshi SHIBATA
8cc109a86f [rubygems/rubygems] Update vendored resolv to 0.6.2
afbbc02763
2025-07-10 15:40:07 +09:00
Peteris Rudzusiks
3feba181ed [rubygems/rubygems] Let s3_uri_signer accept the HTTP method
35fc7f9547
2025-07-09 13:48:37 +09:00
Peteris Rudzusiks
5d880b75ef [rubygems/rubygems] Correctly sign S3 HEAD requests
We sometimes send HEAD requests. The s3_uri_signer.rb code allways assumed GETs.
This lead to consistently getting 403 responses back from S3. Recently, S3
attempted to change the behaviour of how 403s are handled when TCP connections
are reused,  which escalated this bug from "just noise" to "breaks gem installs".
They've reverted that behaviour, so the severity of this problem is back to
"just noise". Either way, it's a bug in rubygems and warrants a fix it.

c38f502b73
2025-07-09 13:48:36 +09:00
Peteris Rudzusiks
af6012b942 [rubygems/rubygems] Fix date format in S3 URI signer
%M is minute of the hour.
%m is month of year.
We want the former, not the latter.

d7ca3fa279
2025-07-09 13:48:35 +09:00
License Update
e1d09ffe5d [rubygems/rubygems] Update SPDX license list as of 2025-07-01
56b55a198a
2025-07-07 11:53:15 +09:00
Hiroshi SHIBATA
0761af2399 [rubygems/rubygems] Added push_rubygem to default scope at gem signin command
9b9ba0bf1e
2025-06-30 12:56:50 +09:00
MSP-Greg
fb2f89d867 [rubygems/rubygems] Add missing require "fileutils" in lib/rubygems/installer.rb
9a9d0e423e
2025-06-25 22:41:49 +09:00
Nicholas La Roux
a1d62a3b1c [rubygems/rubygems] Handle RubyGems installing to custom dir with non-existent parent dirs
4701123601
2025-06-23 11:07:03 +09:00
David Rodríguez
0a62e82ac4
[rubygems/rubygems] Fix gem install sometimes compiling the wrong source files
If a previous copy of a gem is already installed, RubyGems will not
reinstall the gem but only recompile its extensions. This seems like a
good idea, but only if the gem is being installed from the registry.

If we are installing a locally built package, then the package should be
completely reinstalled and extensions compiled from the sources in the
locally built package, not from the sources in the previous
installation.

1c282d98d5
2025-06-17 15:09:34 +09:00
David Rodríguez
ddb412f680 [rubygems/rubygems] Fix redefinition warnings when using modern RubyGems with old Bundler
ce7e8e92ca
2025-06-16 10:03:36 +09:00
Samuel Giddins
73532ecf3a [rubygems/rubygems] Update bundled tls certs
By running tool/update_bundled_ca_certificates.rb

Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

54f5278450
2025-06-13 12:55:13 +09:00
Hiroshi SHIBATA
166ff187bd [rubygems/rubygems] Removed ccache or sccache from args of Rust builder
```
 "  = note: some arguments are omitted. use `--verbose` to show all linker arguments\n" +
 "  = note: error: unexpected argument '-W' found\n" +
 "          \n" +
 "            tip: to pass '-W' as a value, use '-- -W'\n" +
 "          \n" +
 "          Usage: sccache [OPTIONS] <--dist-auth|--debug-preprocessor-cache|--dist-status|--show-stats|--show-adv-stats|--start-server|--stop-server|--zero-stats|--package-toolchain <EXE> <OUT>|CMD>\n" +
 "          \n" +
 "          For more information, try '--help'.\n" +
 "          \n" +
```

45e688ae62
2025-06-12 14:28:43 +09:00
David Rodríguez
dba72134de [rubygems/rubygems] Fix gem pristine sometimes not resetting extensions
If `gem pristine foo` is run, and there's a default copy of foo, only
executables for it are reset. However, that was causing other copies of
`foo` to only reset executables, which is unexpected.

We should not modify `options[:only_executables]`, but respect its value
for every gem, and make sure special handling for default gems does not
leak to other gems.

2c3039f1b0
2025-06-11 08:48:57 +09:00
Samuel Giddins
7e3d271f76 [rubygems/rubygems] Install the best matching gem for the current platform in gem install
Instead of picking essentially a random matching platform

Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

3727096297
2025-06-11 08:48:56 +09:00
Samuel Giddins
c0a1e877b3
Move most of Bundler::GemHelpers to Gem::Platform
This will help centralize wheel platform selection logic eventually

Signed-off-by: Samuel Giddins <segiddins@segiddins.me>
2025-06-06 10:22:18 +09:00
Antoine Marguerie
11492bd88d [rubygems/rubygems] Fix headings levels in Changelogs
And adapt release scripts and configuration to the new structure.

3deb1aedae
2025-06-05 19:12:39 +09:00
John Bampton
a763716a96
[rubygems/rubygems] misc: fix spelling
0e40e7d938
2025-06-03 07:47:14 +09:00
Nathan Ladd
3ac239f790 [rubygems/rubygems] Copy prerelease attribute to dependency resolver sets
5956e7f8e5
2025-05-21 11:33:32 +09:00
David Rodríguez
aea603615f [rubygems/rubygems] Missing tweak
407c1cbcfe
2025-05-19 11:15:30 +09:00
Samuel Giddins
4be199e435 [rubygems/rubygems] Simplify Gem::Platform#initialize
Based on PR feedback

Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

562d7aa087
2025-05-19 11:15:29 +09:00
Samuel Giddins
8f61e17556 [rubygems/rubygems] RuboCop
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

768784910b
2025-05-19 11:15:29 +09:00
Samuel Giddins
eb48418b40 [rubygems/rubygems] Ensure that Gem::Platform parses strings to a fix point
The issue was that the property that

```ruby
platform = Gem::Platform.new $string
platform == Gem::Platform.new(platform.to_s)
```

was not always true.

This property (of acchieving a fix point) is important,
since `Gem::Platform` gets serialized to a string and
then deserialized back to a `Gem::Platform` object.
If it doesn't deserialize to the same object, then
different platforms are used for the initial serialization
than subsequent runs.

I used https://github.com/segiddins/Scratch/blob/main/2025/03/rubygems-platform.rb
to find the failing cases and then fixed them.
With this patch, the prop check test now passes.

313fb4bcec
2025-05-19 11:15:28 +09:00
Hiroshi SHIBATA
f855bcc6b2
Applied rake vendor:install 2025-05-14 15:13:45 +09:00
Hiroshi SHIBATA
e46fbe624a Psych and SafeYAML was loaded Gem.load_yml, these changes is unnecessary 2025-05-13 15:49:20 +09:00
Hiroshi SHIBATA
4d9a1d5b6f Handle to look up CGI::EscapeExt instead of using LoadError. cgi/escape is provided snce Ruby 2.3 2025-05-13 14:37:24 +09:00
Satoshi Tagomori
382645d440 namespace on read 2025-05-11 23:32:50 +09:00
Hiroshi SHIBATA
a61f51f66d Use cgi/escape instead of cgi/util 2025-05-09 14:27:28 +09:00
Yusuke Nakamura
819ecd115d
[rubygems/rubygems] Add mtime to Gem::Package::TarWriter#add_file argument
Since 9e21dd9, Gem::Package::TarWriter#add_file adds the file to
the tar with Gem.source_date_epoch for its mtime.
This behavior breaks the code depending on the previous add_file
behavior.
Therefore, add_file accepts mtime as an argument, and uses
Gem.source_date_epoch if not specified.

7020ea98a0
2025-05-08 18:03:04 +09:00
Mike Perham
5d0708378e
[rubygems/rubygems] Smoother authentication experience
Copying the URL is painful here because the URL is embedded within a paragraph of text. I presume we don't want to automatically open the browser.

Instead, move the URL to its own line so that "triple click" will automatically select the whole thing.

21532a69ae
2025-05-02 09:49:15 +09:00
Hiroshi SHIBATA
b3566e9ef2 [rubygems/rubygems] bin/rubocop -a --only Style/StringLiterals
62e1bf2d37
2025-04-25 16:25:21 +09:00
David Rodríguez
6f336d1b15
[rubygems/rubygems] Remove shellwords autoload
2af1646776
2025-04-25 11:12:03 +09:00
Hiroshi SHIBATA
f0dda0534b Rewrite CGI.parse with URI.decode_www_form_component
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2025-04-24 12:15:11 +09:00
Hiroshi SHIBATA
a88c5b501c Use cgi/util if that uses like CGI.escape methods 2025-04-24 12:15:11 +09:00
Jeremy Evans
51d0e58772
[rubygems/rubygems] Avoid unnecessary splat allocation
Because get_push_scope is a method call, Ruby will allocate an array
for *args even though it is not necessary to do so. Using a local
variable avoids the allocation.

Found by the performance warning in Ruby feature 21274.

0473c0cf32
2025-04-22 11:27:24 +09:00
David Rodríguez
79f3167e0b [rubygems/rubygems] Let compact index response parser consistently return a mutable dependencies array
That restores support for compact index dummy implementations that only lists
versions, without checksums or dependencies.

This format is undocumented, so we may want to get rid of it in the
future. However, some of our tests rely on it, and some implementations
did use it (gems.mutant.dev at least). And the way the code was written
suggest that support was intentional.

So for now, we should restore it.

0427d8c983
2025-04-01 09:57:40 +09:00
Giacomo Benedetti
fce2c386a5 [rubygems/rubygems] Sorting files in metadata for reproducibility
792117980b
2025-04-01 09:55:19 +09:00