Commit graph

9854 commits

Author SHA1 Message Date
Kazuki Yamaguchi
e6ca644329 [ruby/openssl] ssl: remove OpenSSL::ExtConfig
This module was introduced in 2015 for internal use within this library.
Neither of the two constants in it is used anymore. I don't think we
will be adding a new constant in the foreseeable future, either.

OPENSSL_NO_SOCK is unused since commit 998d66712a (r55191).
HAVE_TLSEXT_HOST_NAME is unused since commit 4eb4b3297a.

eed3894bda
2022-12-23 09:39:15 +09:00
Kazuki Yamaguchi
dd6f3276e0 [ruby/openssl] ssl: disable NPN support on LibreSSL
As noted in commit a2ed156cc9 ("test/test_ssl: do not run NPN tests
for LibreSSL >= 2.6.1", 2017-08-13), NPN is known not to work properly
on LibreSSL.

Disable NPN support on LibreSSL, whether OPENSSL_NO_NEXTPROTONEG is
defined or not.

NPN is less relevant today anyway. Let's also silence test suite when
it's not available.

289f6e0e1f
2022-12-23 09:39:15 +09:00
Kazuki Yamaguchi
d6c16dd3e6 [ruby/openssl] ssl: update TLS1_3_VERSION workaround for older LibreSSL versions
The macro is now defined by default in LibreSSL 3.4+. Let's document it
for future readers.

935698e9f9
2022-12-23 09:39:15 +09:00
Nobuyoshi Nakada
6df4d272c3 [ruby/openssl] Suppress deprecation warnings by OpenSSL 3
91657a7924
2022-12-23 09:39:15 +09:00
Nobuyoshi Nakada
d7d1bb3e87 [ruby/openssl] Constify when building with OpenSSL 3
c0023822fe
2022-12-23 09:39:15 +09:00
Nobuyoshi Nakada
2bc7eac822 [ruby/openssl] Check for functions with arguments
b67aaf925d
2022-12-23 09:39:14 +09:00
Joe Truba
ca7a6b1553 [ruby/openssl] pkey/ec: fix ossl_raise() calls using cEC_POINT instead of eEC_POINT
b2e9f5e132
2022-12-23 09:39:14 +09:00
Joe Truba
13137236dc [ruby/openssl] raise when EC_POINT_cmp or EC_GROUP_cmp error instead of returning true
e1e8f3cebe
2022-12-23 09:39:14 +09:00
Hiroshi SHIBATA
1998d97908
[ruby/date] Bump version to 3.3.3
ea3644a7c4
2022-12-19 10:50:21 +09:00
Nobuyoshi Nakada
c316a5f2f1 [ruby/date] Adjust format [ci skip]
71c35b4054
2022-12-18 03:03:54 +00:00
Nobuyoshi Nakada
b8cc0992c6 [ruby/date] Extract head_match_p and abbreviated name length constants
3f666fa882
2022-12-18 02:58:51 +00:00
Nobuyoshi Nakada
df49bf8150 [ruby/date] Consider the length of string to parse
3bfed83ce7
2022-12-18 02:58:50 +00:00
Nobuyoshi Nakada
49dc424ff3 [ruby/date] Remove extz_pats table
945e26e243
2022-12-18 02:58:49 +00:00
Nobuyoshi Nakada
70c905963e [ruby/date] Remove merid_names table
7fe2bd5f94
2022-12-18 02:58:48 +00:00
Nobuyoshi Nakada
6efeaabef0 [ruby/date] Match abbreviated day and month names with head of full names
a45f8f03c9
2022-12-18 02:58:47 +00:00
Hiroshi SHIBATA
11f3bef260 [ruby/date] Bump version to 3.3.2
7afd9d4615
2022-12-16 06:36:03 +00:00
Hiroshi SHIBATA
d95ee11462 [ruby/io-console] Bump version to 0.6.0
441528e3eb
2022-12-16 03:45:11 +00:00
Hiroshi SHIBATA
7e26ff7dc0 [ruby/io-wait] Bump version to 0.3.0
940ba319d3
2022-12-16 02:36:21 +00:00
Jemma Issroff
e9ba3042e1 Indicate if a shape is too_complex in ObjectSpace#dump 2022-12-15 13:41:47 -08:00
Jemma Issroff
c1ab6ddc9a Transition complex objects to "too complex" shape
When an object becomes "too complex" (in other words it has too many
variations in the shape tree), we transition it to use a "too complex"
shape and use a hash for storing instance variables.

Without this patch, there were rare cases where shape tree growth could
"explode" and cause performance degradation on what would otherwise have
been cached fast paths.

This patch puts a limit on shape tree growth, and gracefully degrades in
the rare case where there could be a factorial growth in the shape tree.

For example:

```ruby
class NG; end

HUGE_NUMBER.times do
  NG.new.instance_variable_set(:"@unique_ivar_#{_1}", 1)
end
```

We consider objects to be "too complex" when the object's class has more
than SHAPE_MAX_VARIATIONS (currently 8) leaf nodes in the shape tree and
the object introduces a new variation (a new leaf node) associated with
that class.

For example, new variations on instances of the following class would be
considered "too complex" because those instances create more than 8
leaves in the shape tree:

```ruby
class Foo; end
9.times { Foo.new.instance_variable_set(":@uniq_#{_1}", 1) }
```

However, the following class is *not* too complex because it only has
one leaf in the shape tree:

```ruby
class Foo
  def initialize
    @a = @b = @c = @d = @e = @f = @g = @h = @i = nil
  end
end
9.times { Foo.new }
``

This case is rare, so we don't expect this change to impact performance
of most applications, but it needs to be handled.

Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
2022-12-15 10:06:04 -08:00
Jemma Issroff
a3d552aedd Add variation_count on classes
Count how many "variations" each class creates. A "variation" is a a
unique ordering of instance variables on a particular class. This can
also be thought of as a branch in the shape tree.

For example, the following Foo class will have 2 variations:

```ruby
class Foo ; end

Foo.new.instance_variable_set(:@a, 1) # case 1: creates one variation
Foo.new.instance_variable_set(:@b, 1) # case 2: creates another variation

foo = Foo.new
foo.instance_variable_set(:@a, 1) # does not create a new variation
foo.instance_variable_set(:@b, 1) # does not create a new variation (a continuation of the variation in case 1)
```

We will use this number to limit the amount of shapes that a class can
create and fallback to using a hash iv lookup.

Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
2022-12-15 10:06:04 -08:00
Samuel Williams
d20bd06a97
Remove require 'io/wait' where it's no longer necessary. (#6932)
* Remove `require 'io/wait'` as it's part of core now.

* Update ruby specs using version gates.

* Add note about why it's conditional.
2022-12-15 11:37:01 +13:00
Nobuyoshi Nakada
71dd8b3caa
socket.rb - simplify check for the method 2022-12-15 00:27:47 +09:00
Jean Boussier
1df6d0e578 objspace_dump.c: don't dump class of T_IMEMO
They don't actually have a class.
2022-12-14 15:53:41 +01:00
Hiroshi SHIBATA
bec7deba30 [ruby/date] Fixed wrong minimum version of Ruby
Fixed https://github.com/ruby/date/issues/83

9731a3e732
2022-12-14 07:56:09 +00:00
Hiroshi SHIBATA
9e4d7e99ce [ruby/syslog] Bump version to 0.1.1
a92b55b638
2022-12-14 06:18:10 +00:00
Hiroshi SHIBATA
87d32376d9 [ruby/readline-ext] Bump version to 0.1.5
7af996f24b
2022-12-14 05:54:06 +00:00
MSP-Greg
74995162fc
socket.rb - don't load io/wait (#6922)
See d2166c09b0 and #6036 for more context.
2022-12-14 08:57:38 +13:00
zverok
1859784422 [ruby/date] Implement Date#deconstruct_keys and DateTime#deconstruct_keys
6bb6d3a810
2022-12-13 19:52:06 +00:00
Nobuyoshi Nakada
99d0a257af [ruby/openssl] [DOC] Remove duplicate doc
RDoc does not consider preprocessor conditionals, but equally uses
both documents of `#if` and `#else` sides.

ea0a112a0c
2022-12-13 19:55:18 +09:00
Hiroshi SHIBATA
3de7ff8eb9
We should apply https://github.com/ruby/openssl/pull/576 instead of them:
6d8f396f37
  c8b3bd45cc
2022-12-13 18:07:41 +09:00
Henrique Bontempo
2be03fb5b0
[ruby/openssl] Fixes OPENSSL_LIBRARY_VERSION description on
documentation
(https://github.com/ruby/openssl/pull/559)

Adds back missing constant description on the documentation.
2022-12-13 18:07:41 +09:00
Theo Buehler
8ab8c2d601
[ruby/openssl] Enable HKDF support for LibreSSL 3.6 and later
LibreSSL 3.6 added support for HKDF in EVP. Enable this in ossl_kdf.c.

9bdd39a7e2
2022-12-13 18:07:41 +09:00
Yusuke Nakamura
d4dce27d89
[ruby/openssl] Allow empty string to OpenSSL::Cipher#update
For some reasons, plaintext may be empty string.

ref https://www.rfc-editor.org/rfc/rfc9001.html#section-5.8

953592a29e
2022-12-13 18:07:41 +09:00
Theo Buehler
d92f4fe4d7
[ruby/openssl] Use EVP_Digest{Sign,Verify} when available
LibreSSL 3.4 added EVP_DigestSign() and EVP_DigestVerify(). Use them
when available to prepare for the addition of Ed25519 support in
LibreSSL 3.7.

475b2bf766
2022-12-13 18:07:41 +09:00
Peter Zhu
5302d04e5a [DOC] Fix format in ObjectSpace.dump_all 2022-12-12 10:16:38 -05:00
Peter Zhu
be710c1bf7 [DOC] Fix format for ObjectSpace.dump_shapes 2022-12-12 10:15:24 -05:00
Peter Zhu
a9c3dc8d2e [DOC] Fix call-seq for ObjectSpace methods 2022-12-12 09:58:39 -05:00
Peter Zhu
58e3ce5de6 [DOC] Fix typo in docs for ObjectSpace.dump_all 2022-12-12 09:56:44 -05:00
Peter Zhu
87d5470873 [DOC] Fix indentation for ObjectSpace.dump_all 2022-12-12 09:51:12 -05:00
Peter Zhu
0b4fda11ec [DOC] Don't document private methods in objspace 2022-12-12 09:48:06 -05:00
Jean Boussier
d7812d1949 objspace_dump.c: dump the capacity field for INITIAL_CAPACITY shapes
We forgot about that one, it's quite useful to see which capacity
we started from.
2022-12-09 17:06:21 +01:00
Hiroshi SHIBATA
01cf3ab3b8 [ruby/date] Bump version to 3.3.1
b7a8229041
2022-12-09 07:57:33 +00:00
Charles Oliver Nutter
e96b64f5e7 [ruby/date] No-op gem for JRuby for now
Remove all shipped files and require path on JRuby until we can
add JRuby's extension to the gem.

Temporary workaround for #48

94c3becef2
2022-12-09 07:55:07 +00:00
Hiroshi SHIBATA
3b45498d3e Merge json-2.6.3 2022-12-09 16:36:22 +09:00
Hiroshi SHIBATA
7d04cddfef Merge stringio-3.0.4 2022-12-09 16:36:22 +09:00
Hiroshi SHIBATA
286812bcf3 Merge fiddle-1.1.1 2022-12-09 16:36:22 +09:00
Hiroshi SHIBATA
4e31fea77d Merge strscan-3.0.5 2022-12-09 16:36:22 +09:00
Hiroshi SHIBATA
d7baa17b49 [ruby/etc] Bump version to 1.4.2
5cac138538
2022-12-09 05:57:49 +00:00
Sutou Kouhei
8bbf4e5d8d [ruby/stringio] bump up to 3.0.5
e62b9d78d3
2022-12-08 20:58:53 +00:00