Commit graph

1508 commits

Author SHA1 Message Date
pjsk
fe3ed3e7f3
[rubygems/rubygems] Update tests to respect token for where v2 and v1 are invoked
261315e399
2025-08-06 10:46:46 +09:00
pjsk
374f7dbcbb
[rubygems/rubygems] removed global variables
42c5947dbe
2025-08-06 10:46:46 +09:00
pjsk
01ae9e4fb0
[rubygems/rubygems] implement fallback
e09a6ec815
2025-08-06 10:46:46 +09:00
pjsk
23b34517bd
[rubygems/rubygems] Surgery on test code to make fallback to imdsv1 easier to test
5b4eece722
2025-08-06 10:46:46 +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
Kazuki Yamaguchi
32977f3869 [rubygems/rubygems] Avoid openssl bug in test_verify_certificate_extra_message
OpenSSL::X509::StoreContext#current_cert returns an empty and invalid
OpenSSL::X509::Certificate instance if it is called before starting a
certificate verification.
https://redirect.github.com/ruby/openssl/pull/919 will change it to
return nil instead in such a case.

Adjust test_verify_certificate_extra_message to actually complete
StoreContext#verify so that it will not rely on this behavior.

823799088d
2025-07-28 17:02:57 +09:00
Hiroshi SHIBATA
4dec4fbdfa
[rubygems/rubygems] Define dummy module for mise plugin
64bdff1e1e
2025-07-22 18:41:57 +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
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
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
dependabot[bot]
70da38510f
[rubygems/rubygems] Bump the rb-sys group across 2 directories with 1 update
Bumps the rb-sys group with 1 update in the /test/rubygems/test_gem_ext_cargo_builder/custom_name/ext/custom_name_lib directory: [rb-sys](https://github.com/oxidize-rb/rb-sys).
Bumps the rb-sys group with 1 update in the /test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example directory: [rb-sys](https://github.com/oxidize-rb/rb-sys).

Updates `rb-sys` from 0.9.115 to 0.9.116
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.115...v0.9.116)

Updates `rb-sys` from 0.9.115 to 0.9.116
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.115...v0.9.116)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-version: 0.9.116
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rb-sys
- dependency-name: rb-sys
  dependency-version: 0.9.116
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rb-sys
...

Signed-off-by: dependabot[bot] <support@github.com>

dbb7447901
2025-07-02 10:34:19 +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
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
4245d522b2
[rubygems/rubygems] Allow enabling "Bundler 3 mode" more easily
Currently to test Bundler 3 mode we have to actually edit the version
file to simulate we're running a future version. This is inconvenient.

Instead, allow passing an environment variable, `BUNDLER_3_MODE`, to set
the "working mode" Bundler should use.

This can now be set easily by end users to enable them to try out the
changes in the future version and give us feedback.

It's unclear how version auto-switching should work when this
environment variable is set, so the auto-switching feature will be
disabled in that case.

4e92e9b209
2025-06-19 10:23:36 +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
0c2f0ffa60
[rubygems/rubygems] Refactor some logic to create extconf files for tests
9a859078ab
2025-06-17 15:09:34 +09:00
David Rodríguez
fadcee3ba0
[rubygems/rubygems] Use Dir.chdir with a block
I don't see any warnings.

395df777a2
2025-06-17 15:09:34 +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
David Rodríguez
6560083c39 [rubygems/rubygems] Normalize file existence helpers usage
a61cc97cd4
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
Nicholas La Roux
869a52f33a
[rubygems/rubygems] Partially phase out x64-mingw32 in favour of x64-mingw-ucrt (platforms)
- the x64-mingw32 platform has been superseded by x64-mingw-ucrt
- the mingw-ucrt platform is present as of Windows 10, which was released 10 years ago in 2015 and all versions prior to 10 are end-of-life and 10 will be by mid October 2025
- newer rubies use the mingw-ucrt platform instead of the mingw32 platform, meaning using the deprecated platform can cause issues during gem installation

