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

9107 Коммитов

Автор SHA1 Сообщение Дата
卜部昌平 12ec1fb2b1 use configure-detected sanity of _Alignof
This is actually already checked in (Ruby's) configure.
2023-08-25 17:27:53 +09:00
卜部昌平 eec85a6309 tool/update-deps --fix 2023-08-25 17:27:53 +09:00
Nobuyoshi Nakada 412defc7ad [ruby/io-console] Get rid of address of an rvalue on TruffleRuby
https://github.com/ruby/io-console/commit/653c1cd33f
2023-08-18 03:55:05 +00:00
Nobuyoshi Nakada 818ba30ee9 [ruby/io-console] Avoid the influence of special variable `$/`
https://github.com/ruby/io-console/commit/5f71354332
2023-08-18 03:55:04 +00:00
Nobuyoshi Nakada cff8058701 [ruby/io-console] Ensure to put a newline after password
https://github.com/ruby/io-console/commit/15e36af171
2023-08-18 03:55:04 +00:00
Nobuyoshi Nakada 528da4347c [ruby/io-console] Flush after prompt
https://github.com/ruby/io-console/commit/040a1d6259
2023-08-18 03:55:03 +00:00
Nobuyoshi Nakada 540cf43205 [ruby/io-console] Enable `getpass` methods always
https://github.com/ruby/io-console/commit/57f9649df4
2023-08-18 03:55:02 +00:00
Nobuyoshi Nakada 1bbce42964 [ruby/io-console] [DOC] Remove a trailing space from the prompt too
https://github.com/ruby/io-console/commit/85a155f25f
2023-08-18 01:17:03 +00:00
Nobuyoshi Nakada 1107cfd077 [ruby/io-console] * remove trailing spaces [ci skip]
https://github.com/ruby/io-console/commit/a0544eb74f
2023-08-18 01:15:00 +00:00
Olivier Lacan 43802a088e [ruby/io-console] [DOC] IO::console.getpass usage example
There were no clear example of this very useful method's usage anywhere
in the IO or IO::Console docs, which was a shame.

https://github.com/ruby/io-console/commit/4d324586a8
2023-08-18 01:02:42 +00:00
Jun Aruga f1df062944 [ruby/openssl] Enhance printing OpenSSL versions.
* Updated the `OpenSSL::OPENSSL_VERSION_NUMBER` comment explaining the format.
* Added the `OpenSSL::LIBRESSL_VERSION_NUMBER` to print LibreSSL version number,
  in the case that Ruby OpenSSL binding is compiled with LibreSSL. Note
  `test/openssl/utils.rb#libressl?` is not using this value in it for now.
* Update `rake debug` to print the values in a readable way, adding
  `OpenSSL::OPENSSL_VERSION_NUMBER` and `OpenSSL::LIBRESSL_VERSION_NUMBER`.

https://github.com/ruby/openssl/commit/d19e6360ed
2023-08-16 14:48:42 +09:00
Kazuki Yamaguchi 12bdacdca5 [ruby/openssl] Include "additional data" message in OpenSSL errors
Error entries in the OpenSSL error queue may contain additional
contextual information associated with the error, which can be helpful
when debugging.

This "additional data" is currently only printed to stderr when
OpenSSL.debug is enabled. Let's include this in the exception messages
raised with ossl_raise(), too.

	$ ruby -Ilib -ropenssl -e'OpenSSL.debug=true; OpenSSL::SSL::SSLContext.new.ecdh_curves="P-256:not-a-curve"'
	-e:1: warning: error on stack: error:0A080106:SSL routines:gid_cb:passed invalid argument (group 'not-a-curve' cannot be set)
	-e:1:in `ecdh_curves=': passed invalid argument (group 'not-a-curve' cannot be set) (OpenSSL::SSL::SSLError)
		from -e:1:in `<main>'

https://github.com/ruby/openssl/commit/1c5bbdd68e
2023-08-16 14:48:41 +09:00
Kazuki Yamaguchi 01d368e7b0 [ruby/openssl] ssl: raise SSLError if loading ca_file or ca_path fails
When compiled with OpenSSL <= 1.1.1, OpenSSL::SSL::SSLContext#setup
does not raise an exception on an error return from
SSL_CTX_load_verify_locations(), but instead only prints a verbose-mode
warning. This is not helpful since it very likely indicates an actual
error, such as the specified file not being readable.

Also, OpenSSL's error queue is not correctly cleared:

	$ ruby -w -ropenssl -e'OpenSSL.debug=true; ctx=OpenSSL::SSL::SSLContext.new; ctx.ca_file="bad-path"; ctx.setup; pp OpenSSL.errors'
	-e:1: warning: can't set verify locations
	["error:02001002:system library:fopen:No such file or directory",
	 "error:2006D080:BIO routines:BIO_new_file:no such file",
	 "error:0B084002:x509 certificate routines:X509_load_cert_crl_file: system lib"]

The behavior is currently different when compiled with OpenSSL >= 3.0:
SSLError is raised if SSL_CTX_load_verify_file() or
SSL_CTX_load_verify_dir() fails.

This inconsistency was unintentionally introduced by commit https://github.com/ruby/openssl/commit/5375a55ffc35
("ssl: use SSL_CTX_load_verify_{file,dir}() if available", 2020-02-22).
However, raising SSLError seems more appropriate in this situation.
Let's adjust the OpenSSL <= 1.1.1 code so that it behaves the same way
as the OpenSSL >= 3.0 code currently does.

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

https://github.com/ruby/openssl/commit/7eb10f7b75
2023-08-16 14:48:41 +09:00
Jun Aruga 8dd5c20224 [ruby/openssl] Raise an error when the specified OpenSSL library directory doesn't exist.
OpenSSL built from the source creates the library directory to the
`/path/to/openssl_dir/lib64` as a default.
In the case, the `bundle exec rake compile -- --with-openssl-dir=<openssl_dir>`
cannot compile with the lib64 directory, and may compile with system OpenSSL's
libraries unintentionally. This commit is to check this case to avoid linking
with an unintentional library directory.

https://github.com/ruby/openssl/commit/ca54087462
2023-08-16 14:48:41 +09:00
Kazuki Yamaguchi 0eaee5c000 [ruby/openssl] [DOC] enhance RDoc for exporting pkeys
Describe the behavior of OpenSSL::PKey::{DH,DSA,EC,RSA}#to_pem
and #to_der more clearly. They return a different result depending on
whether the pkey is a public or private key. This was not documented
adequately.

Also, suggest the use of OpenSSL::PKey::PKey#private_to_pem
and #public_to_pem instead, if possible.

https://github.com/ruby/openssl/commit/d22769af8f
2023-08-16 14:48:40 +09:00
Kazuki Yamaguchi fae6fd07fe [ruby/openssl] [DOC] prefer PKey#private_to_pem and #public_to_pem in RDoc
Suggest the use of OpenSSL::PKey::PKey#private_to_pem and #public_to_pem
in the top-level documentation. For new programs, these are recommended
over OpenSSL::PKey::RSA#export (also aliased as #to_s and #to_pem)
unless there is a specific reason to use it, i.e., unless the PKCS#1
output format specifically is required.

The output format of OpenSSL::PKey::RSA#export depends on whether the
key is a public key or a private key, which is very counter-intuitive.

Additionally, when called with arguments to encrypt a private key, as in
this example, OpenSSL's own, non-standard format is used. The man page
of PEM_write_bio_PrivateKey_traditional(3) in OpenSSL 1.1.1 or later
states that it "should only be used for compatibility with legacy
programs".

https://github.com/ruby/openssl/commit/56312038d6
2023-08-16 14:48:40 +09:00
Kazuki Yamaguchi 4541cd4cba [ruby/openssl] [DOC] prefer "password" to "passphrase"
Let's consistently use the word "password". Although they are considered
synonymous, the mixed usage in the rdoc can cause confusion.

OpenSSL::KDF.scrypt is an exception. This is because RFC 7914 refers to
the input parameter as "passphrase".

https://github.com/ruby/openssl/commit/06d67640e9
2023-08-16 14:48:40 +09:00
Kazuki Yamaguchi cb344e4e25 [ruby/openssl] ssl: adjust "certificate verify failed" error on SSL_ERROR_SYSCALL
Enrich SSLError's message with the low-level certificate verification
result, even if SSL_get_error() returns SSL_ERROR_SYSCALL. This is
currently done on SSL_ERROR_SSL only.

According to the man page of SSL_get_error(), SSL_ERROR_SYSCALL may be
returned for "other errors, check the error queue for details". This
apparently means we have to treat SSL_ERROR_SYSCALL, if errno is not
set, as equivalent to SSL_ERROR_SSL.

https://github.com/ruby/openssl/commit/5113777e82
2023-08-16 14:48:39 +09:00
Kazuki Yamaguchi 66a70582f4 [ruby/openssl] ssl: adjust styles of ossl_start_ssl()
Expand tabs, insert some spaces, and adjust indentation of switch-case
to match Ruby's style.

https://github.com/ruby/openssl/commit/10833aa8f6
2023-08-16 14:48:39 +09:00
Sorah Fukumori d2864ca330 [ruby/zlib] Zlib.gunzip should not fail with utf-8 strings
(https://github.com/ruby/zlib/pull/55)

zstream_discard_input was encoding and character-aware when given input is user-provided, so this discards `len` chars instead of `len` bytes.

Also Zlib.gunzip explains in its rdoc that it is equivalent with the following code, but this doesn't fail for UTF-8 String.

```ruby
string = %w[1f8b0800c28000000003cb48cdc9c9070086a6103605000000].pack("H*").force_encoding('UTF-8')
sio = StringIO.new(string)
p gz.read #=> "hello"
gz&.close
p Zlib.gunzip(string) #=> Zlib::DataError
```

Reported and discovered by eagletmt at https://twitter.com/eagletmt/status/1689692467929694209

https://github.com/ruby/zlib/commit/c5e58bc62a
2023-08-10 20:12:21 +00:00
Jean byroot Boussier fd8dd71996
Implement StringIO#pread (#56)
Both for being closer to real IOs and also because it's a convenient API
in multithreaded scenarios.

Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2023-08-02 18:18:17 +09:00
Sutou Kouhei fe25527781 [ruby/fiddle] Include stdbool.h explicitly
https://github.com/ruby/fiddle/commit/c313a74632
2023-08-02 18:17:20 +09:00
Sutou Kouhei 673f4493b0 [ruby/fiddle] Include stdbool.h explicitly
https://github.com/ruby/fiddle/commit/69ff680bf6
2023-08-02 18:17:19 +09:00
Sutou Kouhei 15e8cf7ad9 [ruby/fiddle] Add support for bool
GitHub: fix https://github.com/ruby/fiddle/pull/130

Reported by Benoit Daloze. Thanks!!!

https://github.com/ruby/fiddle/commit/bc6c66bbb9
2023-08-02 18:17:18 +09:00
Sutou Kouhei 10588fa121 [ruby/fiddle] Use ifdef
https://github.com/ruby/fiddle/commit/6cdf53726d
2023-08-02 18:17:16 +09:00
Peter Zhu 91e13a5207 [ruby/strscan] Fix indentation in strscan.c
[ci skip]
2023-07-28 10:12:52 -04:00
Peter Zhu 7193b404a1 Add function rb_reg_onig_match
rb_reg_onig_match performs preparation, error handling, and cleanup for
matching a regex against a string. This reduces repetitive code and
removes the need for StringScanner to access internal data of regex.
2023-07-27 13:33:40 -04:00
Peter Zhu e27eab2f85 [ruby/strscan] Sync missed commit
Syncs commit ruby/strscan@76b377a5d8.
2023-07-27 09:42:42 -04:00
Benoit Daloze 14d16bdb1a [ruby/openssl] Always respect the openssl prefix chosen by truffle/openssl-prefix on TruffleRuby
* See https://github.com/ruby/openssl/issues/650#issuecomment-1645699608

https://github.com/ruby/openssl/commit/ca738e7e13
2023-07-24 15:08:54 +09:00
Nobuyoshi Nakada 19486ebd72 [flori/json] Re-generate parser.c
https://github.com/flori/json/commit/82a75ba98e
2023-07-19 00:02:58 +09:00
Nobuyoshi Nakada 768668a4de [flori/json] Remove unnecessary code
In `JSON#generate` and `JSON#fast_generate`:

- When the given `opts` is a `JSON::State` the variable is set to
  `nil`.
- But it will be never used as the next `if` blocks will not be
  executed.
- `JSON::State#configure` does the conversion to `Hash`, the
  conversions in the `if` block are just duplication.
- `JSON::State.new` does the same thing with `configure` when an
  argument is given.

https://github.com/flori/json/commit/5d9ab87f8e
2023-07-19 00:02:58 +09:00
Nobuyoshi Nakada 104089ce02 [flori/json] [DOC] Remove duplicate sentence
https://github.com/flori/json/commit/ed242667b4
2023-07-19 00:02:58 +09:00
Nobuyoshi Nakada f1f84ca71c [flori/json] Remove `HAVE_RB_SCAN_ARGS_OPTIONAL_HASH` check
This macro is defined since ruby 2.1, which is older than the required
ruby version.

https://github.com/flori/json/commit/dd1d54e78a
2023-07-19 00:02:58 +09:00
Hiroshi SHIBATA 56c8dab468 [flori/json] Skip BigDecimal tests when it's missing to load
https://github.com/flori/json/commit/3dd36c6077
2023-07-18 12:25:55 +09:00
Dimitar Haralanov 9977462fd9 [flori/json] Rename JSON::ParseError to JSON:ParserError
https://github.com/flori/json/commit/20b80ca317
2023-07-18 12:25:54 +09:00
yui-knk 0a570a0069 Fix `#line` directive filename of ripper.c
Before:

```c
/* First part of user prologue.  */
#line 14 "parse.y"
```

After:

```c
/* First part of user prologue.  */
#line 14 "ripper.y"
```
2023-07-16 19:27:08 +09:00
Nobuyoshi Nakada 5c77402d88
Fix null pointer access in Ripper#initialize
In `rb_ruby_ripper_parser_allocate`, `r->p` is NULL between creating
`self` and `parser_params` assignment.  As GC can happen there, the
typed-data functions for it need to consider the case.
2023-07-16 15:41:10 +09:00
yui-knk 82cd70ef93 Use functions defined by parser_st.c to reduce dependency on st.c 2023-07-15 12:50:40 +09:00
Nobuyoshi Nakada 9c1fe9064c
[Feature #19757] Add new API `rb_data_define` 2023-07-13 17:55:55 +09:00
Nobuyoshi Nakada 47cb789332 [ruby/etc] Declare `getlogin` even if unistd.h is not available
Although MinGW provides this header but not the function, Windows
version ruby provides the function.

https://github.com/ruby/etc/commit/f7fa1884fa
2023-07-12 16:22:54 +00:00
Kazuki Yamaguchi f4bf80623f [ruby/openssl] [DOC] remove top-level example for
OpenSSL::Cipher#pkcs5_keyivgen
(https://github.com/ruby/openssl/pull/647)

OpenSSL::Cipher#pkcs5_keyivgen should only be used when it is
absolutely necessary for compatibility with ancient applications.
Having an example can be misleading. We already have another example
for OpenSSL::Cipher in which PBKDF2 is used to derive a key.

As described in the rdoc of OpenSSL::Cipher#pkcs5_keyivgen, it is
compatible with PKCS#5 PBES1 (PKCS#5 v1.5) only when used in combination
of a hash function MD2, MD5, or SHA-1, and a cipher DES-CBC or RC2-CBC.
This example uses MD5 as the hash function and combines it with AES.
This is considered insecure and also using a non-standard technique to
derive longer keys.

https://github.com/ruby/openssl/commit/e379cc0cca
2023-07-12 23:40:58 +09:00
Ryo Kajiwara 4b6d667c63 [ruby/openssl] Add support for raw private/public keys
(https://github.com/ruby/openssl/pull/646)

Add OpenSSL::PKey.new_raw_private_key, #raw_private_key and public
equivalents. These methods are useful for importing and exporting keys
that support "raw private/public key". Currently, OpenSSL implements
X25519/X448 and Ed25519/Ed448 keys.

[rhe: rewrote commit message]

https://github.com/ruby/openssl/commit/3f29525618

Co-authored-by: Bart de Water <bartdewater@gmail.com>
2023-07-12 23:40:58 +09:00
Nobuyoshi Nakada 4fced78605 [ruby/etc] Chec if the target file exists, not "depend" file
https://github.com/ruby/etc/commit/b95ddef386
2023-07-12 14:18:40 +00:00
Nobuyoshi Nakada 2fa77fb82d [ruby/etc] Fix for srcdir with spaces
Fixes https://github.com/ruby/etc/pull/22.
Build failure when the ruby installed directory name contains spaces.

https://github.com/ruby/etc/commit/1ab19d5815
2023-07-12 14:18:39 +00:00
Nobuyoshi Nakada efd8ea366b [ruby/etc] Declare `getlogin` only if unistd.h is not available
https://github.com/ruby/etc/commit/365398ea47
2023-07-12 14:18:39 +00:00
Nobuyoshi Nakada c8d0470bb0
Use `File::NULL` instead of hard coded null device names 2023-07-10 19:21:47 +09:00
yui-knk b2bccf053b Include ripper.h into `$distcleanfiles` 2023-07-09 13:02:25 +09:00
cryptogopher 5f07f78e86 [ruby/bigdecimal] Update to_s doc examples
https://github.com/ruby/bigdecimal/commit/8a94a29cf1
2023-07-05 20:15:53 +00:00
cryptogopher 10f59dcbcd [ruby/bigdecimal] Add .to_s('F') digit grouping for integer part
https://github.com/ruby/bigdecimal/commit/f63544d465
2023-07-05 20:15:52 +00:00
Hiroshi SHIBATA 1e7ddfa7ea [ruby/psych] Extract accessor methods without forwardable
We should leave additional dependency if we leave from them.

https://github.com/ruby/psych/commit/3d0325a774
2023-07-05 10:11:36 +00:00
Nobuyoshi Nakada 765a19ab59 [ruby/psych] Remove private methods unused since #487
https://github.com/ruby/psych/commit/902c292f26
2023-07-01 15:30:21 +00:00
Peter Zhu 58386814a7 Don't check for null pointer in calls to free
According to the C99 specification section 7.20.3.2 paragraph 2:

> If ptr is a null pointer, no action occurs.

So we do not need to check that the pointer is a null pointer.
2023-06-30 09:13:31 -04:00
Nobuyoshi Nakada c89f519170
More dependencies for ripper 2023-06-29 18:47:56 +09:00
Peter Zhu a500eb9f8c Fix memory leak in Ripper
The following script leaks memory in Ripper:

```ruby
require "ripper"

20.times do
  100_000.times do
    Ripper.parse("")
  end

  puts `ps -o rss= -p #{$$}`
end
```
2023-06-28 09:50:51 -04:00
Jean byroot Boussier f1313caec1 [ruby/fiddle] Mark Closure, Function and Handle as write barrier
protected
(https://github.com/ruby/fiddle/pull/129)

They don't have a mark function, so they don't need any change.

https://github.com/ruby/fiddle/commit/9bbc732aef

Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2023-06-28 16:36:53 +09:00
Jean byroot Boussier 135d5fa36c [ruby/fiddle] Implement write barriers for Fiddle::Pointer
(https://github.com/ruby/fiddle/pull/127)

Save from having to mark them on every minor.

https://github.com/ruby/fiddle/commit/153c09c99f

Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2023-06-28 16:36:52 +09:00
Sutou Kouhei 572b432e50 [ruby/fiddle] Fix a typo
https://github.com/ruby/fiddle/commit/4c0c5da1a5
2023-06-28 16:36:52 +09:00
Sutou Kouhei 02661f5e9b [ruby/fiddle] Add support for converting "C" (one character string) to char
GitHub: fix https://github.com/ruby/fiddle/pull/96

I wanted to add a test for this but I couldn't find a function that
has a "char" argument in libc...

Reported by kojix2. Thanks!!!

https://github.com/ruby/fiddle/commit/2c863ef8ba
2023-06-28 16:36:51 +09:00
Sutou Kouhei 731d27729b [ruby/fiddle] Add support for more "short" variants
https://github.com/ruby/fiddle/commit/2b22bb9d74
2023-06-28 16:36:50 +09:00
Sutou Kouhei ebf14d01ba [ruby/fiddle] Add support for "long" variants
GitHub: fix https://github.com/ruby/fiddle/pull/100

Reported by David M. Lary. Thanks!!!

https://github.com/ruby/fiddle/commit/516333dd78
2023-06-28 16:36:50 +09:00
Aaron Patterson 85937f3a0a [ruby/fiddle] Add a helper method for reading/writing memory
(https://github.com/ruby/fiddle/pull/123)

This commit adds two new methods, `Fiddle::Pointer.read` and
`Fiddle::Pointer.write`. Both methods take an address, and will read or
write bytes at that address respectively.

For example we can read from an address without making a Pointer object:

```ruby
Fiddle::Pointer.read(address, 5) # read 5 bytes
```

We can also write to an address without allocating a Pointer object:

```ruby
Fiddle::Pointer.write(address, "bytes") # write 5 bytes
```

This allows us to read / write memory at arbitrary addresses without
instantiating a new `Fiddle::Pointer` object.

Examples where this API would be useful
[1](f03481d28b/lib/tenderjit/fiddle_hacks.rb (L26-L28))
[2](77c8daa2d4/lib/ruby_vm/rjit/c_pointer.rb (L193))
[3](77c8daa2d4/lib/ruby_vm/rjit/c_pointer.rb (L284))

I also added a writer method for the same reasons as the reader.

---------

https://github.com/ruby/fiddle/commit/04238cefed

Co-authored-by: Sutou Kouhei <kou@clear-code.com>
2023-06-28 16:36:49 +09:00
qwyng e9f62fa5a7 [ruby/openssl] add OpenSSL Provider support
https://github.com/ruby/openssl/commit/189c167e40
[rhe: tool/update-deps --fix to update ext/openssl/depend]
2023-06-19 17:45:51 +09:00
Kazuki Yamaguchi af66b9b720 [ruby/openssl] pkey: use unsigned type for bit fields
clang generates a warning:

	../../../../ext/openssl/ossl_pkey.c:326:22: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
	    arg->interrupted = 1;
	                     ^ ~
	1 error generated.

https://github.com/ruby/openssl/commit/4b2ba7b022
2023-06-19 01:57:09 +09:00
Kazuki Yamaguchi 397ebbc62d [ruby/openssl] Drop support for Ruby 2.6
Ruby 2.6 has reached EOL on 2022-03. Requiring Ruby 2.7 allows us to
use C99 syntax.

https://github.com/ruby/openssl/commit/f6ba75e51e
2023-06-19 01:57:09 +09:00
Kazuki Yamaguchi 1d0a087d45 [ruby/openssl] extconf.rb: apply RUBY_OPENSSL_EXT{C,LD}FLAGS after checking features
RUBY_OPENSSL_EXTCFLAGS and RUBY_OPENSSL_EXTLDFLAGS have been added for
the primary purpose of appending custom warning flags during
development and CI.

Since checking programs generated by mkmf may not be completely
warning-free, we don't want to apply -Werror that may be supplied from
those environment variables.

https://github.com/ruby/openssl/commit/2a95b971d5
2023-06-19 01:57:09 +09:00
Jun Aruga 2a4834057b [ruby/openssl] Workaround: Fix OpenSSL::PKey.read that cannot parse PKey in the FIPS mode.
This commit is a workaround to avoid the error below that the
`OpenSSL::PKey.read` fails with the OpenSSL 3.0 FIPS mode.

```
$ openssl genrsa -out key.pem 4096

$ ruby -e "require 'openssl'; OpenSSL::PKey.read(File.read('key.pem'))"
-e:1:in `read': Could not parse PKey (OpenSSL::PKey::PKeyError)
  from -e:1:in `<main>'
```

The root cause is on the OpenSSL side. The `OSSL_DECODER_CTX_set_selection`
doesn't apply the selection value properly if there are multiple providers, and
a provider (e.g.  "base" provider) handles the decoder implementation, and
another provider (e.g. "fips" provider) handles the keys.

The workaround is to create `OSSL_DECODER_CTX` variable each time without using
the `OSSL_DECODER_CTX_set_selection`.

https://github.com/ruby/openssl/commit/5ff4a31621
2023-06-19 01:57:09 +09:00
Jean Boussier 1965c09ee5 [ruby/openssl] Implement Write Barrier for all OpenSSL types
The vast majority have no reference so it's just a matter of setting the flags.

For the couple exception, they have very little references so it's
easy.

https://github.com/ruby/openssl/commit/2c7c6de69e
2023-06-19 01:57:09 +09:00
Jun Aruga 0a84bd6b0b [ruby/openssl] Append flags from environment variables.
According to the `mkmf.rb#init_mkmf`, there are command line options below.

* `--with-cflags` to set the `cflags`
* `--with-ldflags` to set the `ldflags`

For example the following command compiles with the specified flags. Note that
`MAKEFLAGS` is to print the compiler command lines.

```
$ MAKEFLAGS="V=1" \
  bundle exec rake compile -- \
  --with-cflags="-Wundef -Werror" \
  --with-ldflags="-fstack-protector"
```

However, I couldn't find command line options to append the flags. And this
commit is to append the `cflags` and `ldflags` by the environment variables.

```
$ MAKEFLAGS="V=1" \
  RUBY_OPENSSL_EXTCFLAGS="-Wundef -Werror" \
  RUBY_OPENSSL_EXTLDFLAGS="-fstack-protector" \
  bundle exec rake compile
```

https://github.com/ruby/openssl/commit/b551eb86f6
2023-06-19 01:57:09 +09:00
Nobuyoshi Nakada 31e24a42f3 [ruby/psych] Comment out the code used to expand the file list [ci skip]
https://github.com/ruby/psych/commit/715f3bfad0
2023-06-12 12:31:52 +00:00
Nobuyoshi Nakada 70483f6ca4
Add missing dependencies 2023-06-12 19:10:29 +09:00
yui-knk b481b673d7 [Feature #19719] Universal Parser
Introduce Universal Parser mode for the parser.
This commit includes these changes:

* Introduce `UNIVERSAL_PARSER` macro. All of CRuby related functions
  are passed via `struct rb_parser_config_struct` when this macro is enabled.
* Add CI task with 'cppflags=-DUNIVERSAL_PARSER' for ubuntu.
2023-06-12 18:23:48 +09:00
Nobuyoshi Nakada bcded49d1a [ruby/psych] Update spec files
https://github.com/ruby/psych/commit/ba6fc48591
2023-06-12 07:02:02 +00:00
Samuel Williams 3fe09eba9d
Add deprecations for public `struct rb_io` members. (#7916)
* Add deprecations for public struct rb_io members.
2023-06-08 20:22:43 +09:00
Hiroshi SHIBATA d6bddcb013
racc/cparse is extracted from ruby/ruby repository 2023-06-08 18:05:07 +09:00
Hiroshi SHIBATA d1775aa388 Try to promote racc as bundled gems 2023-06-08 17:25:38 +09:00
Hiroshi SHIBATA b90683be44 [ruby/psych] Drop to support Ruby 2.4 because the latest version of core_assertions only support Ruby 2.5+
https://github.com/ruby/psych/commit/6ec316b7fa
2023-06-08 07:51:44 +00:00
Peter Zhu 7577c101ed
Unify length field for embedded and heap strings (#7908)
* Unify length field for embedded and heap strings

The length field is of the same type and position in RString for both
embedded and heap allocated strings, so we can unify it.

* Remove RSTRING_EMBED_LEN
2023-06-06 10:19:20 -04:00
eileencodes 40f090f433 Revert "Revert "Fix cvar caching when class is cloned""
This reverts commit 10621f7cb9.

This was reverted because the gc integrity build started failing. We
have figured out a fix so I'm reopening the PR.

Original commit message:

Fix cvar caching when class is cloned

The class variable cache that was added in
ruby#4544 changed the behavior of class
variables on cloned classes. As reported when a class is cloned AND a
class variable was set, and the class variable was read from the
original class, reading a class variable from the cloned class would
return the value from the original class.

This was happening because the IC (inline cache) is stored on the ISEQ
which is shared between the original and cloned class, therefore they
share the cache too.

To fix this we are now storing the `cref` in the cache so that we can
check if it's equal to the current `cref`. If it's different we don't
want to read from the cache. If it's the same we do. Cloned classes
don't share the same cref with their original class.

This will need to be backported to 3.1 in addition to 3.2 since the bug
exists in both versions.

We also added a marking function which was missing.

Fixes [Bug #19379]

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2023-06-05 11:11:12 -07:00
yui-knk 7b803eafa2 Ripper does not depend on Bison [ci skip]
It also uses Lrama then no dependency on Bison.
2023-06-03 10:34:24 +09:00
Hiroshi SHIBATA c32a30ec09 [ruby/stringio] Development of 3.0.8 started.
https://github.com/ruby/stringio/commit/1587d3698e
2023-06-02 08:20:38 +00:00
yui-knk 3a4206c7a1 No need to define "BISON" on extconf.rb
"BISON" is defined in "ext/ripper/depend".
2023-06-02 09:28:30 +09:00
Aaron Patterson 10621f7cb9
Revert "Fix cvar caching when class is cloned"
This reverts commit 77d1b08247.
2023-06-01 14:55:36 -07:00
eileencodes 77d1b08247 Fix cvar caching when class is cloned
The class variable cache that was added in
https://github.com/ruby/ruby/pull/4544 changed the behavior of class
variables on cloned classes. As reported when a class is cloned AND a
class variable was set, and the class variable was read from the
original class, reading a class variable from the cloned class would
return the value from the original class.

This was happening because the IC (inline cache) is stored on the ISEQ
which is shared between the original and cloned class, therefore they
share the cache too.

To fix this we are now storing the `cref` in the cache so that we can
check if it's equal to the current `cref`. If it's different we don't
want to read from the cache. If it's the same we do. Cloned classes
don't share the same cref with their original class.

This will need to be backported to 3.1 in addition to 3.2 since the bug
exists in both versions.

We also added a marking function which was missing.

Fixes [Bug #19379]

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2023-06-01 08:52:48 -07:00
Samuel Williams d5a5333168 [ruby/stringio] Avoid direct struct usage.
(https://github.com/ruby/stringio/pull/54)

We will eventually want to refactor this, but for now this is compatible
enough.
2023-06-01 11:41:19 +00:00
Samuel Williams 64ec1813ac
Restores the changes in `io-console` without breaking backwards compatibility. (#7882)
This reverts commit 35da41b29b.

This updates `io-console` to avoid accessing the internal details of `rb_io_t`
and instead use `rb_io_descriptor` and `rb_io_path` etc.
2023-06-01 17:43:45 +09:00
Samuel Williams a218ed5692
Hide the usage of `rb_io_t` where possible. (#7880)
This retries the compatible parts of the previously reverted PR so we can continue to update related code without breaking backwards compatibility.
2023-06-01 14:23:30 +09:00
Hiroshi SHIBATA 35da41b29b
Revert https://github.com/ruby/io-console/pull/43
This reverts commit 1889133c04 and
  commit 764207e47c.

  Followed up with 85dcc4866d
2023-06-01 09:36:55 +09:00
NARUSE, Yui 85dcc4866d Revert "Hide most of the implementation of `struct rb_io`. (#6511)"
This reverts commit 18e55fc1e1.

fix [Bug #19704]
https://bugs.ruby-lang.org/issues/19704
This breaks compatibility for extension libraries. Such changes
need a discussion.
2023-06-01 08:43:22 +09:00
Benoit Daloze 30b960ba34 [ruby/io-nonblock] Add TruffleRuby support and add it in CI
* Do not use a C extension on TruffleRuby for these 3 methods.

https://github.com/ruby/io-nonblock/commit/1b8e52abfa
2023-05-30 12:39:26 +00:00
Benoit Daloze c7c8e4c96e [ruby/io-nonblock] Use the correct pattern for the fallback of rb_io_descriptor()
* See d1d9aef45c

https://github.com/ruby/io-nonblock/commit/dadb42422b
2023-05-30 12:39:25 +00:00
Samuel Williams 18e55fc1e1
Hide most of the implementation of `struct rb_io`. (#6511)
* Add rb_io_path and rb_io_open_descriptor.

* Use rb_io_open_descriptor to create PTY objects

* Rename FMODE_PREP -> FMODE_EXTERNAL and expose it

FMODE_PREP I believe refers to the concept of a "pre-prepared" file, but
FMODE_EXTERNAL is clearer about what the file descriptor represents and
aligns with language in the IO::Buffer module.

* Ensure that rb_io_open_descriptor closes the FD if it fails

If FMODE_EXTERNAL is not set, then it's guaranteed that Ruby will be
responsible for closing your file, eventually, if you pass it to
rb_io_open_descriptor, even if it raises an exception.

* Rename IS_EXTERNAL_FD -> RUBY_IO_EXTERNAL_P

* Expose `rb_io_closed_p`.

* Add `rb_io_mode` to get IO mode.

---------

Co-authored-by: KJ Tsanaktsidis <ktsanaktsidis@zendesk.com>
2023-05-30 10:02:40 +09:00
Benoit Daloze f61bd3ca80 [ruby/cgi] Add TruffleRuby support and add it in CI
https://github.com/ruby/cgi/commit/1240fec9c9
2023-05-29 19:33:38 +00:00
Benoit Daloze 610038f3bf [ruby/etc] Use the correct pattern for the fallback of rb_io_descriptor()
* See d1d9aef45c

https://github.com/ruby/etc/commit/5185685003
2023-05-29 19:31:55 +00:00
Samuel Williams 98f500d095
[ruby/openssl] Remove usage of IO internals. 2023-05-29 22:01:58 +09:00
Samuel Williams 764207e47c [ruby/io-console] Remove trailing whitespace.
https://github.com/ruby/io-console/commit/55f1586463
2023-05-29 12:37:49 +00:00
Samuel Williams 1889133c04 [ruby/io-console] Remove usage of IO internals.
(https://github.com/ruby/io-console/pull/43)

https://github.com/ruby/io-console/commit/4b839a504f

Co-authored-by: Benoit Daloze <eregontp@gmail.com>
2023-05-29 12:30:32 +00:00
Samuel Williams 14abb799c9 [ruby/io-nonblock] Remove usage of IO internals.
(https://github.com/ruby/io-nonblock/pull/11)

https://github.com/ruby/io-nonblock/commit/caa2b94d19
2023-05-28 08:40:38 +00:00
Samuel Williams 55393645a1 [ruby/io-nonblock] Revert "Remove usage of IO internals."
This reverts commit https://github.com/ruby/io-nonblock/commit/9772b6dcb63c.

https://github.com/ruby/io-nonblock/commit/08cabf78e1
2023-05-28 08:01:50 +00:00
Samuel Williams 26dd9c5f0f [ruby/io-nonblock] Remove usage of IO internals.
https://github.com/ruby/io-nonblock/commit/9772b6dcb6
2023-05-28 07:49:33 +00:00
Samuel Williams 881757c03f [ruby/io-wait] Remove usage of IO internals.
(https://github.com/ruby/io-wait/pull/25)

https://github.com/ruby/io-wait/commit/e5854b46c7
2023-05-28 05:09:02 +00:00
Samuel Williams 00d6674636 [ruby/etc] Remove usage of IO internals.
(https://github.com/ruby/etc/pull/26)

https://github.com/ruby/etc/commit/ea15eceb13
2023-05-28 05:08:40 +00:00
Hiroshi SHIBATA e5bce57e1d [ruby/nkf] Bump up nkf-0.1.3
https://github.com/ruby/nkf/commit/bc90e2ed39
2023-05-25 09:11:36 +00:00
Hiroshi SHIBATA 3026a2f4e9 [ruby/nkf] Added mission extension configuration
https://github.com/ruby/nkf/commit/e627a39dff
2023-05-25 09:11:35 +00:00
Ufuk Kayserilioglu 12dfd9d1c9
[flori/json] Call `super` in `included` hook
The C extension defines an `included` hook for the
`JSON::Ext::Generator::GeneratorMethods::String` module but neglects to
call `super` in the hook. This can break the functionality of various
other code that rely on the fact that `included` on `Module` will always
be called.

https://github.com/flori/json/commit/cd8bbe56a3
2023-05-24 09:37:30 +09:00
Nobuyoshi Nakada 8d242a33af
`rb_bug` prints a newline after the message 2023-05-20 21:43:30 +09:00
Jun Aruga b26ddfd72f [ruby/openssl] Fix warnings about the OPENSSL_FIPS macro in OpenSSL 1.1.
The commit <https://github.com/ruby/openssl/commit/c5b2bc1268bc> made the warnings below
in the case of OpenSSL 1.1 where the `OPENSSL_FIPS` macro is not defined.

```
$ bundle install --standalone

$ bundle exec rake compile -- \
  --with-openssl-dir=$HOME/.local/openssl-1.1.1t-debug \
  --with-cflags="-Wundef"
mkdir -p tmp/x86_64-linux/openssl/3.2.1
cd tmp/x86_64-linux/openssl/3.2.1
/usr/local/ruby-3.2.1/bin/ruby -I. -r.rake-compiler-siteconf.rb ../../../../ext/openssl/extconf.rb -- --with-openssl-dir=/home/jaruga/.local/openssl-1.1.1t-debug --with-cflags=-Wundef
...
gcc -I. -I/usr/local/ruby-3.2.1/include/ruby-3.2.0/x86_64-linux -I/usr/local/ruby-3.2.1/include/ruby-3.2.0/ruby/backward -I/usr/local/ruby-3.2.1/include/ruby-3.2.0 -I../../../../ext/openssl -DRUBY_EXTCONF_H=\"extconf.h\" -I/home/jaruga/.local/openssl-1.1.1t-debug/include    -fPIC -Wundef  -o ossl.o -c ../../../../ext/openssl/ossl.c
../../../../ext/openssl/ossl.c: In function ‘ossl_fips_mode_get’:
../../../../ext/openssl/ossl.c:425:7: warning: "OPENSSL_FIPS" is not defined, evaluates to 0 [-Wundef]
  425 | #elif OPENSSL_FIPS
      |       ^~~~~~~~~~~~
../../../../ext/openssl/ossl.c: In function ‘ossl_fips_mode_set’:
../../../../ext/openssl/ossl.c:460:7: warning: "OPENSSL_FIPS" is not defined, evaluates to 0 [-Wundef]
  460 | #elif OPENSSL_FIPS
      |       ^~~~~~~~~~~~
../../../../ext/openssl/ossl.c: In function ‘Init_openssl’:
../../../../ext/openssl/ossl.c:1218:7: warning: "OPENSSL_FIPS" is not defined, evaluates to 0 [-Wundef]
 1218 | #elif OPENSSL_FIPS
      |       ^~~~~~~~~~~~
...
cp tmp/x86_64-linux/openssl/3.2.1/openssl.so tmp/x86_64-linux/stage/lib/openssl.so
```

https://github.com/ruby/openssl/commit/b4228cbcd6
2023-05-19 09:25:11 +09:00
Jun Aruga 678d41bc51 [ruby/openssl] Implement FIPS functions on OpenSSL 3.
This commit is to implement the `OpenSSL::OPENSSL_FIPS`, `ossl_fips_mode_get`
and `ossl_fips_mode_set` to pass the test `test/openssl/test_fips.rb`.

It seems that the `OPENSSL_FIPS` macro is not used on the FIPS mode case any
more, and some FIPS related APIs also were removed in OpenSSL 3.

See the document <https://github.com/openssl/openssl/blob/master/doc/man7/migration_guide.pod#removed-fips_mode-and-fips_mode_set>
the section OPENSSL 3.0 > Main Changes from OpenSSL 1.1.1 >
Other notable deprecations and changes - Removed FIPS_mode() and FIPS_mode_set() .

The `OpenSSL::OPENSSL_FIPS` returns always true in OpenSSL 3 because the used
functions `EVP_default_properties_enable_fips` and `EVP_default_properties_is_fips_enabled`
works with the OpenSSL installed without FIPS option.

The `TEST_RUBY_OPENSSL_FIPS_ENABLED` is set on the FIPS mode case on the CI.
Because I want to test that the `OpenSSL.fips_mode` returns the `true` or
'false' surely in the CI. You can test the FIPS mode case by setting
`TEST_RUBY_OPENSSL_FIPS_ENABLED` on local too. Right now I don't find a better
way to get the status of the FIPS mode enabled or disabled for this purpose. I
am afraid of the possibility that the FIPS test case is unintentionally skipped.

I also replaced the ambiguous "returns" with "should return" in the tests.

https://github.com/ruby/openssl/commit/c5b2bc1268
2023-05-19 09:25:10 +09:00
Nobuyoshi Nakada 3fe45a3123
Process parse.y without temporary files 2023-05-15 19:10:24 +09:00
Nobuyoshi Nakada bdaa491565 Add user argument to some macros used by bison 2023-05-14 15:38:48 +09:00
Nobuyoshi Nakada 3150516aab Preprocess input parse.y from stdin 2023-05-14 15:38:48 +09:00
Yuichiro Kaneko a1b01e7701
Use Lrama LALR parser generator instead of Bison
https://bugs.ruby-lang.org/issues/19637

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2023-05-12 18:25:10 +09:00
Hiroshi SHIBATA 59fd67fc3d Extract ext/readline 2023-05-09 12:57:12 +09:00
Nobuyoshi Nakada 6987ec45b1 [ruby/stringio] Drop support for ruby 2.6 or earlier
(https://github.com/ruby/stringio/pull/47)

`rb_io_extract_modeenc` has been exported since ruby 2.7.
2023-05-08 07:21:21 +00:00
Nobuyoshi Nakada cfa6a892d0
Redirect to `IO::NULL` for the portability 2023-05-05 18:52:36 +09:00
Nobuyoshi Nakada 409a13e9ea [ruby/stringio] Update write-barrier at copying
http://ci.rvm.jp/results/trunk-asserts@ruby-sp2-docker/4552803

```
verify_internal_consistency_reachable_i: WB miss (O->Y) 0x00007f752ddd5550 [3LM    ] strio (StringIO)strio -> 0x00007f752d19b7d0 [0      ] T_STRING (String) len: 8, capa: 15 "to_strio"
<internal:/tmp/ruby/src/trunk-asserts/lib/rubygems/core_ext/kernel_require.rb>:53: [BUG] gc_verify_internal_consistency: found internal inconsistency.
```

https://github.com/ruby/stringio/commit/2e8ab43cba
2023-05-03 05:38:27 +00:00
Akinori MUSHA 85ed226cca [ruby/syslog] Improve the version extraction
https://github.com/ruby/syslog/commit/34da65a002
2023-04-25 01:51:26 +00:00
Akinori MUSHA a66c41d600 [ruby/syslog] Raise required_ruby_version
https://github.com/ruby/syslog/commit/5289373016
2023-04-25 01:51:25 +00:00
Hiroshi SHIBATA 117fc8e72d [ruby/syslog] Expose Syslog::VERSION
https://github.com/ruby/syslog/commit/ff5d72fcb9
2023-04-25 01:51:24 +00:00
Hiroshi SHIBATA b9b43a1020 [ruby/win32ole] Reuse WIN32OLE_VERSION for gem version
https://github.com/ruby/win32ole/commit/bff3ea8b0b
2023-04-21 04:46:10 +00:00
Hiroshi SHIBATA 9702a8142b [ruby/fcntl] Expose Fcntl::VERSION
https://github.com/ruby/fcntl/commit/cb8e414e9f
2023-04-21 04:21:05 +00:00
Sutou Kouhei 67743d5823 [ruby/stringio] Development of 3.0.7 started.
https://github.com/ruby/stringio/commit/5d39880f70
2023-04-14 06:38:51 +00:00
Hiroshi SHIBATA 3733ee835b [ruby/readline-ext] Expose Readline::GEM_VERSION
https://github.com/ruby/readline-ext/commit/70aa84b80e
2023-04-14 03:43:46 +00:00
Hiroshi SHIBATA 283c190374 [ruby/nkf] Expose NKF::GEM_VERSION
https://github.com/ruby/nkf/commit/0d0fb3a162
2023-04-14 03:43:17 +00:00
Hiroshi SHIBATA 8a06f1a69f [ruby/pathname] Expose Pathname::VERSION
https://github.com/ruby/pathname/commit/2b0b1a82ee
2023-04-14 12:42:36 +09:00
HoNooD 671cfc2000 [ruby/bigdecimal] fix: typo in document comments of `f_BigDecimal` function
https://github.com/ruby/bigdecimal/commit/13abe1fd78
2023-04-08 18:54:01 +00:00
Nobuyoshi Nakada 8ec95c6074 [ruby/bigdecimal] Remove set but unused variable
This `prec` has not been used since https://github.com/ruby/bigdecimal/commit/1f5c46dbdd1c.

https://github.com/ruby/bigdecimal/commit/08a0ad563d
2023-04-08 18:53:28 +00:00
Nobuyoshi Nakada f99af43980 [Bug#19161] Detect thread local storage specifier
Checking by `__STDC_VERSION__` is unreliable because old gcc 4.8
supports `-std=gnu11` option but does not implement `_Thread_local`.
Check the implementation directly instead.
2023-04-07 13:42:48 +09:00
Nobuyoshi Nakada 75a2dff0e0 [ruby/openssl] Register global variables before assignment
https://github.com/ruby/openssl/commit/98099d3796
2023-04-07 12:09:08 +09:00
Matt Valentine-House 2a34bcaa10 Update VPATH for socket, & dependencies
The socket extensions rubysocket.h pulls in the "private" include/gc.h,
which now depends on vm_core.h. vm_core.h pulls in id.h

when tool/update-deps generates the dependencies for the makefiles, it
generates the line for id.h to be based on VPATH, which is configured in
the extconf.rb for each of the extensions. By default VPATH does not
include the actual source directory of the current Ruby so the
dependency fails to resolve and linking fails.

We need to append the topdir and top_srcdir to VPATH to have the
dependancy picked up correctly (and I believe we need both of these to
cope with in-tree and out-of-tree builds).

I copied this from the approach taken in
https://github.com/ruby/ruby/blob/master/ext/objspace/extconf.rb#L3
2023-04-06 11:07:16 +01:00
Peter Zhu 1da2e7fca3
[Feature #19579] Remove !USE_RVARGC code (#7655)
Remove !USE_RVARGC code

[Feature #19579]

The Variable Width Allocation feature was turned on by default in Ruby
3.2. Since then, we haven't received bug reports or backports to the
non-Variable Width Allocation code paths, so we assume that nobody is
using it. We also don't plan on maintaining the non-Variable Width
Allocation code, so we are going to remove it.
2023-04-04 17:30:06 -04:00
Hiroshi SHIBATA 9b7a7e9cef [ruby/pathname] Remove taint/untaint methods because they should be removed since Ruby 3.2 released.
Fixes https://github.com/ruby/pathname/pull/28

https://github.com/ruby/pathname/commit/c52fd3a835
2023-03-27 07:21:52 +00:00
Nobuyoshi Nakada 72811deaa8
MSWin: Use MESSAGE_BEGIN/MESSAGE_END instead of bare `echo`
To strip enclosing double quotes.
2023-03-02 19:18:13 +09:00
Matt Valentine-House 5e4b80177e Update the depend files 2023-02-28 09:09:00 -08:00
Jean Boussier 71dae78b89 [ruby/stringio] Implement write barrier on StringIO
It only has a single reference set in 3 places which
makes it fairly easy to implement.

https://github.com/ruby/stringio/commit/009896b973
2023-02-28 03:07:10 +00:00
Matt Valentine-House f38c6552f9 Remove intern/gc.h from Make deps 2023-02-27 10:11:56 -08:00
Hiroshi SHIBATA db0a4c8923 Prefer to use File.foreach instead of IO.foreach 2023-02-27 18:49:18 +09:00
Hiroshi SHIBATA d063ed12af Prefer to use File.binwrite instead of IO.binwrite 2023-02-27 18:49:18 +09:00
Hiroshi SHIBATA 6dfdc7b28e Prefer to use File.binread instead of IO.binread 2023-02-27 18:49:18 +09:00
BurdetteLamar d3ee9e590c [ruby/stringio] Remove (newly unneeded) remarks about aliases
https://github.com/ruby/stringio/commit/60bb320477
2023-02-25 08:38:19 +00:00
Nobuyoshi Nakada 0cde887eb9 [ruby/bigdecimal] Bump up to 3.1.4
ruby/bigdecimal#187 has changed a behavior and ruby/spec also needed a
follow up at https://github.com/ruby/ruby/commit/0d8ef62fc293.
However, because bigdecimal is a separate gem and can be updated in
older versions of ruby, `RUBY_VERSION` is not appropriate for this
guard.  That means it needs bumped up `BigDecimal::VERSION`.

https://github.com/ruby/bigdecimal/commit/3a2a7a9353
2023-02-21 15:35:40 +00:00
Benoit Daloze 7b768e4335 [ruby/bigdecimal] Move RB_GC_GUARD() at the end, like in BigMath_s_exp()
https://github.com/ruby/bigdecimal/commit/b66ef9fbb5
2023-02-21 14:24:13 +00:00
Benoit Daloze 5077cc2be6 [ruby/bigdecimal] Avoid RB_GC_GUARD(a) = b in bigdecimal
* This is not supported on TruffleRuby, which requires the value to be
  set before RB_GC_GUARD() is called.
* See https://github.com/oracle/truffleruby/pull/2879

https://github.com/ruby/bigdecimal/commit/7b2957922f
2023-02-21 14:24:12 +00:00
Charles Oliver Nutter b572f2436c
[ruby/openssl] Stub gemspec for JRuby
JRuby has its own implementation of the `openssl` library in
jruby-openssl. The simplest way for us to allow users to set
openssl as a gem dependency is to ship a stub gem that just
depends on jruby-openssl. This patch adds that to the gemspec.
Additional work may be required to fit this stub gem into the test
and release process.

See #20 for more details.

https://github.com/ruby/openssl/commit/74ccaa5e18
2023-02-21 19:50:49 +09:00
Sutou Kouhei 18e840ac60 [ruby/strscan] Bump version
https://github.com/ruby/strscan/commit/681cde0f27
2023-02-21 19:31:36 +09:00
OKURA Masafumi a44f5ab089 [ruby/strscan] Mention return value of `rest?` in the doc
(https://github.com/ruby/strscan/pull/49)

The doc of `rest?` was unclear about return value. This commit adds the
return value to the doc.
2023-02-21 19:31:35 +09:00
Nobuyoshi Nakada d13879f862 [ruby/bigdecimal] Read version from bigdecimal.c
The dependency of extconf.h on bigdecimal.gemspec does not make sense
as far as no rule is defined for it.  Also, the relationship between
extension library and gemspec file is various in default gems, and
does not work well.

https://github.com/ruby/bigdecimal/commit/7f99b28552
2023-02-21 09:50:02 +00:00
Burdette Lamar 3d53827130 [ruby/date] Removed (newly unneeded) alias remarks
(https://github.com/ruby/date/pull/88)

https://github.com/ruby/date/commit/cfa7e9868b
2023-02-19 22:24:39 +00:00
zverok e1b447a323 [DOC] Improve ObjectSpace#dump_XXX method docs
* remove false call-seq (output from Ruby parsing is cleaner)
* explain output: argument in plain words
* change parameter name in docs of #dump_shapes (typo)
2023-02-19 22:32:52 +02:00
Nobuyoshi Nakada ba1b9d3104 [ruby/bigdecimal] Fix the license name [ci skip]
```
$ gem build bigdecimal.gemspec
WARNING:  license value 'BSD-2-clause' is invalid.  Use a license identifier from
http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
Did you mean 'BSD-2-Clause'?
WARNING:  See https://guides.rubygems.org/specification-reference/ for help
```

https://github.com/ruby/bigdecimal/commit/36b77a2d2f
2023-02-19 09:58:31 +00:00
Charles Oliver Nutter becec0001c [ruby/bigdecimal] Stub out extension build on JRuby
JRuby currently ships its own internal bigdecimal extension as
part of the core libraries. In order for users to be able to add
bigdecimal to their Gemfile or gem dependencies, we need to stub
out the C extension and just load the extension shipped with
JRuby.

In the future we will try to move our BigDecimal implementation
into the gem, but for now this is the simplest way to make it
installable on JRuby.

See #169

https://github.com/ruby/bigdecimal/commit/829956c643
2023-02-17 17:52:48 +00:00
Maciej Rzasa 36e3d46d35 [ruby/bigdecimal] Handle correctly #remainder with infinity. Fixes
https://github.com/ruby/bigdecimal/pull/187

https://github.com/ruby/bigdecimal/commit/4b8572d452
2023-02-17 17:46:27 +00:00
Jean Boussier 7413079dae Encapsulate RCLASS_ATTACHED_OBJECT
Right now the attached object is stored as an instance variable
and all the call sites that either get or set it have to know how it's
stored.

It's preferable to hide this implementation detail behind accessors
so that it is easier to change how it's stored.
2023-02-15 15:24:22 +01:00
Matt Valentine-House 72aba64fff Merge gc.h and internal/gc.h
[Feature #19425]
2023-02-09 10:32:29 -05:00
Nobuyoshi Nakada 899ea35035
Extract include/ruby/internal/attr/packed_struct.h
Split `PACKED_STRUCT` and `PACKED_STRUCT_UNALIGNED` macros into the
macros bellow:
* `RBIMPL_ATTR_PACKED_STRUCT_BEGIN`
* `RBIMPL_ATTR_PACKED_STRUCT_END`
* `RBIMPL_ATTR_PACKED_STRUCT_UNALIGNED_BEGIN`
* `RBIMPL_ATTR_PACKED_STRUCT_UNALIGNED_END`
2023-02-08 12:34:13 +09:00
Charles Oliver Nutter a66bc448a4 [ruby/psych] Bump version to 5.1 for release
This version primarily updates the JRuby extension to use
SnakeYAML Engine, a newer version of the SnakeYAML library, which
also updates YAML support to 1.2. The JRuby extension now also
exposes settings for the parser.

https://github.com/ruby/psych/commit/6f2b16b343
2023-02-07 12:25:44 +00:00
Nobuyoshi Nakada cbd5de4f88 [ruby/stringio] Development of 3.0.6 started.
https://github.com/ruby/stringio/commit/a7561f447b
2023-02-03 07:49:31 +00:00
Nobuyoshi Nakada 89d9547800 [ruby/stringio] Revert "bump up to 3.0.6" [ci skip]
This reverts commit https://github.com/ruby/stringio/commit/325933500b35.
It is bumped to 3.0.5 in advance but not released yet.

https://github.com/ruby/stringio/commit/af67c36693
2023-02-02 12:44:53 +00:00
Nobuyoshi Nakada 8087ba736e [ruby/stringio] bump up to 3.0.6
https://github.com/ruby/stringio/commit/325933500b
2023-02-02 04:44:38 +00:00
Nobuyoshi Nakada fad48fefe1 [Bug #19399] Parsing invalid heredoc inside block parameter
Although this is of course invalid as Ruby code, allow to just parse
and tokenize.
2023-02-02 12:20:10 +09:00
Peter Zhu aa222b56fa [ruby/bigdecimal] Make BigDecimal WB protected
BigDecimal has no references, so it is WB protected.

https://github.com/ruby/bigdecimal/commit/29c61c90e8
2023-02-01 15:59:11 +00:00
Mau Magnaguagno 5b67c15cd8
[ruby/openssl] [DOC] Remove repeated example from Digest
https://github.com/ruby/openssl/commit/5a36cc3cb2
2023-01-31 13:14:06 +09:00
Charles Oliver Nutter 0ee819b71d
Initial move to SnakeYAML Engine
See jruby/jruby#7570 for some of the justification for this move. We only
require the parser from SnakeYAML, but in the original form it is
encumbered with Java object serialization code that keeps getting
flagged as a CVE risk. We disagree with the assessment, at least
as it pertains to JRuby (we do not use the code in question) but
our inclusion of the library continues to get flagged by auditing
tools.

This commit starts the process of moving to the successor library,
SnakeYAML Engine. The parser API is largely unchanged, except as
seen in this commit. No Java exceptions are thrown, but a number
of Psych tests fail (possibly due to Engine being YAML 1.2 only).
2023-01-31 13:14:05 +09:00
Nobuyoshi Nakada 4bc343b436 Extract check for RSTRING_SOCKLEN 2023-01-30 21:55:37 +09:00
Nobuyoshi Nakada 21dced8b01 [ruby/stringio] [Bug #19389] Fix chomping with longer separator
https://github.com/ruby/stringio/commit/eb322a9716
2023-01-28 13:00:08 +00:00
Khem Raj f49bb1505b
[ruby/fiddle] fiddle: Use C11 _Alignof to define ALIGN_OF when
possible
(https://github.com/ruby/fiddle/pull/120)

WG14 N2350 made very clear that it is an UB having type definitions
within "offsetof" [1]. This patch enhances the implementation of macro
ALIGN_OF to use builtin "_Alignof" to avoid undefined behavior when
using std=c11 or newer

clang 16+ has started to flag this [2]

Fixes build when using -std >= gnu11 and using clang16+

Older compilers gcc < 4.9 or clang < 8 has buggy _Alignof even though it
may support C11, exclude those compiler versions

[1] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2350.htm
[2] https://reviews.llvm.org/D133574

Signed-off-by: Khem Raj <raj.khem@gmail.com>

https://github.com/ruby/fiddle/commit/ad6c9aa826
2023-01-27 11:30:13 +09:00
Aaron Patterson f4609b6bc4
[ruby/fiddle] Fix comment formatting
https://github.com/ruby/fiddle/commit/36b2432575
2023-01-27 11:30:13 +09:00
Aaron Patterson 1df7f359d1
[ruby/fiddle] Update documentation
(https://github.com/ruby/fiddle/pull/119)

The documentation for `Fiddle.dlwrap` and `Fiddle.dlunwrap` were not
very accurate and pretty confusing. This commit updates the
documentation so it's easier to understand what the methods do.
2023-01-27 11:30:13 +09:00
Yusuke Nakamura a22ed3e99d
Fix homepage url in gemspec
GitHub Pages now hosted on *.github.io
2023-01-23 17:06:15 +09:00
Jean Boussier 8fded5f5d1 [ruby/psych] Fix RestrictedYAMLTree allowing the Symbol class should allow all symbols
Ref: https://github.com/ruby/psych/pull/495

That's how it works for `safe_load`:
```ruby
>> YAML.safe_load(':foo', permitted_classes: [Symbol])
=> :foo
```

So `safe_dump` should mirror that.

https://github.com/ruby/psych/commit/592a75a656
2023-01-23 02:07:23 +00:00
Hiroshi SHIBATA 8a771efec2 [ruby/psych] Bump up 5.0.2
https://github.com/ruby/psych/commit/a170b8eb46
2023-01-18 04:53:12 +00:00
Kazuhiro NISHIYAMA 8ae4e3ddc9
Clean up removed directories in ext/Setup* [ci skip] 2023-01-18 12:02:27 +09:00
Kazuhiro NISHIYAMA 2fa3fda0c4
Remove removed files from ext/.document [ci skip]
- dbm/dbm.c removed at 55cd3e4ebf
- fiber/fiber.c removed at 521ad9a13a
- gdbm/gdbm.c removed at edcc29dcff
2023-01-18 11:57:00 +09:00
Hiroshi SHIBATA 492d37fbbd [ruby/psych] Bump up 5.0.2.pre1 for testing
https://github.com/ruby/psych/commit/67ec299c68
2023-01-17 08:46:27 +00:00
Hiroshi SHIBATA dd510da89a [ruby/psych] configure of libyaml couldn't detect "arm64-apple-darwin22" for build host.
checking whether make sets $(MAKE)... (cached) yes
  checking build system type... arm-apple-darwin21.6.0
  checking host system type... Invalid configuration `arm64-apple-darwin21': machine `arm64-apple' not recognized
  configure: error: /bin/sh /Users/hsbt/Downloads/yaml-0.2.5/config/config.sub arm64-apple-darwin21 failed
  *** extconf.rb failed ***

https://github.com/ruby/psych/commit/ad1502202c
2023-01-17 08:26:22 +00:00
Rick Hull 4617b40f8b fix typo in comments / autodoc
replace _socktype_ with _type_ in the comments
2023-01-16 08:00:03 +09:00
Charles Oliver Nutter 2082ba7c69 [ruby/psych] Remove deleted file from gemspec
https://github.com/ruby/psych/commit/77861ff281
2023-01-14 01:24:39 +00:00
Benoit Daloze 6abe20e87b Remove Encoding#replicate 2023-01-11 13:41:41 +01:00
Jean Boussier 3161fd4372 [ruby/psych] Get rid of anonymous eval calls
Things declared in anonymous eval are always annoying to locate.

https://github.com/ruby/psych/commit/38871ad4e5
2023-01-11 10:08:13 +00:00
Nobuyoshi Nakada 0a2bf5f1e2 [ruby/zlib] Check for functions with arguments and the header
With arguments, mkmf skips compilation check for the function as RHS.

https://github.com/ruby/zlib/commit/9ed9d6d36e
2023-01-09 10:46:02 +00:00
Lars Kanis f6952a94eb [ruby/psych] Fix wrong package name of MSYS2/MINGW dependency
There is no package called "libyaml-devel". "libyaml" is enough.
2023-01-09 09:39:08 +00:00
Nobuyoshi Nakada 69a2687a27 [ruby/bigdecimal] Fix format specifiers for `size_t`
https://github.com/ruby/bigdecimal/commit/99db3c9754
2023-01-07 03:15:27 +00:00
Nobuyoshi Nakada dcf63b58cf [ruby/psych] Strip trailing spaces [ci skip]
https://github.com/ruby/psych/commit/e07b16ad8b
2023-01-06 06:37:01 +00:00
dsisnero f877805a0c [ruby/psych] Add msys2 dependencies for windows
https://github.com/ruby/psych/commit/9a3816d903
2023-01-06 06:33:08 +00:00
Peter Zhu 2056c0a7c6 Add embedded status to dumps of T_OBJECT
This commit adds `"embedded":true` in ObjectSpace.dump for T_OBJECTs
that are embedded.
2023-01-05 16:00:36 -05:00
Peter Zhu b8a3f1bd45 Fix crash in tracing object allocations
ObjectSpace.trace_object_allocations_start could crash since it adds a
TracePoint for when objects are freed. However, TracePoint could crash
since it modifies st tables while inside the GC that is trying to free
the object. This could cause a memory allocation to happen which would
crash if it triggers another GC.

See a crash log: http://ci.rvm.jp/results/trunk@ruby-sp1/4373707
2023-01-04 09:10:58 -05:00
Nobuyoshi Nakada f527a0911d
[DOC] [Bug #19290] fix formatting 2023-01-01 14:50:39 +09:00
Kevin Murphy b3d330c39e
Coverage.supported? recognizes oneshot_lines mode (#7040)
This adds oneshot_lines as a mode of coverage that is supported.
2022-12-29 21:23:25 +13:00
Marco Costa 5e54c57d83 [DOC] Surface existing MonitorMixin documentation 2022-12-26 17:40:11 +09:00
Sutou Kouhei 10c9ce9d4c bump up to 3.0.5 2022-12-26 15:09:21 +09:00
Sutou Kouhei 79ad045214 [ruby/strscan] Bump version
https://github.com/ruby/strscan/commit/3ada12613d
2022-12-26 15:09:21 +09:00
Mau Magnaguagno 8df574a492 [ruby/fiddle] Prefer String#unpack1 in Fiddle::ValueUtil
(https://github.com/ruby/fiddle/pull/118)

String#unpack1 is available since Ruby 2.4, and support for older than
Ruby 2.5 was dropped by #85.
Also simplified a common return statement.
2022-12-26 15:09:21 +09:00
Sutou Kouhei 1dc8c18b72 [ruby/fiddle] Bump version
https://github.com/ruby/fiddle/commit/3033266902
2022-12-26 15:09:21 +09:00
Hiroshi SHIBATA cd6c7613f3
Apply the accidental commits again before Ruby 3.2.
Reverts the following commits:

  eb8d4d7b51
  edb83dc3a2
  d40064d184
2022-12-26 12:07:42 +09:00
Hiroshi SHIBATA edb83dc3a2
Revert the additional change from openssl-3.1.0
Revert "[ruby/openssl] pkey/ec: constify"

  This reverts commit d2cd903c85.
2022-12-23 19:37:24 +09:00
Nobuyoshi Nakada d2cd903c85 [ruby/openssl] pkey/ec: constify
https://github.com/ruby/openssl/commit/6fb3499a7b
2022-12-23 11:42:15 +09:00
Hiroshi SHIBATA 3ade713967
Bump version to 1.6.2 2022-12-23 09:51:52 +09:00
Hiroshi SHIBATA ba34208800
Bump up Racc parser version 2022-12-23 09:51:35 +09:00
Johnny Willemsen 6438f3cad6 [ruby/racc] Removed old originalId in comment
https://github.com/ruby/racc/commit/1dfbef8e99
2022-12-23 09:46:59 +09:00
Kazuki Yamaguchi 2d2baaf2f4 [ruby/openssl] Ruby/OpenSSL 3.1.0
https://github.com/ruby/openssl/commit/c2f7d775c6
2022-12-23 09:39:15 +09:00
Kazuki Yamaguchi a778305919 [ruby/openssl] Ruby/OpenSSL 3.0.2
https://github.com/ruby/openssl/commit/48b79333e0
2022-12-23 09:39:15 +09:00
Kazuki Yamaguchi 046aadb89b [ruby/openssl] Ruby/OpenSSL 2.2.3
https://github.com/ruby/openssl/commit/04acccd692
2022-12-23 09:39:15 +09:00
Joe Truba 0e11d2c3f8 [ruby/openssl] pkey/ec: check private key validity with OpenSSL 3
The behavior of EVP_PKEY_public_check changed between OpenSSL 1.1.1
and 3.0 so that it no longer validates the private key. Instead, private
keys can be validated through EVP_PKEY_private_check and
EVP_PKEY_pairwise_check.

[ky: simplified condition to use either EVP_PKEY_check() or
EVP_PKEY_public_check().]

https://github.com/ruby/openssl/commit/e38a63ab3d
2022-12-23 09:39:15 +09:00
Yuta Saito 782777a803 [ruby/openssl] Undefine `OpenSSL::SSL` for no socket platforms
This fixes a linkage error about `ossl_ssl_type` on platforms which do
not have socket, like WASI.

Even before this patch, some items are disabled under `OPENSSL_NO_SOCK` since
ee22fad45d
However, due to some new use of OpenSSL::SSL::Socket over the past few years,
the build under `OPENSSL_NO_SOCK` had been broken.

This patch guards whole `OpenSSL::SSL` items by `OPENSSL_NO_SOCK`.

[ky: adjusted to apply on top of my previous commit that removed the
OpenSSL::ExtConfig, and added a guard to lib/openssl/ssl.rb.]

https://github.com/ruby/openssl/commit/b0cfac6a96
2022-12-23 09:39:15 +09:00
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 https://github.com/ruby/openssl/commit/998d66712a78 (r55191).
HAVE_TLSEXT_HOST_NAME is unused since commit https://github.com/ruby/openssl/commit/4eb4b3297a92.

https://github.com/ruby/openssl/commit/eed3894bda
2022-12-23 09:39:15 +09:00
Kazuki Yamaguchi dd6f3276e0 [ruby/openssl] ssl: disable NPN support on LibreSSL
As noted in commit https://github.com/ruby/openssl/commit/a2ed156cc9f1 ("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.

https://github.com/ruby/openssl/commit/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.

https://github.com/ruby/openssl/commit/935698e9f9
2022-12-23 09:39:15 +09:00
Nobuyoshi Nakada 6df4d272c3 [ruby/openssl] Suppress deprecation warnings by OpenSSL 3
https://github.com/ruby/openssl/commit/91657a7924
2022-12-23 09:39:15 +09:00
Nobuyoshi Nakada d7d1bb3e87 [ruby/openssl] Constify when building with OpenSSL 3
https://github.com/ruby/openssl/commit/c0023822fe
2022-12-23 09:39:15 +09:00
Nobuyoshi Nakada 2bc7eac822 [ruby/openssl] Check for functions with arguments
https://github.com/ruby/openssl/commit/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
https://github.com/ruby/openssl/commit/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
https://github.com/ruby/openssl/commit/e1e8f3cebe
2022-12-23 09:39:14 +09:00
Hiroshi SHIBATA 1998d97908
[ruby/date] Bump version to 3.3.3
https://github.com/ruby/date/commit/ea3644a7c4
2022-12-19 10:50:21 +09:00
Nobuyoshi Nakada c316a5f2f1 [ruby/date] Adjust format [ci skip]
https://github.com/ruby/date/commit/71c35b4054
2022-12-18 03:03:54 +00:00
Nobuyoshi Nakada b8cc0992c6 [ruby/date] Extract `head_match_p` and abbreviated name length constants
https://github.com/ruby/date/commit/3f666fa882
2022-12-18 02:58:51 +00:00
Nobuyoshi Nakada df49bf8150 [ruby/date] Consider the length of string to parse
https://github.com/ruby/date/commit/3bfed83ce7
2022-12-18 02:58:50 +00:00
Nobuyoshi Nakada 49dc424ff3 [ruby/date] Remove `extz_pats` table
https://github.com/ruby/date/commit/945e26e243
2022-12-18 02:58:49 +00:00
Nobuyoshi Nakada 70c905963e [ruby/date] Remove `merid_names` table
https://github.com/ruby/date/commit/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
https://github.com/ruby/date/commit/a45f8f03c9
2022-12-18 02:58:47 +00:00
Hiroshi SHIBATA 11f3bef260 [ruby/date] Bump version to 3.3.2
https://github.com/ruby/date/commit/7afd9d4615
2022-12-16 06:36:03 +00:00
Hiroshi SHIBATA d95ee11462 [ruby/io-console] Bump version to 0.6.0
https://github.com/ruby/io-console/commit/441528e3eb
2022-12-16 03:45:11 +00:00
Hiroshi SHIBATA 7e26ff7dc0 [ruby/io-wait] Bump version to 0.3.0
https://github.com/ruby/io-wait/commit/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

https://github.com/ruby/date/commit/9731a3e732
2022-12-14 07:56:09 +00:00
Hiroshi SHIBATA 9e4d7e99ce [ruby/syslog] Bump version to 0.1.1
https://github.com/ruby/syslog/commit/a92b55b638
2022-12-14 06:18:10 +00:00
Hiroshi SHIBATA 87d32376d9 [ruby/readline-ext] Bump version to 0.1.5
https://github.com/ruby/readline-ext/commit/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
https://github.com/ruby/date/commit/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.

https://github.com/ruby/openssl/commit/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.

https://github.com/ruby/openssl/commit/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

https://github.com/ruby/openssl/commit/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.

https://github.com/ruby/openssl/commit/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
https://github.com/ruby/date/commit/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

https://github.com/ruby/date/commit/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