Граф коммитов

88589 Коммитов

Автор SHA1 Сообщение Дата
Hiroshi SHIBATA 587955169e Port -r option test to RSpec examples 2024-11-15 14:04:19 +09:00
Hiroshi SHIBATA 208c46702a Port bundle exec with shebang script to RSpec example 2024-11-15 14:04:19 +09:00
Hiroshi SHIBATA 703cffffc9 Port bundle exec warning check to RSpec example 2024-11-15 14:04:19 +09:00
Hiroshi SHIBATA 49fde29f77 Port test_no_warn_dependency.rb to RSpec example 2024-11-15 14:04:19 +09:00
Hiroshi SHIBATA bb20083050 Port test_warn_dependency.rb to RSpec example 2024-11-15 14:04:19 +09:00
Hiroshi SHIBATA 699e710ad8 Port test_no_warn_dash_gem.rb to RSpec example 2024-11-15 14:04:19 +09:00
Nobuyoshi Nakada 8e98fbdd19 [ruby/net-http] Remove deprecated constants
These constants, isolated in net/http/backward.rb, have not only been
deprecated since 2001, but have also had a warning since 2021.

https://github.com/ruby/net-http/commit/265bfa929f
2024-11-15 03:15:04 +00:00
dependabot[bot] 1b417c3e64 Bump github/codeql-action from 3.27.3 to 3.27.4
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.3 to 3.27.4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](396bb3e453...ea9e4e3799)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-15 11:38:40 +09:00
Schneems 226cfda306 [ruby/syntax_suggest] Fix missing line break due to puts logic
In #225 it was reported that the output looks incorrect:

```
$ cat /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb
def x.y.z
end
$ ruby /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb
/tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb: --> /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb
expected a delimiter to close the parametersunexpected '.', ignoring it
> 1  def x.y.z
> 2  end
```

Specifically:

```
expected a delimiter to close the parametersunexpected '.', ignoring it
```

However this does not show up when executing the debug executable:

```
$ bin/bundle exec exe/syntax_suggest /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb
--> /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb

expected a delimiter to close the parameters
unexpected '.', ignoring it

> 1  def x.y.z
> 2  end
```

This is because `exe/syntax_suggest` uses STDOUT.puts while calling `ruby` with the filename uses a fake IO object represented by MiniStringIO. This class was incorrectly not adding a newline to the end of the print.

The fix was to move the class to it's own file where it can be tested and then fix the behavior.

close https://github.com/ruby/syntax_suggest/pull/225

https://github.com/ruby/syntax_suggest/commit/d2ecd94a3b

