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

88555 Коммитов

Автор SHA1 Сообщение Дата
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
John Bampton 9783cdb0d7
Update action.yml - fix typo [ci skip] 2024-11-14 09:23:20 +09:00
Takashi Kokubun 30e1d6b5a8
YJIT: Add inline_block_count stat (#12081) 2024-11-13 16:17:29 -05:00
Takashi Kokubun 907146973a Add a comment about Integer#downto Enumerator 2024-11-13 12:27:26 -08:00
Takashi Kokubun 01db456196 Move Array#map to Ruby
Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
2024-11-13 12:27:26 -08:00
Takashi Kokubun c9a5a71695 Move Array#select to Ruby
Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
2024-11-13 12:27:26 -08:00
Takashi Kokubun d57d85548f Move Integer#downto to Ruby
Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
2024-11-13 12:27:26 -08:00
Randy Stauner beafae9750
YJIT: Specialize `String#[]` (`String#slice`) with fixnum arguments (#12069)
* YJIT: Specialize `String#[]` (`String#slice`) with fixnum arguments

String#[] is in the top few C calls of several YJIT benchmarks:
liquid-compile rubocop mail sudoku

This speeds up these benchmarks by 1-2%.

* YJIT: Try harder to get type info for `String#[]`

In the large generated code of the mail gem the context doesn't have
the type info.  In that case if we peek at the stack and add a guard
we can still apply the specialization
and it speeds up the mail benchmark by 5%.

Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
Co-authored-by: Takashi Kokubun (k0kubun) <takashikkbn@gmail.com>

---------

Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
Co-authored-by: Takashi Kokubun (k0kubun) <takashikkbn@gmail.com>
2024-11-13 12:25:09 -05:00
Alexis Bernard 202a377d21 [ruby/rdoc] Split list of class and instance methods in two
(https://github.com/ruby/rdoc/pull/1206)

Looking for a method is easier because eyes don't have to skip dashes or
double colon.

https://github.com/ruby/rdoc/commit/6852567640
2024-11-13 16:13:21 +00:00
Jean byroot Boussier 6deeec5d45
Mark strings returned by Symbol#to_s as chilled (#12065)
* Use FL_USER0 for ELTS_SHARED

This makes space in RString for two bits for chilled strings.

* Mark strings returned by `Symbol#to_s` as chilled

[Feature #20350]

`STR_CHILLED` now spans on two user flags. If one bit is set it
marks a chilled string literal, if it's the other it marks a
`Symbol#to_s` chilled string.

Since it's not possible, and doesn't make much sense to include
debug info when `--debug-frozen-string-literal` is set, we can't
include allocation source, but we can safely include the symbol
name in the warning message, making it much easier to find the source
of the issue.

Co-Authored-By: Étienne Barrié <etienne.barrie@gmail.com>

---------

Co-authored-by: Étienne Barrié <etienne.barrie@gmail.com>
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2024-11-13 09:20:00 -05:00
Jean Boussier 37a16c7812 string.c: preserve coderange when interning a string
Since `str_do_hash` will most likely scan the string to
compute the coderange, we might as well copy it over in the
interned string in case it's useful later.
2024-11-13 14:14:24 +01:00
Jean Boussier fae86a701e string.c: Directly create strings with the correct encoding
While profiling msgpack-ruby I noticed a very substantial amout of time
spent in `rb_enc_associate_index`, called by `rb_utf8_str_new`.

On that benchmark, `rb_utf8_str_new` is 33% of the total runtime,
in big part because it cause GC to trigger often, but even then
`5.3%` of the total runtime is spent in `rb_enc_associate_index`
called by `rb_utf8_str_new`.

After closer inspection, it appears that it's performing a lot of
safety check we can assert we don't need, and other extra useless
operations, because strings are first created and filled as ASCII-8BIT
and then later reassociated to the desired encoding.

By directly allocating the string with the right encoding, it allow
to skip a lot of duplicated and useless operations.

After this change, the time spent in `rb_utf8_str_new` is down
to `28.4%` of total runtime, and most of that is GC.
2024-11-13 13:32:32 +01:00
Jean Boussier bfb4783c01 Move `Symbol#name` into `symbol.rb`
This allows to declare it as leaf just like `Symbol#to_s`.

Co-Authored-By: Étienne Barrié <etienne.barrie@gmail.com>
2024-11-13 10:29:07 +01:00
David Rodríguez ae733a693b [rubygems/rubygems] Include original error when openssl fails to load
https://github.com/rubygems/rubygems/commit/440343b791
2024-11-13 08:35:40 +00:00
Hiroshi SHIBATA 38b07a7fee
Revert force_activate feature. It's unnecessary for Ruby 3.4.
I will add this feature for Ruby 3.5 again.
2024-11-13 16:54:20 +09:00
HoneyryderChuck 2335768437 [ruby/openssl] make bn shareable when frozen
https://github.com/ruby/openssl/commit/d3c8e661e8
2024-11-13 07:25:51 +00:00
卜部昌平 0f28be6ab9 [CI] add GCC 14 2024-11-13 16:09:58 +09:00
Orien Madgwick 942ec7ab33 [ruby/uri] Remove rakelib/ dir from gem also
https://github.com/ruby/uri/commit/a0dd612e90
2024-11-13 05:07:53 +00:00
Orien Madgwick 7d5fdd97cc [ruby/uri] Remove unused files from the gem package
https://github.com/ruby/uri/commit/f0847c266c
2024-11-13 05:07:53 +00:00
Hiroshi SHIBATA 441069c093 We can't handle optional dependency without new API of Rubygems.
I don't want to make bundled_gems.rb more complex and complicate.

Revert "Fixed warning condition with LoadError"

This reverts commit 3a9e48b9a4.

Revert "Only warn fiddle as optional dependency"

This reverts commit ff3f61556f.

Revert "Only `warn` about bundled gems when require succeeds"

This reverts commit a70adce1ce.
2024-11-13 13:47:36 +09:00
dependabot[bot] 8ae63ca3be Bump github/codeql-action from 3.27.1 to 3.27.3
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.1 to 3.27.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](4f3212b617...396bb3e453)

---
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-13 12:22:23 +09:00
Jean Boussier ee1cd1656f ObjectSpace.dump: handle Module#set_temporary_name
[Bug #20892]

Until the introduction of that method, it was impossible for a
Module name not to be valid JSON, hence it wasn't going through
the slower escaping function.

This assumption no longer hold.
2024-11-12 20:21:27 +01:00
Benoit Daloze 6c123649cd [ruby/prism] Use RbConfig to locate libprism and headers when it is a default gem
* This is notably necessary on TruffleRuby, which is updating to Ruby 3.3 which introduces Prism as a default gem.
* Using the existing path is not an option as it would end up in truffleruby/lib/build/libprism.so and
  "truffleruby/lib/include/#{header}" which are not good places for such files.

https://github.com/ruby/prism/commit/5d16473e69
2024-11-12 14:20:39 +00:00
Peter Zhu eca3680c27 [ruby/prism] Fix use of uninitialized value when parsing regexp
Parsing the regexp /\A{/ causes uses an uninitialized value because it
tries to parse it as a range quantifier, so it reads the character after
the closing curly bracket. This is using uninitialized values because
prism strings are not null terminated. This can be seen in the Valgrind
output:

    ==834710== Conditional jump or move depends on uninitialised value(s)
    ==834710==    at 0x5DA010: pm_regexp_parse_range_quantifier (regexp.c:163)
    ==834710==    by 0x5DA010: pm_regexp_parse_quantifier (regexp.c:243)
    ==834710==    by 0x5DAD69: pm_regexp_parse_expression (regexp.c:738)
    ==834710==    by 0x5DAD69: pm_regexp_parse_pattern (regexp.c:761)
    ==834710==    by 0x5DAD69: pm_regexp_parse (regexp.c:773)
    ==834710==    by 0x5A2EE7: parse_regular_expression_named_captures (prism.c:20886)
    ==834710==    by 0x5A2EE7: parse_expression_infix (prism.c:21388)
    ==834710==    by 0x5A5FA5: parse_expression (prism.c:21804)
    ==834710==    by 0x5A64F3: parse_statements (prism.c:13858)
    ==834710==    by 0x5A9730: parse_program (prism.c:22011)
    ==834710==    by 0x576F0D: parse_input_success_p (extension.c:1062)
    ==834710==    by 0x576F0D: parse_success_p (extension.c:1084)

This commit adds checks for the end of the string to
pm_regexp_parse_range_quantifier.

https://github.com/ruby/prism/commit/be6cbc23ef
2024-11-12 14:19:46 +00:00
Misaki Shioi fee706d9dd
Allow Net::HTTP#request to raise Net::OpenTimeout (#12062)
with a TCPSoerver that is only listening
to avoid AssertionFailedError on Ubuntu.

---

The tests such as
`TestNetHTTP_v1_2_chunked#test_timeout_during_non_chunked_streamed_HTTP_session_write`
expect to raise a `Net::WriteTimeout` due to a failure in writing to the server.

However, on Ubuntu environments,
the server immediately returns a "Connection Refused" in such cases.
The socket created with `TCPSocket.new` that supports HEv2 catches this immediately
and raises a `Net::OpenTimeout`.
As a result, these tests fail due to raising a different exception than expected.
This PR adds `Net::OpenTimeout` asexceptions to avoid these test failures.
2024-11-12 19:14:05 +09:00
License Update dc08d6e917 [rubygems/rubygems] Update SPDX license list as of 2024-08-19
https://github.com/rubygems/rubygems/commit/5a094cbfab
2024-11-12 08:06:36 +00:00
Nobuyoshi Nakada f17cfb4958 Add missing macros for `__has_builtin` 2024-11-12 16:40:52 +09:00
John Hawthorn 8409edc497 Fix regex timeout double-free after stack_double
As of 10574857ce, it's possible to crash
on a double free due to `stk_alloc` AKA `msa->stack_p` being freed
twice, once at the end of match_at and a second time in `FREE_MATCH_ARG`
in the parent caller.

Fixes [Bug #20886]
2024-11-11 23:33:21 -08:00
git a6fdd8883c Update default gems list at da151ab1e7 [ci skip] 2024-11-12 06:06:01 +00:00
Hiroshi SHIBATA da151ab1e7 [ruby/io-console] Bump up v0.8.0.beta1
https://github.com/ruby/io-console/commit/8ec27d403e
2024-11-12 06:04:57 +00:00
Hiroshi SHIBATA 0452b3fabb [ruby/io-console] Update license files same as ruby/ruby
https://github.com/ruby/io-console/commit/c9e3f44268
2024-11-12 05:25:15 +00:00
git fd7ba1893b Update default gems list at 9c5290138a [ci skip] 2024-11-12 04:10:56 +00:00
Hiroshi SHIBATA 9c5290138a [ruby/zlib] Bump up v3.2.0
https://github.com/ruby/zlib/commit/7bb6d982fe
2024-11-12 04:09:58 +00:00
Alan Wu 8655cbec39 .gdbinit: Update RString printing for new layout [ci skip] 2024-11-11 22:24:32 -05:00
Alan Wu c028bf0c7b .gdbinit: Have rp() work without a target [ci skip]
Useful for core dumps. It used to not work because:

    (gdb) p !""
    evaluation of this expression requires the target program to be active
    (gdb) p 0 == ""
    evaluation of this expression requires the target program to be active
2024-11-11 22:24:32 -05:00