90153 Commits

Author SHA1 Message Date
Hiroshi SHIBATA
a487698cc7 Use powershell for retrieving value from registry if fiddle is not available 2025-02-05 07:36:59 +09:00
Hiroshi SHIBATA
078e723b24 Don't use nested registry open for rewriting powershell version 2025-02-05 07:36:59 +09:00
Hiroshi SHIBATA
02a9c05e3e Handle failing case to load win32/registry 2025-02-05 07:36:59 +09:00
Hiroshi SHIBATA
62b8792109 Skip irb on test-bundled-gems with Windows 2025-02-05 07:36:59 +09:00
Hiroshi SHIBATA
9052d0d534 Try to inject fiddle path as bundled gems for RJIT 2025-02-05 07:36:59 +09:00
Hiroshi SHIBATA
b50360e08b Update fiddle entries under the doc directory 2025-02-05 07:36:59 +09:00
Hiroshi SHIBATA
470784cbd9 Expand stub-out scope of Fiddle.dlopen 2025-02-05 07:36:59 +09:00
Hiroshi SHIBATA
ec2bd6f74e Skip to existence check fiddle from TestExtLibs 2025-02-05 07:36:59 +09:00
Hiroshi SHIBATA
16d446e8a5 Removed fiddle from sync target 2025-02-05 07:36:59 +09:00
Hiroshi SHIBATA
908529b7e0 Migrate fiddle as bundled gems 2025-02-05 07:36:59 +09:00
Jean Boussier
91a10c0757 Fix a typo in WeakKeyMap argument error
[Bug #21112]
2025-02-04 22:25:17 +01:00
Hiroshi SHIBATA
10d06b9a72 [ruby/resolv] Load win32/resolv with rake test
https://github.com/ruby/resolv/commit/3ecfce3626
2025-02-04 04:55:16 +00:00
Andrii Konchyn
7317f96727
Move out from quarantine a Marshal.dump spec for Float (#12692)
* Move out from quarantine a Marshal.dump spec for Float

Co-authored-by: Benoit Daloze <eregontp@gmail.com>
2025-02-03 13:24:16 +00:00
Misaki Shioi
1683dadb19
Do not save ResolutionError if resolution succeeds for any address family (#12678)
* Do not save ResolutionError if resolution succeeds for any address family

Socket with Happy Eyeballs Version 2 performs connection attempts and name resolution in parallel.

In the existing implementation, if a connection attempt failed for one address family while name resolution was still in progress for the other, and that name resolution later failed, the method would terminate with a name resolution error.
This behavior was intended to ensure that the final error reflected the most recent failure, potentially overriding an earlier error.

However, [Bug #21088](https://bugs.ruby-lang.org/issues/21088) made me realize that terminating with a name resolution error is unnatural when name resolution succeeded for at least one address family.

This PR modifies the behavior so that if name resolution succeeds for one address family, any name resolution error from the other is not saved.

This PR includes the following changes:

* Do not display select(2) as the system call that caused the raised error, as it is for internal processing

* Fix bug: Get errno with Socket::SO_ERROR in Windows environment with a workaround for tests not passing
2025-02-03 20:26:47 +09:00
Kazuki Yamaguchi
f84d75eecc [ruby/openssl] pkey/ec: remove deprecated PKey::EC::Point#mul(ary, ary [, bn]) form
The method has two forms, each corresponding to EC_POINT_mul() and
EC_POINTs_mul(). The latter form does not work with any OpenSSL or
LibreSSL versions that are still supported by upstream.

The latter form has an extremely confusing behavior, too, and using it
would print a deprecation warning since commit https://github.com/ruby/openssl/commit/812de4253d25 in 2020,
which went to 3.0.0. Let's remove it.

https://github.com/ruby/openssl/commit/7343d3c559
2025-02-03 09:47:48 +00:00
Kazuki Yamaguchi
5a14f53695 [ruby/openssl] ssl: separate SSLContext#min_version= and #max_version=
Make these methods simple wrappers around
SSL_CTX_set_{min,max}_proto_version().

When we introduced these methods in commit https://github.com/ruby/openssl/commit/18603949d316 [1], which went
to v2.1.0, we added a private method to SSLContext that set both the
minimum and maximum protocol versions at the same time. This was to
allow emulating the behavior using SSL options on older OpenSSL versions
that lack SSL_CTX_set_{min,max}_proto_version(). Since we no longer
support OpenSSL 1.0.2, the related code has already been removed.

In OpenSSL 1.1.1 or later, setting the minimum or maximum version to 0
is not equivalent to leaving it unset. Similar to SSL options, which we
avoid overwriting as of commit https://github.com/ruby/openssl/commit/00bec0d905d5 and commit https://github.com/ruby/openssl/commit/77c3db2d6587 [2],
a system-wide configuration file may define a default protocol version
bounds. Setting the minimum version should not unset the maximum
version, and vice versa.

[1] https://github.com/ruby/openssl/pull/142
[2] https://github.com/ruby/openssl/pull/767

https://github.com/ruby/openssl/commit/5766386321
2025-02-03 09:46:03 +00:00
Naoto Ono
8cbff4fe45
Add sleep to PTY tests to stabilize flaky failures (#12691) 2025-02-03 16:07:19 +09:00
Hiroshi SHIBATA
890020e392
Removed manpages for bundled gems 2025-02-03 14:43:29 +09:00
Nikita Shilnikov
e8cf441485 [ruby/weakref] Add missing block parameter
A block is part of the Delegator's contract. Ruby 3.4 issues a warning if a block is passed but unused. This commit fixes the warning by adding a block to the argument list.

https://github.com/ruby/weakref/commit/9495ec9191
2025-02-03 01:58:50 +00:00
Benoit Daloze
15e6f13ff7 [ruby/fiddle] Fix Fiddle.last_error on FFI backend and improve test
to work for all
(https://github.com/ruby/fiddle/pull/173)

https://github.com/ruby/fiddle/commit/ef2382a7ef
2025-02-03 10:22:16 +09:00
Nobuyoshi Nakada
b5b5097663 [ruby/fiddle] Define Fiddle.last_error family and Fiddle.dlopen
statically
(https://github.com/ruby/fiddle/pull/172)

`RUBY_ENGINE` and `Fiddle::WINDOWS` should not change in a process, no
need to be checked inside the methods.

Also, `win32_last_error` and `win32_last_socket_error` are equal to
`last_error` on JRuby.

https://github.com/ruby/fiddle/commit/50ac00ed53
2025-02-03 10:22:15 +09:00
dependabot[bot]
56c814a8d3 [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.108 to 0.9.110
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.108...v0.9.110)

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

---
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>

https://github.com/rubygems/rubygems/commit/a92f814b53
2025-02-03 10:05:36 +09:00
David Rodríguez
c0688c21fe [rubygems/rubygems] Raise a simpler error when RubyGems fails to activate a dependency
If you force uninstall a dependency but leave other gems depending on
it, those gems will fail to be activated.

In that case, RubyGems prints a rather complicated error:

```
$ rails --version
/Users/deivid/.asdf/installs/ruby/3.4.1/lib/ruby/site_ruby/3.4.0/rubygems/specification.rb:1413:in 'block in Gem::Specification#activate_dependencies': Could not find 'activesupport' (= 8.0.1) among 478 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/Users/deivid/.local/share/gem/ruby/3.4.0:/Users/deivid/.asdf/installs/ruby/3.4.1/lib/ruby/gems/3.4.0' at: /Users/deivid/.asdf/installs/ruby/3.4.1/lib/ruby/gems/3.4.0/specifications/railties-8.0.1.gemspec, execute `gem env` for more information
	from /Users/deivid/.asdf/installs/ruby/3.4.1/lib/ruby/site_ruby/3.4.0/rubygems/specification.rb:1399:in 'Array#each'
	from /Users/deivid/.asdf/installs/ruby/3.4.1/lib/ruby/site_ruby/3.4.0/rubygems/specification.rb:1399:in 'Gem::Specification#activate_dependencies'
	from /Users/deivid/.asdf/installs/ruby/3.4.1/lib/ruby/site_ruby/3.4.0/rubygems/specification.rb:1381:in 'Gem::Specification#activate'
	from /Users/deivid/.asdf/installs/ruby/3.4.1/lib/ruby/site_ruby/3.4.0/rubygems.rb:283:in 'block in Gem.activate_bin_path'
	from /Users/deivid/.asdf/installs/ruby/3.4.1/lib/ruby/site_ruby/3.4.0/rubygems.rb:282:in 'Thread::Mutex#synchronize'
	from /Users/deivid/.asdf/installs/ruby/3.4.1/lib/ruby/site_ruby/3.4.0/rubygems.rb:282:in 'Gem.activate_bin_path'
	from /Users/deivid/.asdf/installs/ruby/3.4.1/bin/rails:25:in '<main>'
/Users/deivid/.asdf/installs/ruby/3.4.1/lib/ruby/site_ruby/3.4.0/rubygems/dependency.rb:303:in 'Gem::Dependency#to_specs': Could not find 'activesupport' (= 8.0.1) - did find: [activesupport-7.1.3,activesupport-7.0.8.7] (Gem::MissingSpecVersionError)
Checked in 'GEM_PATH=/Users/deivid/.local/share/gem/ruby/3.4.0:/Users/deivid/.asdf/installs/ruby/3.4.1/lib/ruby/gems/3.4.0' , execute `gem env` for more information
	from /Users/deivid/.asdf/installs/ruby/3.4.1/lib/ruby/site_ruby/3.4.0/rubygems/specification.rb:1411:in 'block in Gem::Specification#activate_dependencies'
	from /Users/deivid/.asdf/installs/ruby/3.4.1/lib/ruby/site_ruby/3.4.0/rubygems/specification.rb:1399:in 'Array#each'
	from /Users/deivid/.asdf/installs/ruby/3.4.1/lib/ruby/site_ruby/3.4.0/rubygems/specification.rb:1399:in 'Gem::Specification#activate_dependencies'
	from /Users/deivid/.asdf/installs/ruby/3.4.1/lib/ruby/site_ruby/3.4.0/rubygems/specification.rb:1381:in 'Gem::Specification#activate'
	from /Users/deivid/.asdf/installs/ruby/3.4.1/lib/ruby/site_ruby/3.4.0/rubygems.rb:283:in 'block in Gem.activate_bin_path'
	from /Users/deivid/.asdf/installs/ruby/3.4.1/lib/ruby/site_ruby/3.4.0/rubygems.rb:282:in 'Thread::Mutex#synchronize'
	from /Users/deivid/.asdf/installs/ruby/3.4.1/lib/ruby/site_ruby/3.4.0/rubygems.rb:282:in 'Gem.activate_bin_path'
	from /Users/deivid/.asdf/installs/ruby/3.4.1/bin/rails:25:in '<main>'
```

With this commit, the error becomes a bit simpler to parse:

```
$ rails --version
/Users/deivid/.asdf/installs/ruby/3.4.1/lib/ruby/site_ruby/3.4.0/rubygems/specification.rb:1421:in 'block in Gem::Specification#activate_dependencies': Could not find 'activesupport' (= 8.0.1) among 478 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/Users/deivid/.local/share/gem/ruby/3.4.0:/Users/deivid/.asdf/installs/ruby/3.4.1/lib/ruby/gems/3.4.0' at: /Users/deivid/.asdf/installs/ruby/3.4.1/lib/ruby/gems/3.4.0/specifications/railties-8.0.1.gemspec, execute `gem env` for more information
	from /Users/deivid/.asdf/installs/ruby/3.4.1/lib/ruby/site_ruby/3.4.0/rubygems/specification.rb:1407:in 'Array#each'
	from /Users/deivid/.asdf/installs/ruby/3.4.1/lib/ruby/site_ruby/3.4.0/rubygems/specification.rb:1407:in 'Gem::Specification#activate_dependencies'
	from /Users/deivid/.asdf/installs/ruby/3.4.1/lib/ruby/site_ruby/3.4.0/rubygems/specification.rb:1389:in 'Gem::Specification#activate'
	from /Users/deivid/.asdf/installs/ruby/3.4.1/lib/ruby/site_ruby/3.4.0/rubygems.rb:283:in 'block in Gem.activate_bin_path'
	from /Users/deivid/.asdf/installs/ruby/3.4.1/lib/ruby/site_ruby/3.4.0/rubygems.rb:282:in 'Thread::Mutex#synchronize'
	from /Users/deivid/.asdf/installs/ruby/3.4.1/lib/ruby/site_ruby/3.4.0/rubygems.rb:282:in 'Gem.activate_bin_path'
	from /Users/deivid/.asdf/installs/ruby/3.4.1/bin/rails:25:in '<main>'
```

And also, we reduce exception based control flow in our code.

https://github.com/rubygems/rubygems/commit/7e48c49f2d
2025-02-03 10:05:34 +09:00
David Rodríguez
d645b62b6d [rubygems/rubygems] Remove already fixed TODO
It was fixed by https://github.com/rubygems/rubygems/commit/3b0d44fbf5a3.

https://github.com/rubygems/rubygems/commit/4cf3429599
2025-02-03 10:05:33 +09:00
Jean Boussier
98c56de823 [ruby/json] Refactor further to expose the simpler escape search possible
https://github.com/ruby/json/commit/e03515ac8b
2025-02-03 10:05:26 +09:00
Jean Boussier
98e1c2845a [ruby/json] Refactor convert_UTF8_to_JSON to split searching and escaping code
The goal is to be able to dispatch to more optimized search implementations
without having to duplicate the escaping code.

Somehow, this is a few % faster already:

```
== Encoding activitypub.json (52595 bytes)
ruby 3.4.1 (2024-12-25 revision https://github.com/ruby/json/commit/48d4efcb85) +YJIT +PRISM [arm64-darwin23]
Warming up --------------------------------------
               after     2.257k i/100ms
Calculating -------------------------------------
               after     22.930k (± 1.3%) i/s   (43.61 μs/i) -    115.107k in   5.020814s

Comparison:
              before:    21604.0 i/s
               after:    22930.1 i/s - 1.06x  faster

== Encoding citm_catalog.json (500298 bytes)
ruby 3.4.1 (2024-12-25 revision https://github.com/ruby/json/commit/48d4efcb85) +YJIT +PRISM [arm64-darwin23]
Warming up --------------------------------------
               after   137.000 i/100ms
Calculating -------------------------------------
               after      1.397k (± 1.1%) i/s  (715.57 μs/i) -      6.987k in   5.000408s

Comparison:
              before:     1344.4 i/s
               after:     1397.5 i/s - 1.04x  faster

== Encoding twitter.json (466906 bytes)
ruby 3.4.1 (2024-12-25 revision https://github.com/ruby/json/commit/48d4efcb85) +YJIT +PRISM [arm64-darwin23]
Warming up --------------------------------------
               after   249.000 i/100ms
Calculating -------------------------------------
               after      2.464k (± 1.8%) i/s  (405.81 μs/i) -     12.450k in   5.054131s

Comparison:
              before:     2326.5 i/s
               after:     2464.2 i/s - 1.06x  faster
```

https://github.com/ruby/json/commit/8fb5ae807f
2025-02-03 10:05:25 +09:00
Nobuyoshi Nakada
581d85058c
Add out of range tests of random number generator 2025-02-03 00:27:43 +09:00
Nobuyoshi Nakada
571f3394f2
[Bug #21106] Fix tests for custom random object
When a positive integer limit is given, `rand` method of a RNG object
is expected to return a value between 0 and the limit (exclusive).

Fix shuffle_spec.rb like as the similar code in sample_spec.rb, and
add tests for greater values.

TODO:
- Return a value that is equal to or greater than the limit given to
  the RNG object.
- Extract common code about RNG objects to a shared file.
2025-02-02 20:59:59 +09:00
Nobuyoshi Nakada
8dd0d63550
[Bug #21106] Remove the useless last iteration
When only one element remains, this simply swaps the first identical
element and has no actual effect.
2025-02-02 19:34:52 +09:00
S-H-GAMELINKS
ace39a3ed4 Remove rb_exc_raise for Parser 2025-02-02 16:58:15 +09:00
Nobuyoshi Nakada
db02a6b3ab
[Bug #21103] Fix local variable index calculation with forwarding
Forwarding argument is optimized not to packed when no other arguments
and an internal object refers values before it.  This size is decided
at called time, calculate the local variable index from the fixed end
point.
2025-02-01 22:03:47 +09:00
Nobuyoshi Nakada
71f402c5d5
[DOC] Remove the index file for bundler man pages
Those man pages are not placed here already.
2025-02-01 16:57:18 +09:00
Nobuyoshi Nakada
bff168f182
Install non-mdoc files as-is
See if the content contains `.Nm` macro, instead of the names.

This reverts "Don't convert bundler man pages from mdoc to man",
commit e0b40ef5d8173aff304c81f93516e1246e3c042c.
2025-02-01 16:22:24 +09:00
Nobuyoshi Nakada
5318a48e4e
Compress manpages automatically 2025-02-01 15:36:23 +09:00
Nobuyoshi Nakada
022ab41374 [DOC] Improve Errno and SystemCallError.new 2025-01-31 21:30:07 +09:00
Samuel Williams
0da2b12741 Prefer platform_is_not :windows. 2025-01-31 13:00:26 +01:00
Vincent Ollivier
f719b889a1 [DOC] Fix grep_v description 2025-01-31 15:41:56 +09:00
David Rodríguez
451d848a76
Stop generating binstubs for Bundler itself 2025-01-31 14:34:55 +09:00
David Rodríguez
56e2ef2468 [rubygems/rubygems] Fix bundle console unnecessarily trying to load IRB twice
https://github.com/rubygems/rubygems/commit/f9bf58573f
2025-01-31 14:34:29 +09:00
David Rodríguez
3cff46c521 [rubygems/rubygems] Remove unnecessary error handling
These gems always define their main namespace and I don't think that
will ever change.

https://github.com/rubygems/rubygems/commit/6663cbed53
2025-01-31 14:34:28 +09:00
David Rodríguez
e0f39d4cd3 [rubygems/rubygems] Test with JRuby 9.4.10.0
https://github.com/rubygems/rubygems/commit/770b19d859
2025-01-31 14:34:27 +09:00
Edouard CHIN
2ed30c9944 [rubygems/rubygems] Consolidate the platform into a single list:
- Similar change than https://github.com/rubygems/rubygems/commit/29a1be0008e6,
  keep a single source of truth where we store the platform.

  The only change worth highlighing is the platform "maglev".
  It was not part of the supported platform of dependencies,
  so calling `gem 'foo', plaftorm: 'maglev'` would not work.
  However, it was supposed to according to https://github.com/rubygems/rubygems/commit/45ec86e2e528.
  That's why it was possible to do `Bundler.current_ruby.maglev?` or
  `Bundler.current_ruby.maglev_30?`.

  I didn't change the current behaviour and maglev is not supported,
  though I kept the `*maglev` methods as I believe CurrentRuby is
  public API.

https://github.com/rubygems/rubygems/commit/29e219ebcf
2025-01-31 14:34:26 +09:00
Edouard CHIN
dc7c665105 [rubygems/rubygems] Consolidated the Ruby version list:
- We keep 2 list of supported ruby versions and each time a new ruby
  version is released we need to maintain both list. Forgetting
  to update one would prevent users from adding gem for a specific
  plaftorm (i.e. https://github.com/rubygems/rubygems/commit/7cd19d824d17 and https://github.com/rubygems/rubygems/commit/5462322f8f0c).

  Extracted the list from the Dependency class and moved it to the
  CurrentRuby class (which I believe was originally added for that
  reason).

https://github.com/rubygems/rubygems/commit/a91edd6c1f
2025-01-31 14:34:25 +09:00
Edouard CHIN
57fec1e85f [rubygems/rubygems] Add ruby_34 and ruby_35 as valid platform:
- Fix https://github.com/rubygems/rubygems/pull/8427
- Similar to https://github.com/rubygems/rubygems/commit/7cd19d824d17.
  Tweaked a bit the test supposed to prevent this error by checking
  whether the dep respond to these methods.

https://github.com/rubygems/rubygems/commit/62012eaeb6
2025-01-31 14:34:24 +09:00
Edouard CHIN
366462bd46 - Add a mention to git 2.32 in the building ruby documentation:
I had issues building Ruby as I was using git 2.30.
  The error was:

  > file2lastrev.rb: git rev-parse failed error: could not expand
  > include path '~/.gitcinclude'

  The default system git config includes paths making use of `$HOME`,
  but that env variable gets removed when building: 7070b1b196/tool/lib/vcs.rb (L546-L547)

  It works with git `>= 2.32` thanks to the `GIT_CONFIG_SYSTEM`
  feature which gets set to a Null IO in order to override
  the system gitconfig. 7070b1b196/tool/lib/vcs.rb (L549)
2025-01-31 11:52:57 +09:00
Nobuyoshi Nakada
7604588f6f
[Feature #19521] Test for Module#set_temporary_name 2025-01-31 10:43:36 +09:00
Alan Wu
9497820bcf YJIT: Remove comments that refer to the removed "stats" feature
The Cargo feature was removed in 2de8b5b8054f311c4cee112dcab5208b66cc62a4
and it's available in all build configs now.

[ci skip]
2025-01-30 18:00:53 -05:00
Alan Wu
95bf359087 YJIT: Turn on dead code lint for the stats module 2025-01-30 18:00:53 -05:00
Alan Wu
7e733ca551 YJIT: Explicitly specify C ABI to fix a nightly Rust warning 2025-01-30 18:00:53 -05:00
Andrew Konchin
afd7d5be5e Skip a new spec for Marshal#dump and Float that fails on i686 2025-01-30 20:43:46 +01:00