b9d871022e
2025-06-03 07:47:14 +09:00
John Bampton
a763716a96
[rubygems/rubygems] misc: fix spelling
0e40e7d938
2025-06-03 07:47:14 +09:00
John Bampton
d064fd067b [rubygems/rubygems] test(ruby): fix spelling
398bc1365e
2025-05-28 13:34:40 +09:00
dependabot[bot]
874469e7ce
[rubygems/rubygems] Bump the rb-sys group across 2 directories with 1 update
Bumps the rb-sys group with 1 update in the /test/rubygems/test_gem_ext_cargo_builder/custom_name/ext/custom_name_lib directory: [rb-sys](https://github.com/oxidize-rb/rb-sys).
Bumps the rb-sys group with 1 update in the /test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example directory: [rb-sys](https://github.com/oxidize-rb/rb-sys).

Updates `rb-sys` from 0.9.111 to 0.9.115
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.111...v0.9.115)

Updates `rb-sys` from 0.9.111 to 0.9.115
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.111...v0.9.115)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-version: 0.9.115
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rb-sys
- dependency-name: rb-sys
  dependency-version: 0.9.115
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rb-sys
...

Signed-off-by: dependabot[bot] <support@github.com>

a7c0ff5641
2025-05-26 11:46:13 +09:00
Nathan Ladd
3ac239f790 [rubygems/rubygems] Copy prerelease attribute to dependency resolver sets
5956e7f8e5
2025-05-21 11:33:32 +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
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
David Rodríguez
a89460a8a0
[rubygems/rubygems] Reenable skipped specs in truffleruby since they should be fixed
a7cbec95c1
2025-05-14 15:13:45 +09:00
Ellen Marie Dash
a41eed99c0
[rubygems/rubygems] Update TarWriter test to store mtime in a variable
0e2cec3fa3
2025-05-08 18:03:04 +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
51952929e1
[rubygems/rubygems] Fixed rubocop issue: Layout/SpaceInsideBlockBraces
77a52b011a
2025-04-16 14:10:36 +09:00
Nobuyoshi Nakada
2cf95e2e04
Run the proper version of rake 2025-04-16 08:29:23 +09:00
Hiroshi SHIBATA
6bd5a51ab5 Removed Solaris conditions from test files
We no longer execute those files with Solaris platforms.
2025-04-02 16:24:47 +09:00
Hiroshi SHIBATA
67a7d4a0a8 [rubygems/rubygems] Bump up minimum required version for cmake 4
3e77caeddf
2025-04-01 15:58:24 +09:00
Ellen Marie Dash
af594f5166 [rubygems/rubygems] Have "gem exec" sort executable names in error message.
This decouples `gem exec` behavior (and tests) from the sort order of
the gemspec.

911cd29159
2025-03-27 13:57:25 +09:00
Ellen Marie Dash
6982b80a8b [rubygems/rubygems] Default to a SOURCE_DATE_EPOCH of 315619200, to simplify reproducible builds.
1d5a627398
2025-03-24 13:25:07 +09:00
David Rodríguez
4fe882e2c9 [rubygems/rubygems] Let gem exec raise an error in ambiguous cases
When `gem exec foo` is run, and "foo" is a gem that has multiple
executables, none of them named "foo", raise an error explaining the
situation and telling user to be more specific.

Currently the first command in the executables array is run, but this
may come as surprising sometimes, so better raise an error.

acda5d8f6e
2025-03-24 13:25:07 +09:00
David Rodríguez
e21e5bc814 [rubygems/rubygems] Fix gem rdoc not working with newer versions of rdoc
369f9b9311
2025-03-10 12:43:36 +09:00
dependabot[bot]
7b3a0c65b9 [rubygems/rubygems] Bump the rb-sys group across 2 directories with 1 update
Bumps the rb-sys group with 1 update in the /test/rubygems/test_gem_ext_cargo_builder/custom_name/ext/custom_name_lib directory: [rb-sys](https://github.com/oxidize-rb/rb-sys).
Bumps the rb-sys group with 1 update in the /test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example directory: [rb-sys](https://github.com/oxidize-rb/rb-sys).

Updates `rb-sys` from 0.9.110 to 0.9.111
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.110...v0.9.111)

Updates `rb-sys` from 0.9.110 to 0.9.111
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.110...v0.9.111)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rb-sys
- dependency-name: rb-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rb-sys
...

Signed-off-by: dependabot[bot] <support@github.com>

6452a6d6cd
2025-03-03 15:52:35 +09:00
Hiroshi SHIBATA
e0c0e06154 Skip fiddle assertions if fiddle is not available 2025-02-25 15:36:46 +09:00
Hiroshi SHIBATA
b7c87ccd79 [rubygems/rubygems] Added fiddle dependency for TestGemExtCargoBuilder
a7c6696ffd
2025-02-25 15:36:46 +09:00
David Rodríguez
4f7dfbe58e
[rubygems/rubygems] Remove no longer necessary JRuby specific test ENV
It does not seem noisy anymore.

060c5e960a
2025-02-19 11:04:09 +09:00