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

8696 Коммитов

Автор SHA1 Сообщение Дата
Jeremy Evans cfb9624460
Fix Array#[] with ArithmeticSequence with negative steps (#5739)
* Fix Array#[] with ArithmeticSequence with negative steps

Previously, Array#[] when called with an ArithmeticSequence
with a negative step did not handle all cases correctly,
especially cases involving infinite ranges, inverted ranges,
and/or exclusive ends.

Fixes [Bug #18247]

* Add Array#slice tests for ArithmeticSequence with negative step to test_array

Add tests of rb_arithmetic_sequence_beg_len_step C-API function.

* Fix ext/-test-/arith_seq/beg_len_step/depend

* Rename local variables

* Fix a variable name

Co-authored-by: Kenta Murata <3959+mrkn@users.noreply.github.com>
2022-08-11 19:16:49 +09:00
Alexander Momchilov 9c13a6ce5f [ruby/psych] Raise specific error when an anchor isn't defined
https://github.com/ruby/psych/commit/98fbd5247a
2022-08-09 01:33:34 +09:00
Alexander Momchilov 54219ae8c4 [ruby/psych] Raise specific error when aliases are not enabled
https://github.com/ruby/psych/commit/0c11ddcf46
2022-08-09 01:32:47 +09:00
Nobuyoshi Nakada 5c9ce54757 [ruby/date] bump up to 3.2.3
https://github.com/ruby/date/commit/dff37b3dd1
2022-08-08 23:59:12 +09:00
Nobuyoshi Nakada e07d450dea [ruby/date] Fix Time#to_datetime before calendar reform
Time is always in the proleptic Gregorian calendar.
Also DateTime#to_time should convert to the Gregorian calendar first,
before extracting its components.

https://bugs.ruby-lang.org/issues/18946#change-98527

https://github.com/ruby/date/commit/b2aee75248
2022-08-08 23:50:17 +09:00
Burdette Lamar 1607c6d281 [DOC] New doc about Julian/Gregorian (#70) 2022-08-07 20:42:31 -04:00
Nobuyoshi Nakada e5e6b87e26
Create temporary file exclusively and clean 2022-08-07 18:25:10 +09:00
Yuta Saito 6d8b9a9d61 Resolve abi symbol references from miniruby to avoid circular deps
Adding `ruby` to `PREP` causes the following circular dependencies
because `PREP` is used as a prerequisite by some targets required to
build `ruby` target itself.
```
make: Circular .rbconfig.time <- ruby dependency dropped.
make: Circular builtin_binary.inc <- ruby dependency dropped.
make: Circular ext/extinit.c <- ruby dependency dropped.
make: Circular ruby <- ruby dependency dropped.
```

Adding a new Make variable like `EXTPREP` only for exts may be also
reasonable, but it would introduce another complexity into our build
system. `-bundle_loader` doesn't care that link-time and run-time
loader executables are different as long as bound symbols are provided,
so it's ok to resolve from miniruby to simplify our build.
2022-08-04 16:29:22 +09:00
Alan Wu e5a3f23256 Use $(bindir) for path to executable in mkmf
For the macOS -bundle_loader linker option, we need a path to the
Ruby exectuable. $(RUBY) is not necessarily a path since it could
be a command line invocation. That happens during build with
runruby.rb and can happen post installation if the user passes
the --ruby option to a extconf.rb. Use $(bindir) to locate
the executable instead.

Before installation, $(bindir) doesn't exist, so we need to be
able to override $(BUILTRUBY) in such situations so test-spec
and bundled extensions could build. Use a new mkmf global,
$builtruby, to do this; set it in fake.rb and in extmk.rb.

Our build system is quite complex...
2022-08-04 16:29:22 +09:00
Yuta Saito 50d81bfbc1 Link ext bundles with bundle loader option for newer ld64
ld64 shipped with Xcode 14 emits a warning when using `-undefined
dynamic_lookup`.

```
ld: warning: -undefined dynamic_lookup may not work with chained fixups
```

Actually, `-undefined dynamic_lookup` doesn't work when:

1. Link a *shared library* with the option
2. Link it with a program that uses the chained-fixup introduced from
   macOS 12 and iOS 15
because `-undefined dynamic_lookup` uses lazy-bindings and they won't be
bound while dyld fixes-up by traversing chained-fixup info.

However, we build exts as *bundles* and they are loaded only through
`dlopen`, so it's safe to use `-undefined dynamic_lookup` in theory.
So the warning produced by ld64 is false-positive, and it results
failure of option checking in configuration. Therefore, it would be an
option to ignore the warning during our configuration.

On the other hand, `-undefined dynamic_lookup` is already deprecated on
all darwin platforms except for macOS, so it's good time to get rid of
the option. ld64 also provides `-bundle_loader <executable>` option,
which allows to resolve symbols defined in the executable symtab while
linking. It behaves almost the same with `-undefined dynamic_lookup`,
but it makes the following changes:

1. Require that unresolved symbols among input objects must be defined
   in the executable.
2. Lazy symbol binding will lookup only the symtab of the bundle loader
   executable. (`-undefined dynamic_lookup` lookups all symtab as flat
   namespace)

This patch adds `-bundle_loader $(RUBY)` when non-EXTSTATIC
configuration by assuming ruby executable can be linked before building
exts.

See "New Features" subsection under "Linking" section for chained fixup
https://developer.apple.com/documentation/xcode-release-notes/xcode-13-release-notes
2022-08-04 16:29:22 +09:00
Thomas Winsnes 8a1be433e8 [ruby/bigdecimal] Updated to use the correct spec for muilti license
https://github.com/ruby/bigdecimal/commit/13165b29b8
2022-08-03 11:04:31 +09:00
Thomas Winsnes f33b2ae918
Updated to use multiple licenses
Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>
2022-08-03 11:04:20 +09:00
Burdette Lamar eaf6189fe5 [ruby/date] Enhanced RDoc (https://github.com/ruby/date/pull/69)
Treats:
    ::_strptime
    ::strptime
Adds 'Related' entry to some methods' doc.

https://github.com/ruby/date/commit/a6c2129273
2022-08-03 05:17:55 +09:00
Burdette Lamar d8ea3a20fa [ruby/date] [DOC] Enhanced RDoc for parser methods (https://github.com/ruby/date/pull/68)
Treats:
    ::_httpdate
    ::_iso8601
    ::_jisx0301
    ::_parse
    ::_rfc2822
    ::_rfc3339
    ::_xmlschema
    ::httpdate
    ::iso8601
    ::jisx0301
    ::parse
    ::rfc2822
    ::rfc3339
    ::xmlschema

https://github.com/ruby/date/commit/24bdab600a
2022-08-03 02:28:12 +09:00
Koichi Sasada 5bbba76489 respect current frame of `rb_eval_string`
`self` is nearest Ruby method's `self`.
If there is no ruby frame, use toplevel `self` (`main`).

https://bugs.ruby-lang.org/issues/18780
2022-08-01 17:48:05 +09:00
Burdette Lamar 4efbeb1190 [ruby/date] Enhanced RDoc (https://github.com/ruby/date/pull/67)
Treats:
    ::httpdate
    #to_date
    #to_time
    #to_datetime
In behalf of ::httpdate, I've introduced section "Argument limit" that can be pointed to by various Date methods (similar to existing section "Argument start"). This will involve 8 already-enhanced methods plus 8 more not yet done.

https://github.com/ruby/date/commit/00326ff99c
2022-07-31 03:18:45 +09:00
Nobuyoshi Nakada 4ba2c66761
Revert "* expand tabs. [ci skip]"
This reverts commit 0d842fecb4.
2022-07-30 17:29:56 +09:00
git 0d842fecb4 * expand tabs. [ci skip]
Tabs were expanded because the file did not have any tab indentation in unedited lines.
Please update your editor config, and use misc/expand_tabs.rb in the pre-commit hook.
2022-07-30 17:26:37 +09:00
Nobuyoshi Nakada f28287d34c
[ruby/io-nonblock] Revert tab expansion 2022-07-30 17:24:43 +09:00
Hiroshi SHIBATA 39dc9f9093
Revert "* expand tabs. [ci skip]"
This reverts commit 8a65cf3b61.
2022-07-30 17:03:13 +09:00
git 8a65cf3b61 * expand tabs. [ci skip]
Tabs were expanded because the file did not have any tab indentation in unedited lines.
Please update your editor config, and use misc/expand_tabs.rb in the pre-commit hook.
2022-07-30 16:41:32 +09:00
Nobuyoshi Nakada 48b09aae7e [ruby/digest] Revert tab-expansion in external files
https://github.com/ruby/digest/commit/5ca2b5b91e
2022-07-30 16:41:19 +09:00
Burdette Lamar 53175643ef [ruby/date] [DOC] Enhanced RDoc (https://github.com/ruby/date/pull/66)
Treats:
    #===
    #to_s
    #inspect
    #strftme
    #asctime
    #iso3601
    #rfc3339
    #rfc2822
    #httpdate
    #jisx0301

https://github.com/ruby/date/commit/aed66fedf6
2022-07-30 04:51:10 +09:00
Jean Boussier 66b52f046f [flori/json] Stop including the parser source __LINE__ in exceptions
It makes testing for JSON errors very tedious. You either have
to use a Regexp or to regularly update all your assertions
when JSON is upgraded.

https://github.com/flori/json/commit/de9eb1d28e
2022-07-29 19:10:10 +09:00
Burdette Lamar c348f5a91c [ruby/date] [DOC] Enhanced RDoc for <=> (https://github.com/ruby/date/pull/65)
https://github.com/ruby/date/commit/0cdbaa92e9
2022-07-29 06:37:10 +09:00
Nobuyoshi Nakada 64c8291c7e [ruby/pathname] Fix `autoload` of `FileUtils`
Should not be `Pathname::FileUtils`.

https://github.com/ruby/pathname/commit/d1eb366e73
2022-07-27 21:05:10 +09:00
Nobuyoshi Nakada f42230ff22
Adjust styles [ci skip] 2022-07-27 18:42:27 +09:00
Hiroshi SHIBATA 8154b176de
Manually sync with https://github.com/ruby/date/pull/64 2022-07-27 14:17:19 +09:00
Peter Zhu efb91ff19b Rename rb_ary_tmp_new to rb_ary_hidden_new
rb_ary_tmp_new suggests that the array is temporary in some way, but
that's not true, it just creates an array that's hidden and not on the
transient heap. This commit renames it to rb_ary_hidden_new.
2022-07-26 09:12:09 -04:00
Ivo Anjo 649bfbe00d Fix `rb_profile_frames` output includes dummy main thread frame
The `rb_profile_frames` API did not skip the two dummy frames that
each thread has at its beginning. This was unlike `backtrace_each` and
`rb_ec_parcial_backtrace_object`, which do skip them.

This does not seem to be a problem for non-main thread frames,
because both `VM_FRAME_RUBYFRAME_P(cfp)` and
`rb_vm_frame_method_entry(cfp)` are NULL for them.

BUT, on the main thread `VM_FRAME_RUBYFRAME_P(cfp)` was true
and thus the dummy thread was still included in the output of
`rb_profile_frames`.

I've now made `rb_profile_frames` skip this extra frame (like
`backtrace_each` and friends), as well as add a test that asserts
the size and contents of `rb_profile_frames`.

Fixes [Bug #18907] (<https://bugs.ruby-lang.org/issues/18907>)
2022-07-26 10:43:44 +09:00
Nobuyoshi Nakada 6af7212004
Make extensions under `Gem.extension_api_version` directory 2022-07-24 22:32:07 +09:00
Nobuyoshi Nakada 92c7417d73
Adjust indents [ci skip] 2022-07-22 21:59:27 +09:00
Nobuyoshi Nakada c6aa65430f
Get rid of magic numbers 2022-07-22 10:41:44 +09:00
Nobuyoshi Nakada cf7d07570f
Dump non-ASCII char as unsigned
Non-ASCII code may be negative on platforms plain char is signed.
2022-07-22 09:56:48 +09:00
Jean byroot Boussier f0ae583a3d Revert "objspace_dump.c: skip dumping method name if not pure ASCII"
This reverts commit 79406e3600.
2022-07-21 19:56:08 +02:00
Jean Boussier 79406e3600 objspace_dump.c: skip dumping method name if not pure ASCII
Sidekiq has a method named `❨╯°□°❩╯︵┻━┻`which corrupts
heap dumps.

Normally we could just dump is as is since it's valid UTF-8 and need
no escaping. But our code to escape control characters isn't UTF-8
aware so it's more complicated than it seems.

Ultimately since the overwhelming majority of method names are
pure ASCII, it's not a big loss to just skip it.
2022-07-21 18:43:45 +02:00
Takashi Kokubun 5b21e94beb Expand tabs [ci skip]
[Misc #18891]
2022-07-21 09:42:04 -07:00
Nobuyoshi Nakada c093e7d645
Avoid to symlink under symlink 2022-07-16 16:38:03 +09:00
Nobuyoshi Nakada 78d2be69b5
Move copying/linking extra files to Makefile so removed by `clean` 2022-07-16 10:11:42 +09:00
Yuta Saito 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.
2022-07-15 13:14:31 +09:00
Karl Anderson 509d0a9299 [ruby/psych] Fix infinite loop bug after YAML_MEMORY_ERROR (psych issue #440)
https://github.com/ruby/psych/commit/6c56700fb2
2022-07-15 01:39:42 +09:00
Nobuyoshi Nakada 673759328c [ruby/bigdecimal] Remove checks for `struct RRational` and `struct RComplex`
These are used to see only if `RRATIONAL` and `RCOMPLEX` are
available, however, these two are macros and can be checked with
`#ifdef` directly.

https://github.com/ruby/bigdecimal/commit/175bbacd43
2022-07-14 21:02:02 +09:00
Nobuyoshi Nakada b249178398 Install gems `lib` directory to build path 2022-07-14 09:00:13 +09:00
Nobuyoshi Nakada 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.
2022-07-14 09:00:13 +09:00
Nobuyoshi Nakada dcbb94d5b9
Move timestamps directory for bundled gems 2022-07-13 00:00:46 +09:00
Burdette Lamar 3aee94fb91 [ruby/date] [DOC] Enhanced RDoc (https://github.com/ruby/date/pull/63)
Treats:
    #next
    #<<
    #>>
    #next_month
    #prev_month
    #next_year
    #prev_year
    #step
    #upto
    #downto

https://github.com/ruby/date/commit/4246441a35
2022-07-12 22:57:25 +09:00
Burdette Lamar 702d4d773f [ruby/date] [DOC] Enhanced RDoc (https://github.com/ruby/date/pull/62)
Minor edits to 11 methods' documentation.

https://github.com/ruby/date/commit/00bb7f6648
2022-07-12 00:02:41 +09:00
Burdette Lamar 5137af633e [ruby/date] Enhanced RDoc (https://github.com/ruby/date/pull/61)
Omit private aliases from Rdoc.

https://github.com/ruby/date/commit/48f9180663
2022-07-10 23:51:41 +09:00
Burdette Lamar e9ec6893d2 [ruby/date] [DOC] Enhanced RDoc (https://github.com/ruby/date/pull/59)
Minor changes (mostly doc-guide compliance) to 18 or so of simpler methods (getters).

https://github.com/ruby/date/commit/00e37ba2b4
2022-07-09 01:06:08 +09:00
Peter Zhu 86768f1d4c [ruby/openssl] Fix formatting in docs
The + tag can only be used for single words. For multiple words the <tt>
tag has to be used.

https://github.com/ruby/openssl/commit/cf2f019c3e
2022-07-08 23:18:24 +09:00
Jarek Prokop 4d6a29320d [ruby/openssl] Let OpenSSL choose the digest if digest for Openssl::OCSP::BasicResponse#sign is nil.
https://github.com/ruby/openssl/commit/27efcd7e1c
2022-07-08 23:18:22 +09:00
Jarek Prokop 7a5a90e053 [ruby/openssl] Let OpenSSL choose the digest if digest for Openssl::OCSP::Request#sign is nil.
https://github.com/ruby/openssl/commit/a1f6cbc261
2022-07-08 23:18:20 +09:00
Jeremy Evans b5efef3794 [ruby/openssl] Fix operator precedence in OSSL_OPENSSL_PREREQ and OSSL_LIBRESSL_PREREQ
https://github.com/ruby/openssl/commit/b02815271f
2022-07-08 23:18:16 +09:00
Jeremy Evans aee36dd788 [ruby/openssl] Fix build with LibreSSL 3.5
https://github.com/ruby/openssl/commit/e25fb0d0d8
2022-07-08 23:18:14 +09:00
twkmd12 09daf78fb5 [ruby/openssl] Add 'ciphersuites=' method to allow setting of TLSv1.3 cipher suites along with some unit tests (https://github.com/ruby/openssl/pull/493)
Add OpenSSL::SSL::SSLContext#ciphersuites= method along with unit tests.

https://github.com/ruby/openssl/commit/12250c7cef
2022-07-08 23:18:11 +09:00
Stefan Kaes 0bf2dfa6ac [ruby/openssl] ignore pkgconfig when any openssl option is specified
https://github.com/ruby/openssl/commit/b23fa75aa3
2022-07-08 23:18:09 +09:00
Nobuyoshi Nakada cf991337fb
Make a local symbol static 2022-07-08 10:55:44 +09:00
Burdette Lamar 621e5c568a [ruby/date] Enhanced RDoc (https://github.com/ruby/date/pull/58)
Brings a dozen call-seq schemas into compliance with the doc guide.
    Adds links to section "Argument start" where needed.
    Revises (minorly) ::today.
    Otherwise, does not disturb existing text.

https://github.com/ruby/date/commit/9aec11df50
2022-07-08 03:48:09 +09:00
Peter Zhu c8b3bd45cc Fix extconf.rb for OpenSSL 3 without $warnflags
On Windows with OpenSSL 3, the gem fails to compile with the following
error message:

  ruby/src/ext/openssl/extconf.rb:188: undefined method \`sub!' for nil:NilClass

This is because $warnflags is nil.
2022-07-07 13:14:41 -04:00
Jean Boussier 587d2d199b thread_pthread.c: call SUSPENDED event when entering native_sleep
[Bug #18900]

Thread#join and a few other codepaths are using native sleep as
a way to suspend the current thread. So we should call the relevant
hook when this happen, otherwise some thread may transition
directly from `RESUMED` to `READY`.
2022-07-07 17:49:00 +02:00
Burdette Lamar dbb23f29cb [ruby/date] [DOC] Enhanced RDoc (https://github.com/ruby/date/pull/57)
All things commercial.

https://github.com/ruby/date/commit/9d3bc61728
2022-07-07 03:58:02 +09:00
Nobuyoshi Nakada a070d4cceb
Local functions should be `static` 2022-07-05 09:30:05 +09:00
Burdette Lamar f64bb67d75 [ruby/date] Update ext/date/date_core.c
https://github.com/ruby/date/commit/8eb1c780fb

Co-authored-by: Peter Zhu <peter@peterzhu.ca>
2022-07-05 04:12:50 +09:00
BurdetteLamar 5fe86666a5 [ruby/date] Enhanced RDoc
https://github.com/ruby/date/commit/e36690f70e
2022-07-05 04:12:49 +09:00
BurdetteLamar e323d8e6a2 [ruby/date] Enhanced RDoc
https://github.com/ruby/date/commit/dcc0742623
2022-07-05 04:12:48 +09:00
BurdetteLamar 6317cf7de8 [ruby/date] Enhanced RDoc
https://github.com/ruby/date/commit/91c632f156
2022-07-05 04:12:48 +09:00
BurdetteLamar 7212163e7c [ruby/date] Enhanced RDoc
https://github.com/ruby/date/commit/5c18ec031e
2022-07-05 04:12:47 +09:00
BurdetteLamar 4ec14b6323 [ruby/date] Enhanced RDoc
https://github.com/ruby/date/commit/fd3ae275c3
2022-07-05 04:12:46 +09:00
BurdetteLamar 24c80aea0e [ruby/date] Enhanced RDoc
https://github.com/ruby/date/commit/ac25182c66
2022-07-05 04:12:45 +09:00
BurdetteLamar c90110d146 [ruby/date] Enhanced RDoc
https://github.com/ruby/date/commit/f9ecaad2ee
2022-07-05 04:12:44 +09:00
BurdetteLamar 6324aaf3d0 [ruby/date] Enhanced RDoc
https://github.com/ruby/date/commit/e80fee4f30
2022-07-05 04:12:43 +09:00
Jean Boussier 890df5f812 ObjectSpace.dump: Include string coderange
I suspect that some shared pages are invalidated because
some static string don't have their coderange set eagerly.

So the first time they are scanned, the entire memory page is
invalidated.

Being able to see the coderange in `ObjectSpace` would help debug
this.

And in addition `dump` currently call `is_broken_string()`  and `is_ascii_string()`
which both end up scanning the string and assigning coderange. I think it's
undesirable as `dump` should be read only.
2022-07-04 20:04:59 +02:00
BurdetteLamar 06f4ca503d [ruby/bigdecimal] Correct indentation in Kernel#BigDecimal
https://github.com/ruby/bigdecimal/commit/3ede8860a6
2022-07-02 07:58:20 +09:00
Nobuyoshi Nakada 302f353fd9 [ruby/stringio] Fix the result of `StringIO#truncate` so compatible with `File`
https://github.com/ruby/stringio/commit/16847fea32
2022-07-01 00:52:29 +09:00
Nobuyoshi Nakada 50e13870bf [ruby/io-wait] Bump up
https://github.com/ruby/io-wait/commit/0fa6e3f7ba
2022-06-25 18:10:46 +09:00
Nobuyoshi Nakada 8c1d3c2dce [ruby/io-wait] Remove C99-ism for some platforms [ci skip]
Fix https://github.com/ruby/io-wait/pull/11

https://github.com/ruby/io-wait/commit/845f9a1f55
2022-06-25 18:09:11 +09:00
Samuel Williams f9c8d80883 [ruby/io-wait] Don't add `IO#wait*` methods when `RUBY_IO_WAIT_METHODS` is defined by Ruby. (https://github.com/ruby/io-wait/pull/19)
* Fix return value compatibility with Ruby 2.x.

* Don't add `IO#wait*` methods in Ruby 3.2+.

https://github.com/ruby/io-wait/commit/54c504d089
2022-06-25 16:21:54 +09:00
Nobuyoshi Nakada a0b24f5926 [ruby/io-wait] Remove redundant forward declarations
These were needed before prototype declarations were used.

https://github.com/ruby/io-wait/commit/35f016833a
2022-06-21 12:13:47 +09:00
Nobuyoshi Nakada 4aebbf44e9
Remove unnecessary `*` before the function name 2022-06-19 23:32:47 +09:00
Nobuyoshi Nakada 5f8c73405e [ruby/etc] [DOC] Markup constant path names
https://github.com/ruby/etc/commit/6c9a0b4e5d
2022-06-19 11:06:43 +09:00
Nobuyoshi Nakada ea38758322 [ruby/etc] [DOC] Markup string literals
https://github.com/ruby/etc/commit/a8801e07d1
2022-06-19 10:46:50 +09:00
Nobuyoshi Nakada cc67a11768 [ruby/etc] [DOC] Fix reference to different module
https://github.com/ruby/etc/commit/ea51739974
2022-06-19 10:46:48 +09:00
Nobuyoshi Nakada c594370c6e [ruby/etc] [DOC] Update
System-dependent feature macros are automatically detected by
extconf.rb, and are not used by users.

https://github.com/ruby/etc/commit/e7343b4e69
2022-06-19 10:46:47 +09:00
Jean Boussier b6c1e1158d GVL Instrumentation API: add STARTED and EXITED events
[Feature #18339]

After experimenting with the initial version of the API I figured there is a need
for an exit event to cleanup instrumentation data. e.g. if you record data in a
{thread_id -> data} table, you need to free associated data when a thread goes away.
2022-06-17 09:08:26 +02:00
John Hawthorn 17d260a87f Restore rb_exec_recursive_outer
This was a public method, so we should probably keep it.
2022-06-15 16:07:29 -07:00
Alan Wu 9357e310fb [ruby/psych] Fix libyaml download failure rescue under miniruby
I tried to build Ruby on a system without libyaml today and realized
that my attempt from <https://github.com/ruby/psych/pull/557> doesn't
fix the error in <https://github.com/ruby/psych/issues/552>. I still got
the same `LoadError` from `digest` which stopped the build.

Since `LoadError` is not a `StandardError`, a plain `rescue` doesn't catch
it. Catch `LoadError` explicitly instead and reduce the scope of the
`begin` block.

I tested this change in a Ruby build on macOS without libyaml installed
and confirmed that `make` continues with a warning instead of aborting:

    *** Following extensions are not compiled:
    psych:
            Could not be configured. It will not be installed.
            ...

This should address <https://bugs.ruby-lang.org/issues/18790>.

https://github.com/ruby/psych/commit/251289ba83
2022-06-15 01:05:51 +09:00
John Hawthorn 52da90acee Make method id explicit in rb_exec_recursive_outer
Previously, because opt_aref and opt_aset don't push a frame, when they
would call rb_hash to determine the hash value of the key, the initial
level of recursion would incorrectly use the method id at the top of the
stack instead of "hash".

This commit replaces rb_exec_recursive_outer with
rb_exec_recursive_outer_mid, which takes an explicit method id, so that
we can make the hash calculation behave consistently.

rb_exec_recursive_outer was documented as being internal, so I believe
this should be okay to change.
2022-06-10 14:48:21 -07:00
Jean Boussier 9125374726 [Feature #18339] GVL Instrumentation API
Ref: https://bugs.ruby-lang.org/issues/18339

Design:

- This tries to minimize the overhead when no hook is registered.
  It should only incur an extra unsynchronized boolean check.
- The hook list is protected with a read-write lock as to cause
  contention when some hooks are registered.
- The hooks MUST be thread safe, and MUST NOT call into Ruby as they
  are executed outside the GVL.
- It's simply a noop on Windows.

API:

```
rb_internal_thread_event_hook_t * rb_internal_thread_add_event_hook(rb_internal_thread_event_callback callback, rb_event_flag_t internal_event, void *user_data);
bool rb_internal_thread_remove_event_hook(rb_internal_thread_event_hook_t * hook);
```

You can subscribe to 3 events:

  - READY: called right before attempting to acquire the GVL
  - RESUMED: called right after successfully acquiring the GVL
  - SUSPENDED: called right after releasing the GVL.

The hooks MUST be threadsafe, as they are executed outside of the GVL, they also MUST NOT call any Ruby API.
2022-06-03 15:13:33 +02:00
Nobuyoshi Nakada d142eff658 [ruby/nkf] Constified invariant tables
https://github.com/ruby/nkf/commit/b386ddc11c
2022-06-03 20:25:12 +09:00
Nobuyoshi Nakada 7976142791 [ruby/stringio] Fix extracting encoding names in the fallback code
https://github.com/ruby/stringio/commit/0fe2e0c1e5
2022-05-30 14:48:45 +09:00
Nobuyoshi Nakada d3e986d9ab [ruby/stringio] Accept external and internal encodings pair
Fix https://github.com/ruby/stringio/pull/16

https://github.com/ruby/stringio/commit/c8a69e80d2
2022-05-30 14:48:44 +09:00
Jeremy Evans 609d73e892 [ruby/stringio] Fix handling of chomp with paragraph separator
Try to mirror IO behavior, where chomp takes out the entire paragraph
separators between entries, but does not chomp a single line separator
at the end of the string.

Partially Fixes [Bug #18768]

https://github.com/ruby/stringio/commit/a83ddbb7f0
2022-05-30 13:10:46 +09:00
Jeremy Evans 7e3920f0d9 [ruby/stringio] Update ext/stringio/stringio.c
https://github.com/ruby/stringio/commit/1edc88587e

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2022-05-30 13:01:18 +09:00
Jeremy Evans adaaf12857 [ruby/stringio] Ignore chomp keyword for nil separator
nil separator means no separator at all, so nothing should be
chomped.

Partial fix for Ruby [Bug #18770]

https://github.com/ruby/stringio/commit/feaa2ec631
2022-05-30 13:01:17 +09:00
Jeremy Evans 1f82269f4e [ruby/stringio] Fix each with multiple character string and chomp
Previously, this could result in an infinite loop.  Always update
the e pointer in this case, setting w when chomping so the chomped
data is not included in the output.

Fixes [Bug #18769]

https://github.com/ruby/stringio/commit/4bf64d5130
2022-05-30 12:55:47 +09:00
Nobuyoshi Nakada bb6357cddd [ruby/stringio] Fix expanding size at ungetc/ungetbyte
https://github.com/ruby/stringio/commit/a35268a3ac
2022-05-30 12:51:37 +09:00
Nobuyoshi Nakada 78785fb990 [ruby/date] Constify gperf-generated table
https://github.com/ruby/date/commit/6d7ab08ffc
2022-05-24 17:23:42 +09:00
Hiroshi SHIBATA bcc9451bbf
Merge JRuby implementation for stringio and io-wait 2022-05-20 18:45:14 +09:00
Hiroshi SHIBATA c83ec3aba7
Merge https://github.com/ruby/pathname/pull/8 for pathname 2022-05-20 18:36:01 +09:00
Nobuyoshi Nakada 104fb83ccd
[ruby/io-nonblock] Remove unnecessary files from the gem
https://github.com/ruby/io-nonblock/commit/3850a4c7ac
2022-05-20 17:49:14 +09:00
Nobuyoshi Nakada 0dfd5d19f3
[ruby/io-nonblock] Rename `io_nonblock_mode` and extract `set_fcntl_flags`
https://github.com/ruby/io-nonblock/commit/22f08574df
2022-05-20 17:49:14 +09:00
Florian Frank 9245b28d34
[flori/json] Bump version to 2.6.2
https://github.com/flori/json/commit/5de358f655
2022-05-20 17:49:13 +09:00
Andrew Bromwich a15d0e267a
[flori/json] Fix parser bug for empty string allocation
When `HAVE_RB_ENC_INTERNED_STR` is enabled it is possible to
pass through a null pointer to `rb_enc_interned_str` resulting
in a segfault

Fixes #495

https://github.com/flori/json/commit/b59368a8c2
2022-05-20 17:49:13 +09:00
Hiroshi SHIBATA 767f3904ee
[flori/json] Doc: Improve documentation on JSON#parse and JSON#parse!
https://github.com/flori/json/commit/75ada77b96

Co-authored-by: Bruno Gomes da Silva <brunojabs@gmail.com>
2022-05-20 17:49:13 +09:00
Hiroshi SHIBATA 6b6d7df39d
[ruby/psych] Prepare to develop 5.0.0
https://github.com/ruby/psych/commit/c3b5183f42
2022-05-18 10:03:48 +09:00
MSP-Greg 3ec066334c
[ruby/psych] [CI] Add/update 'rake install', update Psych version for Ruby 3.1 gem install
https://github.com/ruby/psych/commit/2fa5e190b5
2022-05-18 10:03:47 +09:00
MSP-Greg 40be4d4263 [ruby/psych] tr is typically 4 to 5 times faster than gsub
https://github.com/ruby/psych/commit/8533be8fe7
2022-05-10 03:20:34 +09:00
Hiroshi SHIBATA a370eb5a63 [ruby/io-wait] bump up to 0.2.3
https://github.com/ruby/io-wait/commit/f59d1d12e0
2022-05-09 18:19:06 +09:00
Sutou Kouhei 30632efeaa [ruby/stringio] bump up to 3.0.3
https://github.com/ruby/stringio/commit/64f225bf00
2022-05-09 16:47:28 +09:00
Sutou Kouhei fbbe7ac7e3 [ruby/stringio] Bump version
https://github.com/ruby/stringio/commit/b79152d08f
2022-05-09 16:36:01 +09:00
Alan Wu f90549cd38 Rust YJIT
In December 2021, we opened an [issue] to solicit feedback regarding the
porting of the YJIT codebase from C99 to Rust. There were some
reservations, but this project was given the go ahead by Ruby core
developers and Matz. Since then, we have successfully completed the port
of YJIT to Rust.

The new Rust version of YJIT has reached parity with the C version, in
that it passes all the CRuby tests, is able to run all of the YJIT
benchmarks, and performs similarly to the C version (because it works
the same way and largely generates the same machine code). We've even
incorporated some design improvements, such as a more fine-grained
constant invalidation mechanism which we expect will make a big
difference in Ruby on Rails applications.

Because we want to be careful, YJIT is guarded behind a configure
option:

```shell
./configure --enable-yjit # Build YJIT in release mode
./configure --enable-yjit=dev # Build YJIT in dev/debug mode
```

By default, YJIT does not get compiled and cargo/rustc is not required.
If YJIT is built in dev mode, then `cargo` is used to fetch development
dependencies, but when building in release, `cargo` is not required,
only `rustc`. At the moment YJIT requires Rust 1.60.0 or newer.

The YJIT command-line options remain mostly unchanged, and more details
about the build process are documented in `doc/yjit/yjit.md`.

The CI tests have been updated and do not take any more resources than
before.

The development history of the Rust port is available at the following
commit for interested parties:
1fd9573d8b

Our hope is that Rust YJIT will be compiled and included as a part of
system packages and compiled binaries of the Ruby 3.2 release. We do not
anticipate any major problems as Rust is well supported on every
platform which YJIT supports, but to make sure that this process works
smoothly, we would like to reach out to those who take care of building
systems packages before the 3.2 release is shipped and resolve any
issues that may come up.

[issue]: https://bugs.ruby-lang.org/issues/18481

Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
Co-authored-by: Noah Gibbs <the.codefolio.guy@gmail.com>
Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2022-04-27 11:00:22 -04:00
Kazuhiro NISHIYAMA f4093c5c3b
io.nonblock returns the block's value [ci skip] 2022-04-26 00:17:32 +09:00
Tanaka Akira 671d90eca3 add description for IO.nonblock=. 2022-04-24 23:16:55 +09:00
Akinori MUSHA cb02324c4e [ruby/pathname] Implement Pathname#lutime
https://github.com/ruby/pathname/commit/268cb5acff
2022-04-21 17:10:19 +09:00
Peter Zhu c69bdcf80c [ruby/bigdecimal] Fix docs
rdoc parses f[i] as a link, which results in a broken link.

https://github.com/ruby/bigdecimal/commit/a18522e9ca
2022-04-18 10:29:25 +09:00
Nobuyoshi Nakada 92361ad9c6 [ruby/bigdecimal] Adjust a local variable type to exponent
https://github.com/ruby/bigdecimal/commit/70146fb6ad
2022-04-18 10:29:23 +09:00
Nobuyoshi Nakada be52c72889
Get rid of doubly caching 2022-04-17 18:57:26 +09:00
Nobuyoshi Nakada 2c6876f811
Get rid of magic numbers 2022-04-17 18:53:29 +09:00
Sutou Kouhei 2aca566a10 [ruby/stringio] bump up to 3.0.2.pre1
https://github.com/ruby/stringio/commit/14ec9bc193
2022-04-16 06:34:31 +09:00
Peter Zhu a0eb4b14d6 [ruby/nkf] Fix docs
rdoc parses "Z[0-3]" as a link to "0-3", this commit escapes these so
that they don't become links.

https://github.com/ruby/nkf/commit/269c10061b
2022-04-15 16:07:11 +09:00
Stan Lo 629bad4aba Update PTY.spawn's document
Passing the optional env hash to PTY.spawn has been supported for years, but it's never documented.
More info: https://bugs.ruby-lang.org/issues/12312
2022-04-13 15:43:28 -04:00
Nobuyoshi Nakada 697eed63e8 [ruby/psych] Update autoconf files bundled with yaml-2.5
https://github.com/ruby/psych/commit/e28f17ac18
2022-04-07 22:38:39 +09:00
Nobuyoshi Nakada d7afaf21f2 Move the target directory of bundled gems like as rubygems 2022-04-07 09:47:10 +09:00
Nobuyoshi Nakada db3d111c1d Bundled gems are expanded under `.bundle/gems` now 2022-04-07 09:47:10 +09:00
Hiroshi SHIBATA 5e7ebc7e6e
Ignore yaml source 2022-04-05 14:31:54 +09:00
Hiroshi SHIBATA 839577d833
Removed mswin patch for zlib-1.2.11 2022-04-05 14:30:47 +09:00
Alan Wu 18044f4fbb [ruby/psych] Improve libyaml source downloading error messages
People trying to build CRuby by following the instructions in its
[README] have been running into [errors] due to missing `libyaml`
on their system. Let's try to present a better error message when
it happens.

[README]: fb5aa31e2d (how-to-compile-and-install)
[errors]: https://github.com/ruby/psych/issues/552

https://github.com/ruby/psych/commit/20a633028e
2022-04-05 08:56:21 +09:00
Nobuyoshi Nakada 57377e5d53 [ruby/psych] Propagate `CC` to libyaml
It is needed for cross-compiling to set properly.  Just
`--target`/`--host`/`--build` seems insufficient on some
platforms.

https://github.com/ruby/psych/commit/2d00c0c203
2022-04-04 16:06:16 +09:00
Nobuyoshi Nakada 07acd6006c [ruby/zlib] Use `z_size_t` version functions
https://github.com/ruby/zlib/commit/1ce6625fff
2022-04-02 19:34:05 +09:00
Nobuyoshi Nakada 4ee71097a0 [ruby/zlib] Mask checksums to lower 32bits on also IL32 platforms
https://github.com/ruby/zlib/commit/e1ead85113
2022-04-02 19:23:59 +09:00
Nobuyoshi Nakada 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
2022-04-02 17:01:33 +09:00
Nobuyoshi Nakada e680e63e7e [ruby/psych] Output libyaml configure log
https://github.com/ruby/psych/commit/c2e3c8579c
2022-04-01 11:48:50 +09:00
Nobuyoshi Nakada af2ab0dd1c [ruby/psych] Make a static library from PIC object files
On some platforms, PIC and non-PIC code are incompatible and the
latter cannot be used for shared objects.

https://github.com/ruby/psych/commit/5652e32733
2022-03-31 21:34:48 +09:00
Nobuyoshi Nakada 217cea7812 [ruby/psych] Remove `unknown` vendor for cross-compiling tool prefix
https://github.com/ruby/psych/commit/a4ffa06646
2022-03-31 12:18:28 +09:00
Nobuyoshi Nakada 75efbb98af [ruby/psych] Propagate the host configuration to libyaml
https://github.com/ruby/psych/commit/0e37e19707
2022-03-30 23:08:13 +09:00
Nobuyoshi Nakada 71aa43c725 [ruby/psych] Configure libyaml from the original source
https://github.com/ruby/psych/commit/54a9ba9d10
2022-03-30 11:31:04 +09:00
Nobuyoshi Nakada c67088dbae [ruby/psych] Try bundled libyaml source if pre-installed is unavailable
https://github.com/ruby/psych/commit/f78e1dba89
2022-03-29 20:57:58 +09:00
Hiroshi SHIBATA 8e2a2ba0f9 Merge psych master
c386ecb0c2
2022-03-29 19:07:12 +09:00
Yusuke Endoh ca85f16a7d ext/psych/extconf.rb: Fail when libyaml is unavailable
WHen libyaml is not installed, make fails with the following cryptic
message:

```
gmake[2]: Entering directory '/home/chkbuild/chkbuild-crossruby/tmp/build/20220325T045825Z/ruby/ext/psych'
gmake[2]: *** No rule to make target 'yaml/yaml.h', needed by 'psych.o'.  Stop.
gmake[2]: Leaving directory '/home/chkbuild/chkbuild-crossruby/tmp/build/20220325T045825Z/ruby/ext/psych'
```

I think it should give up building psych with a clear message.
2022-03-27 19:34:07 +09:00
Hiroshi SHIBATA 4acc757d04 [ruby/psych] Added condition for macOS homebrew
https://github.com/ruby/psych/commit/a876de5a82

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
2022-03-26 07:49:52 +09:00
Hiroshi SHIBATA 7ee26740e4 [ruby/readline-ext] Removed the duplicated dependencies
https://github.com/ruby/readline-ext/commit/324d324427
2022-03-25 20:27:58 +09:00
Hiroshi SHIBATA 0292a34c9c Removed libyaml object files from depends 2022-03-25 09:53:07 +09:00
Hiroshi SHIBATA bfdceab313 Try to remove yaml sources from depend 2022-03-25 09:53:07 +09:00
Hiroshi SHIBATA 8e3fbf9432 Merge psych master: Removed the bundled libyaml 2022-03-25 09:53:07 +09:00
Kazuhiro NISHIYAMA d06f787e9f
Fix broken links of rdoc
- `www.ruby-lang.org` links to `./www.ruby-lang.org`
- `cgi['field_name']` links to `./'field_name'`
2022-03-17 10:11:38 +09:00
Nobuyoshi Nakada 6d8f396f37 Suppress warnings by OpenSSL 3 2022-03-16 20:49:00 +09:00
xtkoba 63b1633f86 [ruby/win32ole] Get rid of potential undefined behavior
See https://bugs.llvm.org/show_bug.cgi?id=50236

https://github.com/ruby/win32ole/commit/019ec2b3cb
2022-03-15 08:33:40 +09:00
Nobuyoshi Nakada aa347cbe65 [ruby/win32ole] Rename toplevel WIN32OLE_* classes
https://github.com/ruby/win32ole/commit/bc7deb6a6a
2022-03-15 08:20:47 +09:00
Charles Oliver Nutter bd18623307 [ruby/io-wait] Update version to 0.2.2.pre1 for testing
https://github.com/ruby/io-wait/commit/12e26f574e
2022-03-10 22:58:31 +09:00
Peter Zhu fb724a887a Show embed status of array when len is 0 in objspace dump 2022-03-01 10:55:53 -05:00
Nobuyoshi Nakada 0db5ee5195 [ruby/date] Suppress declaration-after-statement warnings
https://github.com/ruby/date/commit/60bd16009d
2022-02-25 20:01:06 +09:00
Nobuyoshi Nakada bb22bc76b0 [ruby/date] Deprecate the unintentional ability to parse `Symbol`
https://github.com/ruby/date/commit/d57818f3b3
2022-02-25 19:57:50 +09:00
Nobuyoshi Nakada b5c2a0840f [ruby/date] Anchor at beginning of numbers
https://hackerone.com/reports/1254844

https://github.com/ruby/date/commit/2f7814cc22
2022-02-25 19:52:31 +09:00
Nobuyoshi Nakada 1758eade57 [ruby/date] Anchor at beginning of numbers
https://hackerone.com/reports/1254844

https://github.com/ruby/date/commit/7ffe25e458
2022-02-25 19:52:31 +09:00
Nobuyoshi Nakada d54a3df2e5 [ruby/date] Separate era from preceding word
https://github.com/ruby/date/commit/017149e53e
2022-02-25 19:52:30 +09:00
Nobuyoshi Nakada c8cddac45c [ruby/date] Use possessive match
Reduce backtracks at the same character classes arounding an
optional pattern.

https://github.com/ruby/date/commit/1fd15f7c49
2022-02-25 19:52:29 +09:00
Nobuyoshi Nakada 9f59a2bd87 [ruby/date] Extracted common leading pattern
https://github.com/ruby/date/commit/ec86dbbdc1
2022-02-25 19:52:28 +09:00
John Hawthorn 764e4fa850 Never call kind_of with klass=0 2022-02-23 19:57:42 -08:00
Peter Zhu 68847794bf Update ext/-test-/dln/empty/depend
Dependencies was not updated in
06dab12717.
2022-02-22 16:49:20 -05:00
Peter Zhu 06dab12717 Include ruby.h in empty.c to have ABI version
I forgot to include this as part of
638fd8774b.
2022-02-22 12:00:15 -05:00
Peter Zhu 2d5ecd60a5 [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
Peter Zhu 638fd8774b [Feature #18249] Include ruby.h in extensions to have ABI version
All shared libraries must have `include/ruby/internal/abi.h` to include
the ABI version. Including `ruby.h` will guarantee that.
2022-02-22 09:55:21 -05:00
Peter Zhu 3df16924b4 [Feature #18249] Implement ABI checking
Header file include/ruby/internal/abi.h contains RUBY_ABI_VERSION which
is the ABI version. This value should be bumped whenever an ABI
incompatible change is introduced.

When loading dynamic libraries, Ruby will compare its own
`ruby_abi_version` and the `ruby_abi_version` of the loaded library. If
these two values don't match it will raise a `LoadError`. This feature
can also be turned off by setting the environment variable
`RUBY_RUBY_ABI_CHECK=0`.

This feature will prevent cases where previously installed native gems
fail in unexpected ways due to incompatibility of changes in header
files. This will force the developer to recompile their gems to use the
same header files as the built Ruby.

In Ruby, the ABI version is exposed through
`RbConfig::CONFIG["ruby_abi_version"]`.
2022-02-22 09:55:21 -05:00
Mau Magnaguagno 50098f4b61 [ruby/zlib] [DOC] Fix typo in Zlib.adler32_combine
https://github.com/ruby/zlib/commit/5e8f0b4164
2022-02-22 18:01:53 +09:00
John Hawthorn 05b1944c53 objspace: Hide identhash containing internal objs
Inside ObjectSpace.reachable_objects_from we keep an internal identhash
in order to de-duplicate reachable objects when wrapping them as
InternalObject. Previously this hash was not hidden, making it possible
to leak references to those internal objects to Ruby if using
ObjectSpace.each_object.

This commit solves this by hiding the hash. To simplify collection of
values, we instead now just use the hash as a set of visited objects,
and collect an Array (not hidden) of values to be returned.
2022-02-09 17:32:43 -08:00
Matt Valentine-House 9fab2c1a1a Add the size pool slot size to the output of ObjectSpace.dump/dump_all 2022-02-03 15:07:35 -05:00
Nobuyoshi Nakada f6894711a4 [ruby/io-wait] Exclude rake files from packages
https://github.com/ruby/io-wait/commit/7be58cd7f4
2022-02-01 20:04:15 +09:00
Jean Boussier ddb9d60f7d
[ruby/io-wait] Make the gem a noop on Rubies older than 2.6
Ref: https://github.com/mikel/mail/pull/1439

Some gems depend on io-wait, but still support older rubies,
so they have to chose between droping support or not listing io-wait.

But io-wait could act a a noop on older rubies.

https://github.com/ruby/io-wait/commit/75fcb74c32
2022-02-01 14:11:16 +09:00
Nobuyoshi Nakada fc4fbeef28 [ruby/io-wait] bump up to 0.2.2
https://github.com/ruby/io-wait/commit/e15a2486b2
2022-02-01 13:22:03 +09:00
Koichi Sasada cc8064ba2e Do not need to print to stderr 2022-01-26 10:05:10 +09:00
David Rodríguez de678cd51e
[ruby/pathname] Officially drop support for ruby 2.6 or older
The gem doesn't even install on old rubies, but since the gemspec claims
it's supported, `gem install pathname` will try to install it and print
an error.

This commit doesn't fix the above issue. The only way to fix it would be
to restore support and release a new version that actually supports old
rubies. However, such a change has been proposed and ignored for a long
time.

So this issue proposes to leave that broken but at least bring the
gemspec manifest and the CI matrix in sync to hopefully avoid this issue
from happening again in the future.

https://github.com/ruby/pathname/commit/3ee010b538
2022-01-25 08:50:31 +09:00
Nobuyoshi Nakada 85502f3a51 [ruby/io-wait] [DOC] Fix the return values [ci skip]
Even since 0.1.0, other than +true+ or +false+ may be returned.

https://github.com/ruby/io-wait/commit/d0721e300a
2022-01-24 18:03:48 +09:00
apatniv e7b573e576 [ruby/io-wait] Document mandatory require for using io/wait methods
https://github.com/ruby/io-wait/commit/2beb05bd48
2022-01-24 12:12:15 +09:00
Kenta Murata 328e6bf3b3
[ruby/bigdecimal] Version 3.1.2
https://github.com/ruby/bigdecimal/commit/57e2194135
2022-01-24 10:56:37 +09:00
Kenta Murata 7db195d521
[ruby/bigdecimal] Fix the maximum precision of the quotient
Fixes https://github.com/ruby/bigdecimal/pull/220

https://github.com/ruby/bigdecimal/commit/127a1b5a31
2022-01-24 10:56:30 +09:00
Seth Boyles c1a6ff046d [ruby/psych] Add strict_integer option to parse numbers with commas as strings
Authored-by: Seth Boyles <sethboyles@gmail.com>

https://github.com/ruby/psych/commit/75bebb37b8
2022-01-22 10:00:51 +09:00
Nobuyoshi Nakada 542bd9b408 [ruby/etc] Exclude change logs for pre 1.0
https://github.com/ruby/etc/commit/c8a133fe95
2022-01-21 12:22:04 +09:00
Nobuyoshi Nakada 563d0fdada [ruby/etc] Derive extra_rdoc_files from files
https://github.com/ruby/etc/commit/e8ecce3442
2022-01-21 12:21:59 +09:00
Nobuyoshi Nakada 3fea4f9d8c [ruby/etc] Move development dependencies to Gemfile
https://github.com/ruby/etc/commit/5cabc3996a
2022-01-21 12:21:54 +09:00
Michael Nikitochkin ef2cf9245c [ruby/psych] Remove alias of load to unsafe_load
https://github.com/ruby/psych/commit/39e23cc86f
2022-01-20 10:39:05 +09:00
Peter Zhu ffda21b7ba [Feature #18491] Drop support for HP-UX
IA64 support was dropped in ticket #15894, so we can drop support for
HP-UX.
2022-01-18 09:52:15 -05:00
David CARLIER 670f3e6cd7
[ruby/fcntl] adding few FreeBSD specific flags.
https://github.com/ruby/fcntl/commit/03d9a7937d
2022-01-15 18:56:15 +09:00
David Rodríguez 40d9be51e8 [ruby/psych] Don't require `strscan` unnecessarily
It does not seem needed, and it's causing issues on Windows when
uninstalling `strscan`, because strscan's shared library being used when
RubyGems tries to remove it (because its loaded through Psych, which
RubyGems uses for loading configuration).

https://github.com/ruby/psych/commit/3911356ec1
2022-01-14 07:44:14 +09:00
Jeremy Evans dd6a75195a [ruby/pathname] Make Pathname#each_entry return enumerator if called without block
Fixes [Bug #18158]

https://github.com/ruby/pathname/commit/914c726aa2
2022-01-07 09:42:09 +09:00
Nobuyoshi Nakada 1136985cc0 [ruby/etc] Note for rb_deprecate_constant [ci skip]
https://github.com/ruby/etc/commit/f87fe7ad93
2022-01-02 15:16:43 +09:00
Nobuyoshi Nakada 462079611a [ruby/etc] Remove deprecate constants under Struct
https://github.com/ruby/etc/commit/143edbd215
2022-01-02 15:03:29 +09:00
Nobuyoshi Nakada eb294491c0 [ruby/etc] bump up to 1.4.0
https://github.com/ruby/etc/commit/ca41f182f6
2022-01-02 15:03:05 +09:00
Nobuyoshi Nakada 91d09ca95b [ruby/etc] bump up to 1.3.1
https://github.com/ruby/etc/commit/82dd69a4cf
2022-01-02 14:52:31 +09:00
Nobuyoshi Nakada bb0a725f1f [ruby/etc] [DOC] Refine Etc::Passwd#passwd description
https://github.com/ruby/etc/commit/17b99fe42e
2022-01-02 14:52:28 +09:00
Nobuyoshi Nakada 314effdf77 [ruby/etc] [DOC] Document Etc::Passwd and Etc::Group as classes
https://github.com/ruby/etc/commit/106429f10b
2022-01-02 14:52:27 +09:00
Nobuyoshi Nakada 9135a3e864 [ruby/etc] [DOC] Add document task
https://github.com/ruby/etc/commit/8c8c6198e2
2022-01-02 14:52:25 +09:00
Nobuyoshi Nakada 546dbcfe69
[ruby/etc] Update ruby versions
https://github.com/ruby/etc/commit/959416b18a
2022-01-02 13:29:01 +09:00
Nobuyoshi Nakada db547a3bc4
[ruby/win32ole] Undefine allocator of WIN32OLE_VARIABLE to get rid of warning
https://github.com/ruby/win32ole/commit/27d0fdc622
2021-12-30 21:13:11 +09:00
Nobuyoshi Nakada d75f7078c8
[ruby/io-console] bump up to 0.5.11
https://github.com/ruby/io-console/commit/ad3805200c
2021-12-29 09:37:59 +09:00
Samuel Williams f27eb8148f
Sync io-console gem. 2021-12-29 13:27:40 +13:00
NARUSE, Yui 82c8acbcfd Prevent installing zlib library 2021-12-25 21:01:43 +09:00
Nobuyoshi Nakada 8247b193c0
[ruby/io-console] bump up to 0.5.10
https://github.com/ruby/io-console/commit/806c65e22b
2021-12-25 18:38:51 +09:00
Nobuyoshi Nakada 9368fa6c30
[ruby/io-console] No longer support dead versions
https://github.com/ruby/io-console/commit/e9478509e9
2021-12-25 18:38:51 +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 Lamar 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
Kenta Murata ea713009ba
[ruby/bigdecimal] [Doc] Add documentation of BigDecimal#n_significant_digits
https://github.com/ruby/bigdecimal/commit/ceaf16b03e
2021-12-24 02:28:59 +09:00
Kenta Murata aca96f7ec7
[ruby/bigdecimal] Add BigDecimal#scale
Fixes GH-198.

https://github.com/ruby/bigdecimal/commit/4fbec55680
2021-12-24 02:28:58 +09:00
BurdetteLamar 0c63aa11bc
[ruby/bigdecimal] Set rounding mode in example
https://github.com/ruby/bigdecimal/commit/8fc83dd2fe
2021-12-24 02:28:58 +09:00
BurdetteLamar a8243d07e1
[ruby/bigdecimal] Set rounding mode in example
https://github.com/ruby/bigdecimal/commit/42c999f728
2021-12-24 02:28:57 +09:00
BurdetteLamar de5c14d4d8
[ruby/bigdecimal] Enhanced RDoc for selected methods
https://github.com/ruby/bigdecimal/commit/0de9298d15
2021-12-24 02:28:57 +09:00
BurdetteLamar e043829a7f
[ruby/bigdecimal] Enhanced RDoc for selected methods
https://github.com/ruby/bigdecimal/commit/6139ea1092
2021-12-24 02:28:57 +09:00
Kenta Murata d905abb457
[ruby/bigdecimal] Fix BigDecimal#precision for single DECDIG case
Fix GH-205

https://github.com/ruby/bigdecimal/commit/7d198394a2
2021-12-24 02:28:56 +09:00
Kenta Murata 38e98cbdb7
[ruby/bigdecimal] Keep obj-to-Real link when VpReallocReal returns different pointer
https://github.com/ruby/bigdecimal/commit/252748de17
2021-12-24 02:28:56 +09:00
Kenta Murata 75f552e973
[ruby/bigdecimal] Fix the precision of the adjusted quotient
https://github.com/ruby/bigdecimal/commit/8dc8cd339d
2021-12-24 02:28:56 +09:00
Kenta Murata 7b2cfce543
[ruby/bigdecimal] Let BigDecimal_DoDivmod use the same precision calculation as BigDecimal_divide
https://github.com/ruby/bigdecimal/commit/11cb2c8840
2021-12-24 02:28:55 +09:00
Kenta Murata e1265c8198
[ruby/bigdecimal] Use larger precision in divide for irrational or recurring results
Just in case for irrational or recurring results, the precision of the
quotient is set to at least more than 2*Float::DIG plus alpha.

[Bug #13754] [Fix GH-94]

https://github.com/ruby/bigdecimal/commit/99442c75d3
2021-12-24 02:28:55 +09:00
Kenta Murata 8ee8ac6423
[ruby/bigdecimal] Fix trailing zeros handling in rb_uint64_convert_to_BigDecimal
Fix GH-192

https://github.com/ruby/bigdecimal/commit/eebc98b85a
2021-12-24 02:28:55 +09:00
BurdetteLamar ed7f4c24d7
[ruby/bigdecimal] Respond to review
https://github.com/ruby/bigdecimal/commit/f528a0006e
2021-12-24 02:28:54 +09:00
BurdetteLamar ed8ec5dcb3
[ruby/bigdecimal] Respond to review
https://github.com/ruby/bigdecimal/commit/4eadcdf0a6
2021-12-24 02:28:54 +09:00
BurdetteLamar 44acab76af
[ruby/bigdecimal] Respond to review
https://github.com/ruby/bigdecimal/commit/6d69422e37
2021-12-24 02:28:53 +09:00
BurdetteLamar 973e508472
[ruby/bigdecimal] Respond to review for #precision
https://github.com/ruby/bigdecimal/commit/681cd2d81d
2021-12-24 02:28:53 +09:00
BurdetteLamar 5888d3030d
[ruby/bigdecimal] Enhanced RDoc for bigdecimal.c
https://github.com/ruby/bigdecimal/commit/3a35f92f8b
2021-12-24 02:28:53 +09:00
BurdetteLamar 01b2ccaa95
[ruby/bigdecimal] Enhanced RDoc for bigdecimal.c
https://github.com/ruby/bigdecimal/commit/31a7a37426
2021-12-24 02:28:52 +09:00
Jean Boussier ec478d947f
[ruby/bigdecimal] Fix negative Bignum conversion
Introduced in https://github.com/ruby/bigdecimal/commit/4792a917d806

`rb_absint_size` return the number of bytes needed to fit
the absolute integer, but negative integers need the sign, so one more
bit, and potentially one more byte.

https://github.com/ruby/bigdecimal/commit/0f3d5d0eb7
2021-12-24 02:28:51 +09:00
Olle Jonsson 03507498b6
[ruby/bigdecimal] VpCheckException: improve grammar
I added a space before the parenthesis, too.

https://github.com/ruby/bigdecimal/commit/159af10b17
2021-12-24 02:28:47 +09:00
Nobuyoshi Nakada 40a1af6151
Install ruby/digest.h when from ext/digest 2021-12-23 20:12:45 +09:00
Kazuki Yamaguchi ac757b218c [ruby/openssl] pkey: use EVP_PKEY_CTX_new_from_name() on OpenSSL 3.0
Replace EVP_PKEY_CTX_new_id() with the new EVP_PKEY_CTX_new_from_name()
which takes the algorithm name in a string instead of in an NID.

https://github.com/ruby/openssl/commit/d6535d13d1
2021-12-20 23:42:04 +09:00
Kazuki Yamaguchi 61e426ae05 [ruby/openssl] pkey: assume a pkey always has public key components on OpenSSL 3.0
OpenSSL 3.0's EVP_PKEY_get0() returns NULL for provider-backed pkeys.
This causes segfault because it was supposed to never return NULL
before.

We can't check the existence of public key components in this way on
OpenSSL 3.0. Let's just skip it for now.

https://github.com/ruby/openssl/commit/ccdb6f7bfa
2021-12-20 23:42:04 +09:00
Kazuki Yamaguchi 0b3482c0e7 [ruby/openssl] ssl: add constants for new SSL_OP_* flags
Add all SSL_OP_* constants defined in OpenSSL 3.0.0 which are not
specific to DTLS.

https://github.com/ruby/openssl/commit/b1ee2f23b2
2021-12-20 23:42:03 +09:00
Kazuki Yamaguchi b2fb503dab [ruby/openssl] engine: disable OpenSSL::Engine on OpenSSL 3.0
The entire ENGINE API is deprecated in OpenSSL 3.0 in favor of the new
"Provider" concept.

OpenSSL::Engine will not be defined when compiled with OpenSSL 3.0.
We would need a way to interact with providers from Ruby programs, but
since the concept is completely different from the ENGINE API, it will
not be through the current OpenSSL::Engine interface.

https://github.com/ruby/openssl/commit/69a27d8de4
2021-12-20 23:42:03 +09:00
Kazuki Yamaguchi c1a7c6df18 [ruby/openssl] hmac: fix wrong usage of EVP_DigestSignFinal()
According to the manpage, the "siglen" parameter must be initialized
beforehand.

https://github.com/ruby/openssl/commit/6a60c7b2e7
2021-12-20 23:42:02 +09:00
Kazuki Yamaguchi 8ebf597885 [ruby/openssl] pkey: deprecate PKey#set_* methods
OpenSSL 3.0 made EVP_PKEY immutable. This means we can only have a const
pointer of the low level struct and the following methods can no longer
be provided when linked against OpenSSL 3.0:

 - OpenSSL::PKey::RSA#set_key
 - OpenSSL::PKey::RSA#set_factors
 - OpenSSL::PKey::RSA#set_crt_params
 - OpenSSL::PKey::DSA#set_pqg
 - OpenSSL::PKey::DSA#set_key
 - OpenSSL::PKey::DH#set_pqg
 - OpenSSL::PKey::DH#set_key
 - OpenSSL::PKey::EC#group=
 - OpenSSL::PKey::EC#private_key=
 - OpenSSL::PKey::EC#public_key=

There is no direct replacement for this functionality at the moment.
I plan to introduce a wrapper around EVP_PKEY_fromdata(), which takes
all key components at once to construct an EVP_PKEY.

https://github.com/ruby/openssl/commit/6848d2d969
2021-12-20 23:42:02 +09:00
Kazuki Yamaguchi b93ae54258 [ruby/openssl] pkey/ec: deprecate OpenSSL::PKey::EC#generate_key!
OpenSSL::PKey::EC#generate_key! will not work on OpenSSL 3.0 because
keys are made immutable. Users should use OpenSSL::PKey.generate_key
instead.

https://github.com/ruby/openssl/commit/5e2e66cce8
2021-12-20 23:42:02 +09:00
Kazuki Yamaguchi 0d698be04f [ruby/openssl] pkey/dh: deprecate OpenSSL::PKey::DH#generate_key!
OpenSSL::PKey::DH#generate_key! will not work on OpenSSL 3.0 because
keys are made immutable. Users should use OpenSSL::PKey.generate_key
instead.

https://github.com/ruby/openssl/commit/8ee6a582c7
2021-12-20 23:42:02 +09:00
Kazuki Yamaguchi 50b90c5fc3 [ruby/openssl] pkey/ec: avoid using EC#public_key= in EC#dh_compute_key
Similarly to DH#compute_key, work around it by constructing a
SubjectPublicKeyInfo. This should be considered as a temporary
implementation.

https://github.com/ruby/openssl/commit/fc9aabc18d
2021-12-20 23:42:01 +09:00
Kazuki Yamaguchi dc3f37c6cc [ruby/openssl] pkey/dh: avoid using DH#set_key in DH#compute_key
DH#set_key will not work on OpenSSL 3.0 because keys are immutable.
For now, let's reimplement DH#compute_key by manually constructing a
DER-encoded SubjectPublicKeyInfo structure and feeding it to
OpenSSL::PKey.read.

Eventually, we should implement a new method around EVP_PKEY_fromdata()
and use it instead.

https://github.com/ruby/openssl/commit/46ca47060c
2021-12-20 23:42:01 +09:00
Kazuki Yamaguchi df6589e418 [ruby/openssl] pkey: use EVP_PKEY_dup() if available
We can use it to implement OpenSSL::PKey::PKey#initialize_copy. This
should work on all key types, not just DH/DSA/EC/RSA types.

https://github.com/ruby/openssl/commit/66cd8cbaaf
2021-12-20 23:42:01 +09:00
Kazuki Yamaguchi c1a36ebfda [ruby/openssl] pkey: allocate EVP_PKEY on #initialize
Allocate an EVP_PKEY when the content is ready: when #initialize
or #initialize_copy is called, rather than when a T_DATA is allocated.
This is more natural because the lower level API has been deprecated
and an EVP_PKEY is becoming the minimum unit of handling keys.

https://github.com/ruby/openssl/commit/74f6c61756
2021-12-20 23:42:01 +09:00
Kazuki Yamaguchi 02a58fbfd1 [ruby/openssl] pkey: do not check NULL argument in ossl_pkey_new()
Passing NULL to ossl_pkey_new() makes no sense in the first place, and
in fact it is ensured not to be NULL in all cases.

https://github.com/ruby/openssl/commit/316cb2a41f
2021-12-20 23:42:00 +09:00
Kazuki Yamaguchi 6ef0f272eb [ruby/openssl] pkey: use OSSL_DECODER to load encrypted PEM on OpenSSL 3.0
OpenSSL 3.0 has rewritten routines to load pkeys (PEM_read_bio_* and
d2i_* functions) around the newly introduced OSSL_DECODER API.

This comes with a slight behavior change. They now decrypt and parse
each encountered PEM block, then check the kind of the block. This used
to be the reverse: they checked the PEM header to see the kind, and then
decrypted the content. This means that the password callback may now be
called repeatedly.

Let's use the OSSL_DECODER API directly on OpenSSL 3.0 so that the
return value from the password callback will be reused automatically.

https://github.com/ruby/openssl/commit/a84ea531bb
2021-12-20 23:42:00 +09:00
Hiroshi SHIBATA 87b968c903
[ruby/psych] psych depends stringio only CRuby
https://github.com/ruby/psych/commit/e7bbf26cb2
2021-12-20 18:26:58 +09:00
Hiroshi SHIBATA 706c7a27fa [ruby/psych] Bump version to 4.0.3
https://github.com/ruby/psych/commit/75ab76e788
2021-12-20 18:25:50 +09:00
Nobuyoshi Nakada 54f0e63a8c Remove `NODE_DASGN_CURR` [Feature #18406]
This `NODE` type was used in pre-YARV implementation, to improve
the performance of assignment to dynamic local variable defined at
the innermost scope.  It has no longer any actual difference with
`NODE_DASGN`, except for the node dump.
2021-12-13 12:53:03 +09:00