Co-authored-by: Andy Yong <andyywz@gmail.com>
2024-11-15 01:31:26 +00:00
Misaki Shioi 51666c827b
Make fast_fallback option false by default temporarily (#12070)
to suppress failing output in CI.
2024-11-15 09:18:09 +09:00
Dave Corson-Knowles facb82aba5 [rubygems/rubygems] Update test_project_sanity.rb
https://github.com/rubygems/rubygems/commit/279eefb8a3
2024-11-14 23:21:05 +00:00
Hiroshi SHIBATA 11265baed9 Use environmental variable for bundled_gems_spec.rb 2024-11-15 08:16:03 +09:00
Hiroshi SHIBATA 2d2e5a38bf Port test_warn_redefined.rb to RSpec example 2024-11-15 08:16:03 +09:00
Hiroshi SHIBATA 1063b5a140 Port test_warn_dash_gem.rb to RSpec example 2024-11-15 08:16:03 +09:00
Hiroshi SHIBATA b44272fcb4 Port test_warn_bundled_gems.rb to RSpec example 2024-11-15 08:16:03 +09:00
Takashi Kokubun 31bdffb5b9
YJIT: Specialize String#dup (#12090) 2024-11-14 18:15:39 -05:00
tomoya ishida 8f3a6ebcf4 [ruby/reline] Drop loading terminfo, remove fiddle dependency in
non-windows environment.
(https://github.com/ruby/reline/pull/769)

Reline works perfectly in most major terminal emulators without terminfo.
In minor/old terminal emulator, we used to get key bindings from terminfo, but I think it is not used so much.

https://github.com/ruby/reline/commit/3ceba3bff7
2024-11-14 23:14:18 +00:00
Yusuke Endoh 4074c6b427 Fix a stack-buffer-overflow bug
http://ci.rvm.jp/results/trunk_asan@ruby-sp1/5408428
```
==3159643==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x796cf8f09041 at pc 0x6539bbf68ded bp 0x796cfadffcf0 sp 0x796cfadff4b8
READ of size 2 at 0x796cf8f09041 thread T13
    #0 0x6539bbf68dec in strlen (/tmp/ruby/build/trunk_asan/ruby+0x18edec) (BuildId: cca267c7ae091060e1b82a6b4ed1aeaf00edebab)
```
2024-11-14 11:29:47 -06:00
Takashi Kokubun 7e2f9eaccd
YJIT: Specialize Integer#pred (#12082) 2024-11-14 12:04:48 -05:00
Misaki Shioi fd4b27472e
Do not wait connection attempt delay without in progress fds (#12087)
Do not wait Connection Attempt Delay without in progress fds

Reset Connection Attempt Delay when connection fails and there is no other socket connection in progress.
This is intended to resolve an issue that was temporarily worked around in Pull Request #12062.

`TCPServer::new` (used in tests such as `TestNetHTTP_v1_2_chunked#test_timeout_during_non_chunked_streamed_HTTP_session_write`) can only connect over either IPv6 or IPv4, depending on the environment.
Since HEv2 attempts to connect over IPv6 first, environments where IPv6 connections are unavailable return ECONNREFUSED immediately.
In such cases, the client should immediately retry the connection over IPv4.
However, HEv2 includes a specification for a "Connection Attempt Delay," where it waits 250ms after the previous connection attempt before starting the next one.
This delay causes Net::OpenTimeout (100ms) to be exceeded while waiting for the next connection attempt to start.

With this change, when a connection attempt fails, if there are sockets still attempting to connect and there are addresses yet to be tried, the Connection Attempt Delay will be resetted, allowing the next connection attempt to start immediately.

---

Additionally, the following minor fixes have been made:

- The `nfds` value used for select(2) is now reset with each wait.
2024-11-15 00:25:59 +09:00
Peter Zhu 54ff9d3525 Remove dependency of version.c on gc/gc.h
version.c does not depend on gc/gc.h.
2024-11-14 07:50:05 -06:00
Matt Valentine-House 42501015b4 rb_raise when attempting to set the GC implementation name
Instead of silently ignoring the key, we should raise to clearly tell
the user that this key is read-only.
2024-11-14 10:46:36 +00:00
Matt Valentine-House 6795fc4981 rb_bug if rb_gc_impl_active_gc_name is too long
This avoids the need to malloc, and reduces the complexity of truncating
the long string for display in RUBY_DESCRIPTION.

The developer of a GC implementation should be responsible for giving it
a succinct name.
2024-11-14 10:46:36 +00:00
Matt Valentine-House ee290c94a3 Include the currently active GC in RUBY_DESCRIPTION
This will add +MOD_GC to the version string and Ruby description when
Ruby is compiled with shared gc support.

When shared GC support is compiled in and a GC module has been loaded
using RUBY_GC_LIBRARY, the version string will include the name of
the currently active GC as reported by the rb_gc_active_gc_name function
in the form

+MOD_GC[gc_name]

[Feature #20794]
2024-11-14 10:46:36 +00:00
Matt Valentine-House fa10441981 Expose GC.config[:implementation], to query the currently active GC
And a default and readonly key to the GC.config hash that names the
current GC implementation.

This is provided by each implementation by the API function
rb_gc_impl_active_gc_name
2024-11-14 10:46:36 +00:00
Hiroshi SHIBATA 8a4ce4e9a9 [rubygems/rubygems] URI::DEFAULT_PARSER.escape is obsoleted. We should use URI::RFC2396_PARSER.escape explicitly
https://github.com/rubygems/rubygems/commit/64f026c9d4
2024-11-14 07:44:01 +00:00
Hiroshi SHIBATA 331f1647d7 [rubygems/rubygems] Revert "mustermann depends on URI::RFC2396_PARSER behavior"
This reverts commit https://github.com/rubygems/rubygems/commit/82b25dd75afd.

https://github.com/rubygems/rubygems/commit/16adf53f23
2024-11-14 07:44:01 +00:00
git 028958f9ad Update default gems list at 0f5e3dca5a [ci skip] 2024-11-14 03:50:17 +00:00
Hiroshi SHIBATA 0f5e3dca5a [ruby/uri] Bump up v1.0.2
https://github.com/ruby/uri/commit/e46960a467
2024-11-14 03:49:15 +00:00
Hiroshi SHIBATA 310e6603a2 [ruby/uri] Check existence constants only URI module
https://github.com/ruby/uri/commit/b6f583369a
2024-11-14 03:32:13 +00:00
git 44fb1de9e9 Update default gems list at 43285f543b [ci skip] 2024-11-14 02:23:16 +00:00
Hiroshi SHIBATA 43285f543b [ruby/pp] Bump up v0.6.1
https://github.com/ruby/pp/commit/812933668d
2024-11-14 02:22:14 +00:00
David Rodríguez 7ece47e0de Update vendored thor to 1.3.2 2024-11-14 11:21:39 +09:00
David Rodríguez 99c35edae1 Update vendored timeout to 0.4.2 2024-11-14 11:21:39 +09:00
David Rodríguez d9c754ab44 Update vendored securerandom to 0.3.2 2024-11-14 11:21:39 +09:00
David Rodríguez 0ef7d59ef2 Update vendored resolv to 0.5.0 2024-11-14 11:21:39 +09:00
David Rodríguez 26036b1248 Update vendored net-http to 0.5.0 2024-11-14 11:21:39 +09:00
David Rodríguez 570336b80f Update vendored fileutils to 1.7.3 2024-11-14 11:21:39 +09:00
David Rodríguez cadf559a99 Update vendored optparse to 0.6.0 2024-11-14 11:21:39 +09:00
David Rodríguez abb6f5c8bc [rubygems/rubygems] Fix `bin/rake spec:all` task
Only in CI, if two different test runs are started (like `bin/rake
spec:all` does), the second one would not install the dev version of
Bundler and would fail to start.

This commit makes it work the same locally and in CI.

https://github.com/rubygems/rubygems/commit/7a5ca6c40f
2024-11-14 11:21:39 +09:00
David Rodríguez bf569c80ea [rubygems/rubygems] I don't see how this could happen
https://github.com/rubygems/rubygems/commit/8b6f9b7f05
2024-11-14 11:21:39 +09:00
David Rodríguez 4fc82519a0 [rubygems/rubygems] Make sure `bundle viz` specs are actually run
These are marked as realworld, but the realworld workflow file does not
install graphviz, so the specs are actually skipped.

These are not actually realworld, so remove that tag. Now they'll be run
together with the reset of specs in the standard workflow file, which
does install `graphviz`.

https://github.com/rubygems/rubygems/commit/e865fcaa22
2024-11-14 11:21:39 +09:00
Kazuki Yamaguchi a0f1f16145 asn1: fix ObjectId#==
Compare by the dotted decimal notation rather than the NID.

OpenSSL::ASN1::ObjectId can store OIDs that are not registered in
OpenSSL's internal table. NID is not defined for such an OID, but it is
not an error.

The == method also should not raise TypeError if the other object is
not an instance of OpenSSL::ASN1::ObjectId.

Fixes: https://github.com/ruby/openssl/issues/791
2024-11-14 11:21:39 +09:00
Kazuki Yamaguchi 4e7e2e9e89 [ruby/openssl] pkcs7: fix memory leak in error path of PKCS7.new and .read_smime
A follow-up to commit https://github.com/ruby/openssl/commit/27e11f2d1dcd and https://github.com/ruby/openssl/commit/07eceb7f6326. The PKCS7 object
must be freed before raising an exception.

https://github.com/ruby/openssl/commit/172eee4665
2024-11-14 11:21:39 +09:00
Kazuki Yamaguchi 419fb2f3b9 [ruby/openssl] x509: fix handling of multiple URIs in Certificate#crl_uris
The implementation of OpenSSL::X509::Certificate#crl_uris makes the
assumption that each DistributionPoint in the CRL distribution points
extension contains a single general name of type URI. This is not
guaranteed by RFC 5280. A DistributionPoint may contain zero or more
than one URIs.

Let's include all URIs found in the extension. If only non-URI pointers
are found, return nil.

Fixes: https://github.com/ruby/openssl/issues/775

https://github.com/ruby/openssl/commit/71f4fef2fa
2024-11-14 11:21:39 +09:00
Kazuki Yamaguchi 97be56fc62 [ruby/openssl] test_x509cert.rb: break up test_extension into smaller units
test_extesion is testing too many features at once and is hard to
navigate. Let's split each chunk apart for more clarity.

https://github.com/ruby/openssl/commit/461cfcb070
2024-11-14 11:21:39 +09:00
Jean Boussier a4183781ec [ruby/json] Only use the key cache if the Hash is in an Array
Otherwise the likeliness of seeing that key again is really low, and looking up
the cache is just a waste.

Before:

```
== Parsing small hash (65 bytes)
ruby 3.4.0dev (2024-11-13T12:32:57Z fstr-update-callba.. https://github.com/ruby/json/commit/9b44b455b3) +YJIT +PRISM [arm64-darwin24]
Warming up --------------------------------------
                json   343.049k i/100ms
                  oj   213.943k i/100ms
          Oj::Parser    31.583k i/100ms
           rapidjson   303.433k i/100ms
Calculating -------------------------------------
                json      3.704M (± 1.5%) i/s  (270.01 ns/i) -     18.525M in   5.003078s
                  oj      2.200M (± 1.1%) i/s  (454.46 ns/i) -     11.125M in   5.056526s
          Oj::Parser    285.369k (± 4.8%) i/s    (3.50 μs/i) -      1.453M in   5.103866s
           rapidjson      3.216M (± 1.6%) i/s  (310.95 ns/i) -     16.082M in   5.001973s

Comparison:
                json:  3703517.4 i/s
           rapidjson:  3215983.0 i/s - 1.15x  slower
                  oj:  2200417.1 i/s - 1.68x  slower
          Oj::Parser:   285369.1 i/s - 12.98x  slower

== Parsing test from oj (258 bytes)
ruby 3.4.0dev (2024-11-13T12:32:57Z fstr-update-callba.. https://github.com/ruby/json/commit/9b44b455b3) +YJIT +PRISM [arm64-darwin24]
Warming up --------------------------------------
                json    54.539k i/100ms
                  oj    41.473k i/100ms
          Oj::Parser    24.064k i/100ms
           rapidjson    51.466k i/100ms
Calculating -------------------------------------
                json    549.386k (± 1.6%) i/s    (1.82 μs/i) -      2.781M in   5.064316s
                  oj    417.003k (± 1.3%) i/s    (2.40 μs/i) -      2.115M in   5.073047s
          Oj::Parser    226.500k (± 4.7%) i/s    (4.42 μs/i) -      1.131M in   5.005466s
           rapidjson    526.124k (± 1.0%) i/s    (1.90 μs/i) -      2.676M in   5.087176s

Comparison:
                json:   549385.6 i/s
           rapidjson:   526124.3 i/s - 1.04x  slower
                  oj:   417003.4 i/s - 1.32x  slower
          Oj::Parser:   226500.4 i/s - 2.43x  slower
```

After:

```
== Parsing small hash (65 bytes)
ruby 3.4.0dev (2024-11-13T12:32:57Z fstr-update-callba.. https://github.com/ruby/json/commit/9b44b455b3) +YJIT +PRISM [arm64-darwin24]
Warming up --------------------------------------
                json   361.394k i/100ms
                  oj   217.203k i/100ms
          Oj::Parser    28.855k i/100ms
           rapidjson   303.404k i/100ms
Calculating -------------------------------------
                json      3.859M (± 2.9%) i/s  (259.13 ns/i) -     19.515M in   5.061302s
                  oj      2.191M (± 1.6%) i/s  (456.49 ns/i) -     11.077M in   5.058043s
          Oj::Parser    315.132k (± 7.1%) i/s    (3.17 μs/i) -      1.587M in   5.065707s
           rapidjson      3.156M (± 4.0%) i/s  (316.88 ns/i) -     15.777M in   5.008949s

Comparison:
                json:  3859046.5 i/s
           rapidjson:  3155778.5 i/s - 1.22x  slower
                  oj:  2190616.0 i/s - 1.76x  slower
          Oj::Parser:   315132.4 i/s - 12.25x  slower

== Parsing test from oj (258 bytes)
ruby 3.4.0dev (2024-11-13T12:32:57Z fstr-update-callba.. https://github.com/ruby/json/commit/9b44b455b3) +YJIT +PRISM [arm64-darwin24]
Warming up --------------------------------------
                json    55.682k i/100ms
                  oj    40.343k i/100ms
          Oj::Parser    25.119k i/100ms
           rapidjson    51.500k i/100ms
Calculating -------------------------------------
                json    555.808k (± 1.4%) i/s    (1.80 μs/i) -      2.784M in   5.010092s
                  oj    412.283k (± 1.7%) i/s    (2.43 μs/i) -      2.098M in   5.089900s
          Oj::Parser    279.306k (±13.3%) i/s    (3.58 μs/i) -      1.356M in   5.022079s
           rapidjson    517.177k (± 2.7%) i/s    (1.93 μs/i) -      2.626M in   5.082352s

Comparison:
                json:   555808.3 i/s
           rapidjson:   517177.1 i/s - 1.07x  slower
                  oj:   412283.2 i/s - 1.35x  slower
          Oj::Parser:   279306.5 i/s - 1.99x  slower
```

https://github.com/ruby/json/commit/00c45ddc9f
2024-11-14 11:21:39 +09:00
Hiroshi SHIBATA 1bab8bf88f [ruby/uri] Removed duplicated declare step for constants under the URI::RFC2396_REGEXP::PATTERN
https://github.com/ruby/uri/commit/60a8bc1575
2024-11-14 02:20:04 +00:00
Hiroshi SHIBATA 1d6c986104 [ruby/uri] Restore constants like URI::REGEXP::PATTERN::IPV6ADDR
https://github.com/ruby/uri/commit/ee9a38701a
2024-11-14 02:20:04 +00:00
Nobuyoshi Nakada e97dcf53a2
Fix the method name in a comment [ci skip] 2024-11-14 09:24:00 +09:00