8334 Commits
Author SHA1 Message Date
Hiroshi SHIBATA 7da01370d5 Revert "[ruby/openssl] Use EVP_Digest{Sign,Verify} when available"
This reverts commit 63f40a5be5.
2024-05-24 16:59:42 +09:00
Hiroshi SHIBATA dc969b3a9c Revert "[ruby/openssl] Enable HKDF support for LibreSSL 3.6 and later"
This reverts commit b6da54c721.
2024-05-24 16:59:42 +09:00
Theo Buehler b6da54c721 [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
2024-05-24 13:02:00 +09:00
Theo Buehler 63f40a5be5 [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
2024-05-24 13:02:00 +09:00
Hiroshi SHIBATAandJeremy Evans 5f64151768 LibreSSL 3.5 and later provide and need to use PEM_write_bio_PrivateKey_traditional()
Co-authored-by: "Jeremy Evans" <code@jeremyevans.net>
2024-05-24 13:02:00 +09:00
Hiroshi SHIBATA 0a67190735 merge revision(s) ae8990aef0:
Alias init functions

	The extension library has each initialization function named "Init_" +
	basename. If multiple extensions have the same base name (such as
	cgi/escape and erb/escape), the same function will be registered for
	both names.

	To fix this conflict, rename the initialization functions under sub
	directories using using parent names, when statically linking.
	---
	 ext/extmk.rb            | 16 +++++++++++++++-
	 template/extinit.c.tmpl |  2 +-
	 2 files changed, 16 insertions(+), 2 deletions(-)
2024-05-23 14:12:53 +09:00
Sutou Kouhei 80b11b216d merge revision(s) a4ad6bd9aa:
[ruby/fiddle] closure: free resources when an exception is raised in
	 Closure.new

	GitHub: GH-102

	https://github.com/ruby/fiddle/commit/81a8a56239
	---
	 ext/fiddle/closure.c | 56 ++++++++++++++++++++++++++++++++++++++++------------
	 1 file changed, 43 insertions(+), 13 deletions(-)
2024-05-23 10:57:56 +09:00
Hiroshi SHIBATA 26ec606bcd Merge StringIO 3.0.1.2 2024-04-23 16:04:41 +09:00
U.Nakamura 84f2aabd27 merge revision(s) ada9f8a9f7: [Backport #18914]
[ruby/fiddle] closure: follow variable name change

	GitHub: GH-102

	https://github.com/ruby/fiddle/commit/2530496602
	---
	 ext/fiddle/closure.c | 2 +-
	 1 file changed, 1 insertion(+), 1 deletion(-)
2023-10-10 20:52:53 +09:00
Eileen M. UchitelleandAaron Patterson cba152ff1f Backport cvar clone bug fix for 19379 to 3.1 (#7889)
* Copy cvar table on clone

When a class with a class variable is cloned we need to also copy the
cvar cache table from the original table to the clone. I found this bug
while working on fixing [Bug #19379]. While this does not fix that bug
directly it is still a required change to fix another bug revealed by
the fix in https://github.com/ruby/ruby/pull/7265

This needs to be backported to 3.2.x and 3.1.x.

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>

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

* Add missing write barrier

We were missing the write barrier for class_value to cref. This should
fix the segv we were seeing in http://ci.rvm.jp/logfiles/brlog.trunk-gc-asserts.20230601-165052

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>

---------

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2023-07-25 11:05:27 +00:00
nagachika 1d24a931c4 merge revision(s) 21dced8b01: [Backport #19389]
[ruby/stringio] [Bug #19389] Fix chomping with longer separator

	https://github.com/ruby/stringio/commit/eb322a9716
	---
	 ext/stringio/stringio.c        | 5 +++--
	 test/stringio/test_stringio.rb | 2 ++
	 2 files changed, 5 insertions(+), 2 deletions(-)
2023-03-21 13:56:55 +09:00
Hiroshi SHIBATA 16ea221329 Merge CGI-0.3.5 2022-11-22 23:04:45 +09:00
nagachika 8572f02d63 merge revision(s) 35c794b26d406c39f90e188e3884003fe6aca532,725626d8905fe1ac4a2cf1c3e2db6412bf8f381f,b32a3f1275a8c7748f2134492ce3c532f277d261: [Backport #18964]
Fixed by [Bug #18964]

	---
	 file.c | 3 ---
	 1 file changed, 3 deletions(-)

	[Bug #18964] Update the code range of appended portion

	---
	 ext/-test-/econv/append.c   | 15 +++++++++++++++
	 ext/-test-/econv/extconf.rb |  3 +++
	 ext/-test-/econv/init.c     | 11 +++++++++++
	 transcode.c                 | 34 ++++++++++++++++++++++++++++++----
	 4 files changed, 59 insertions(+), 4 deletions(-)
	 create mode 100644 ext/-test-/econv/append.c
	 create mode 100644 ext/-test-/econv/extconf.rb
	 create mode 100644 ext/-test-/econv/init.c

	[Bug #18964] Add test for `rb_econv_append`

	---
	 test/-ext-/econv/test_append.rb | 23 +++++++++++++++++++++++
	 1 file changed, 23 insertions(+)
	 create mode 100644 test/-ext-/econv/test_append.rb
2022-11-05 14:24:03 +09:00
nagachika 57d14154a2 merge revision(s) 9de11fe796:
Quiet if the target is already linked the same source

	---
	 ext/extmk.rb  | 2 +-
	 tool/ln_sr.rb | 6 ++++++
	 2 files changed, 7 insertions(+), 1 deletion(-)
2022-10-21 15:01:57 +09:00
nagachika 4388849ad3 merge revision(s) e5e6b87e26:
Create temporary file exclusively and clean

	---
	 ext/extmk.rb | 9 +++++++--
	 1 file changed, 7 insertions(+), 2 deletions(-)
2022-10-21 15:01:10 +09:00
nagachika 0146681df8 merge revision(s) 6af7212004:
Make extensions under `Gem.extension_api_version` directory

	---
	 ext/extmk.rb | 3 ++-
	 1 file changed, 2 insertions(+), 1 deletion(-)
2022-10-21 14:57:20 +09:00
nagachika 5822577a9b merge revision(s) c093e7d645:
Avoid to symlink under symlink

	---
	 ext/extmk.rb  |  2 +-
	 tool/ln_sr.rb | 21 ++++++++++++++-------
	 2 files changed, 15 insertions(+), 8 deletions(-)
2022-10-21 14:55:30 +09:00
nagachika d8c232935e merge revision(s) 78d2be69b5:
Move copying/linking extra files to Makefile so removed by `clean`

	---
	 ext/extmk.rb  |  81 ++++++++++++++++++++++++-----------------
	 tool/ln_sr.rb | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	 2 files changed, 161 insertions(+), 33 deletions(-)
	 create mode 100755 tool/ln_sr.rb
2022-10-21 14:54:55 +09:00
nagachika c5a0856b4b merge revision(s) ed8c21bbd5:
Ensure symlinks to bundled gem with exts have parent dir

	When configuring with `--disable-rpath` and `--static-linked-ext` (e.g.
	building for WASI), `extmk.rb` doesn't build exts under bundled gems,
	and `.bundle/gems/#{gemname}-#{ver}` are not created due to no call of
	`extmake`.
	b249178398 starts creating symlink at
	`.bundle/gems/#{gemname}-#{ver}/lib`, but the parent dir is not created,
	so configuration aginst debug and rbs gems were failed.
	---
	 ext/extmk.rb | 1 +
	 1 file changed, 1 insertion(+)
2022-10-21 14:52:23 +09:00
nagachika 93d1a2e94c merge revision(s) dcbb94d5b9:
Move timestamps directory for bundled gems

	---
	 ext/extmk.rb | 5 ++++-
	 1 file changed, 4 insertions(+), 1 deletion(-)
2022-10-21 14:51:24 +09:00
nagachika ed960c6750 merge revision(s) d7afaf21f2:
Move the target directory of bundled gems like as rubygems

	---
	 ext/extmk.rb | 6 +++++-
	 1 file changed, 5 insertions(+), 1 deletion(-)
2022-10-16 16:31:37 +09:00
nagachika e3abdccca0 merge revision(s) db3d111c1d:
Bundled gems are expanded under `.bundle/gems` now

	---
	 ext/extmk.rb          | 13 +++++++------
	 template/exts.mk.tmpl |  2 +-
	 2 files changed, 8 insertions(+), 7 deletions(-)
2022-10-16 16:29:02 +09:00
nagachika 21c876d3ca merge revision(s) b249178398:
Install gems `lib` directory to build path

	---
	 ext/extmk.rb | 19 +++++++++++++++++++
	 1 file changed, 19 insertions(+)
2022-10-15 16:27:31 +09:00
nagachika 2d26e45135 merge revision(s) a2c66f52f4:
Make dependency-free gemspec files

	The default gems have not been installed yet in the build directory,
	bundled gems depending on them can not work.  As those dependencies
	should be usable there even without rubygems, make temporary gemspec
	files without the dependencies, and use them in the build directory.
	---
	 ext/extmk.rb       | 11 +++++++++++
	 tool/gem-unpack.rb |  4 ++++
	 2 files changed, 15 insertions(+)
2022-10-15 16:26:46 +09:00
nagachika e46532feaf merge revision(s) cf7d07570f: [Backport #18938]
Dump non-ASCII char as unsigned

	Non-ASCII code may be negative on platforms plain char is signed.
	---
	 ext/objspace/objspace_dump.c   |  2 +-
	 test/objspace/test_objspace.rb | 15 +++++++++++++++
	 2 files changed, 16 insertions(+), 1 deletion(-)
2022-09-25 21:24:30 +09:00
Kazuki Yamaguchi b3969f769a Merge openssl-3.0.1
The changes can be found at:

  https://github.com/ruby/openssl/compare/v3.0.0...v3.0.1
2022-09-17 15:59:38 +09:00
Hiroshi SHIBATAandYuta Saito 1821b75969 Backport https://github.com/ruby/ruby/pull/6193
Co-authored-by: Yuta Saito <kateinoigakukun@gmail.com>
2022-09-04 16:53:31 +09:00
Hiroshi SHIBATA 04d3a84178 Merge Psych-4.0.4 2022-05-18 10:02:42 +09:00
nagachika e87640cd9d merge revision(s) 1cbdedec89:
[ruby/zlib] Mask checksums to lower 32bits

	Upper bits affect the result of `crc32` in zlib 1.2.12.

	https://github.com/ruby/zlib/commit/9ab6d04af1
	---
	 ext/zlib/zlib.c        | 12 +++++++++---
	 test/zlib/test_zlib.rb |  2 ++
	 2 files changed, 11 insertions(+), 3 deletions(-)
2022-05-05 19:18:37 +09:00
nagachika be7bcee858 remove bundled zlib patch file for mswin platform. It's already applied at zlib-1.2.12. 2022-05-01 17:43:34 +09:00
NARUSE, Yui cd4aae430d merge revision(s) f27eb8148f5a72bbacfebfecc7de9305471bb5c9,d75f7078c831d45ab5ba2fae4fbb308d01a21e46,d5836db1b398a7936b0461b3011db66f6cc8c490: [Backport #18443]
Sync io-console gem.

	---
	 ext/io/console/console.c           | 8 ++++++--
	 test/io/console/test_io_console.rb | 8 ++++++++
	 2 files changed, 14 insertions(+), 2 deletions(-)

	[ruby/io-console] bump up to 0.5.11

	https://github.com/ruby/io-console/commit/ad3805200c
	---
	 ext/io/console/io-console.gemspec | 2 +-
	 1 file changed, 1 insertion(+), 1 deletion(-)

	Fix `Leaked file descriptor: TestIO_Console#test_console_kw`

	```
	Leaked file descriptor: TestIO_Console#test_console_kw: 10 : #<File:/dev/tty>
	```
	---
	 test/io/console/test_io_console.rb | 4 +++-
	 1 file changed, 3 insertions(+), 1 deletion(-)
2022-02-01 21:56:08 +09:00
NARUSE, Yui 8177e3b8d3 Revert "Fix console.c usage of rb_io_wait."
This reverts commit aa3b2c81c8.
2022-02-01 21:53:43 +09:00
Samuel Williams aa3b2c81c8 Fix console.c usage of rb_io_wait. 2022-01-31 15:35:55 +09:00
NARUSE, Yui 1636612cc1 Prevent installing zlib library
(cherry picked from commit 82c8acbcfd)
2021-12-25 21:06:10 +09:00
Nobuyoshi Nakada e748dfb9a0 [ruby/io-console] bump up to 0.5.10
https://github.com/ruby/io-console/commit/806c65e22b
(cherry picked from commit 8247b193c0)
2021-12-25 18:55:32 +09:00
Nobuyoshi Nakada f5ddb96c49 [ruby/io-console] No longer support dead versions
https://github.com/ruby/io-console/commit/e9478509e9
(cherry picked from commit 9368fa6c30)
2021-12-25 18:55:32 +09:00
Kazuki Yamaguchi efce9ecf72 [ruby/openssl] Ruby/OpenSSL 3.0.0
https://github.com/ruby/openssl/commit/bff4080091
2021-12-25 03:31:59 +09:00
Samuel Williams 548c8f5f7a Prefer to use RTEST when checking result of rb_io_wait. (#5341)
* Prefer to use RTEST when checking result of `rb_io_wait`.

* Consistently use false for signifying no events ready.
2021-12-25 02:26:06 +13:00
Akinori MUSHA 67aab88a22 Import digest v3.1.0 from ruby/digest 2021-12-24 20:06:23 +09:00
Hiroshi SHIBATA 106a0e5195 [ruby/readline-ext] Bump version to 0.1.4
https://github.com/ruby/readline-ext/commit/6f86713b19
2021-12-24 17:53:52 +09:00
Kenta Murata 9ccfc78346 [ruby/bigdecimal] Remove unused variable
https://github.com/ruby/bigdecimal/commit/ac7daa5f15
2021-12-24 09:44:23 +09:00
Kenta Murata 65d35502bd [ruby/bigdecimal] Version 3.1.1
https://github.com/ruby/bigdecimal/commit/2ef67c2cc7
2021-12-24 02:29:02 +09:00
Kenta Murata a1d9fbef05 [ruby/bigdecimal] Fix the result precision of BigDecimal#divmod
https://github.com/ruby/bigdecimal/commit/a32f6cb9e2
2021-12-24 02:29:01 +09:00
Kenta Murata 680a4ebb3c [ruby/bigdecimal] Version 3.1.0
https://github.com/ruby/bigdecimal/commit/c3453d2b97
2021-12-24 02:29:01 +09:00
Burdette LamarandKenta Murata 0262f34905 [ruby/bigdecimal] Enhanced RDoc for BigDecimal (https://github.com/ruby/bigdecimal/pull/209)
* Enhanced RDoc for BigDecimal

* Update ext/bigdecimal/bigdecimal.c

Remove the instance number of `Float::DIG`.

* Update ext/bigdecimal/bigdecimal.c

Add BigDecimal call-seq without ndigits.

* Update ext/bigdecimal/bigdecimal.c

Replace the word sum with value or result in the description of BigDecimal().

* Update ext/bigdecimal/bigdecimal.c

Remove the instance value of Float::DIG.

* Update ext/bigdecimal/bigdecimal.c

Fix mis-description of precision

* Update ext/bigdecimal/bigdecimal.c

Fix the description of precision determination

* Update ext/bigdecimal/bigdecimal.c

Add the description of the precision in the Rational case.

https://github.com/ruby/bigdecimal/commit/acabb132a4

Co-authored-by: Kenta Murata <3959+mrkn@users.noreply.github.com>
2021-12-24 02:29:01 +09:00
Kenta Murata 79712fc083 [ruby/bigdecimal] Let BigDecimal#quo accept precision
Fix GH-214.

https://github.com/ruby/bigdecimal/commit/13e0e93f37
2021-12-24 02:29:00 +09:00
Kenta Murata 0b8638cd74 [ruby/bigdecimal] Add TODO comment
https://github.com/ruby/bigdecimal/commit/ef9cf4e69e
2021-12-24 02:29:00 +09:00
Kenta Murata 98918209b7 [ruby/bigdecimal] Allow passing both float and precision in BigDecimal#div
Fix GH-212.

https://github.com/ruby/bigdecimal/commit/900bb7fcf5
2021-12-24 02:29:00 +09:00
Jean Boussier d0897e3f3a [ruby/bigdecimal] Improve extconf to allow using bigdecimal as a git gem
e.g.
```
gem "bigdecimal", github: "ruby/bigdecimal"
```

It would fail because bundler regenerates the `gemspec`,
so `bigdecimal_version` is gone.

https://github.com/ruby/bigdecimal/commit/bccaa66f2c
2021-12-24 02:28:59 +09:00
Kenta Murata 84ae7a5df9 [ruby/bigdecimal] Add BigDecimal#precision_scale
https://github.com/ruby/bigdecimal/commit/c019caeaba
2021-12-24 02:28:59 +09:00