69518 Commits

Author SHA1 Message Date
Frederik Dudzik
2a90ad7aa5 [rubygems/rubygems] use Rubocop Lint/Debugger check rather than custom spec
We have a quality spec that check for debugger statements. Rubocop has a
cop that tests for the same thing. As such it makes sense to remove the
spec and activate the cop.

https://github.com/rubygems/rubygems/commit/dc1eb6eec5
2021-10-29 17:13:03 +09:00
Nobuyoshi Nakada
27220b2fe4
Skip CodeQL if only document files changed [ci skip] 2021-10-29 11:04:58 +09:00
Kazuhiro NISHIYAMA
ffd8592ebc
Update stdlib version 2021-10-29 10:58:56 +09:00
Yusuke Endoh
c1228f833c vm_core.h: Avoid unaligned access to ic_serial on 32-bit machine
This caused Bus error on 32 bit Solaris
2021-10-29 10:57:46 +09:00
Nobuyoshi Nakada
92ad520ad0 Merge macOS CIs to reduce concurrency
On GitHub Actions, the macOS runners seem much more expensive than
Ubuntu, and its limit is the most significant bottlenecks for our
CIs.  As the "check" tasks usually finish 3 or 4 times faster than
"test-bundler-parallel", it will be balanced by running all three
"check" tasks sequentially.
2021-10-29 10:57:02 +09:00
Nobuyoshi Nakada
96648c5093
Mitigate the timeout of tests [ci skip]
* The worker timeouts seem working for test-all.
* The bundled gems have increased.
2021-10-29 10:32:52 +09:00
Burdette Lamar
3e743d3147
Cleanup some RDoc (#5050)
Mostly adding blank line before and after code segment, to improve compliance with doc\documentation_guide.rdoc.
2021-10-28 17:01:49 -05:00
Nobuyoshi Nakada
9b751db99c Fix script_lines in loaded iseq as nil 2021-10-29 06:39:57 +09:00
Burdette Lamar
f8bbd608c9
Enhanced RDoc for Numeric (#4994)
Treats:

    #eql?
    #<+>
    #floor
    #ceil
    #round
    #truncate
    #step
2021-10-28 15:11:11 -05:00
Alan Wu
e53d07f583 Rename ::YJIT to RubyVM::YJIT
Since the YJIT Ruby module is CRuby specific and not meant for general
use, it should live under RubyVM instead of at top level.
2021-10-28 13:43:02 -04:00
David Rodríguez
d8e97169ba [rubygems/rubygems] Only delete cached gem when it's corrupted
Rescuing all errors here might end up hiding other errors if the
deletion of the cached gem itself raises an error for some reason. Let's
be more conservative.

https://github.com/rubygems/rubygems/commit/3d80dfba08
2021-10-29 02:40:35 +09:00
Koichi Sasada
cbf2078a25 need to mark script_lines 2021-10-29 02:00:06 +09:00
Yusuke Endoh
acb2f86caa string.c: Add some comments about STR flags 2021-10-29 01:57:29 +09:00
Benoit Daloze
c75df796d8 Update to ruby/spec@21a48d9 2021-10-28 18:54:01 +02:00
git
3bf36979d8 * 2021-10-29 [ci skip] 2021-10-29 00:28:34 +09:00
Nobuyoshi Nakada
0a9cbe8562
Skip tests if only document files changed 2021-10-29 00:22:26 +09:00
osyo-manga
d51ba1e1be
Add changes Enumerable#each_cons and each_slice in NEWS [ci skip] 2021-10-28 18:21:27 +09:00
Nobuyoshi Nakada
e76e1d3ce4
Downloader: retry when RFC 2616 noncompliant dates [ci skip]
zlib.net rarely returns the current time in RFC 2616 noncompliant
format in the response header, and the checksum does not match in
that case (maybe creating the tarball on the fly?).
2021-10-28 17:42:36 +09:00
Nobuyoshi Nakada
1d666ed50f Fix leap day with UTC offset [Bug #18274]
`struct vtm::year` is a Ruby integer instance, but not a C integer
type.
2021-10-28 14:45:19 +09:00
Koichi Sasada
77544caaf4 add make runirb rule
it's start irb on built ruby (not installed ruby).
2021-10-28 14:31:02 +09:00
Yusuke Endoh
efcf18f13e Update TypeProf to 0.20.2 2021-10-28 13:45:53 +09:00
Nobuyoshi Nakada
179aa26f4f
Prune stale worktrees before checking out a new pull request [ci skip] 2021-10-28 13:14:31 +09:00
Kazuhiro NISHIYAMA
d844459377
Fix a warning
```
../gc.c:2342:45: warning: comparison of integers of different signs: 'short' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
    GC_ASSERT(size_pools[pool_id].slot_size == slot_size);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
```

Add cast to short, because `GC_ASSERT`s in `size_pool_for_size`
already use cast to short.
2021-10-28 09:22:17 +09:00
Kazuhiro NISHIYAMA
da22e43ce0
Fix a warning
```
../gc.c:2342:25: warning: array subscript is of type 'char' [-Wchar-subscripts]
    GC_ASSERT(size_pools[pool_id].slot_size == slot_size);
                        ^~~~~~~~
```
2021-10-28 09:07:22 +09:00
Nobuyoshi Nakada
b74bf8dd88
Follow up the RString change [ci skip]
Since 46b66eb9e8e6de2d5750591e532310e8f8599d90, already `ary` has
been enclosed in `embed`.
2021-10-28 08:58:59 +09:00
git
30942c19c0 * 2021-10-28 [ci skip] 2021-10-28 02:00:25 +09:00
Alan Wu
fdbae38546 YJIT: move --yjit-stats at_exit call into Ruby
This change fixes `-v --yjit-stats`. Previously in this situation,
YJIT._print_stats wasn't defined as yjit.rb is not evaluated when there
is only "-v" and no Ruby code to run.
2021-10-27 13:00:05 -04:00
Alan Wu
6875d6d1fa Expect multi-line -v output for -DRUBY_DEVEL in tests
On -DRUBY_DEVEL builds, `ruby -v` can print extra info about the last
commit on a separate line, breaking some tests that expect a single
line. Assert only the first line instead.
2021-10-27 13:00:05 -04:00
Alan Wu
0d9913e52f Fix indentation in test 2021-10-27 13:00:05 -04:00
Nobuyoshi Nakada
367884c659
Fix yjit_asm_tests.c as C99 compliant (#5033)
* rb_bug should be variadic

* Prefer ANSI-style prototypes over old K&R-style definitions

* Add missing argument types
2021-10-27 10:57:08 -04:00
John Hawthorn
a6104b392a
YJIT: Support newhash with values (#5029)
* YJIT: Implement newhash with values

* YJIT: Add test of duphash

* Fix compilation on macos/clang
2021-10-27 10:55:43 -04:00
Vít Ondruch
5086c25f60 Properly exclude test cases.
Lets consider the following scenario:

~~~
irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):001:0> p suite
OpenSSL::TestEC
=> OpenSSL::TestEC

irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):002:0> p all_test_methods
["test_ECPrivateKey", "test_ECPrivateKey_encrypted", "test_PUBKEY", "test_check_key", "test_derive_key", "test_dh_compute_key", "test_dsa_sign_asn1_FIPS186_3", "test_ec_group", "test_ec_key", "test_ec_point", "test_ec_point_add", "test_ec_point_mul", "test_generate", "test_marshal", "test_sign_verify", "test_sign_verify_raw"]
=>
["test_ECPrivateKey",
 "test_ECPrivateKey_encrypted",
 "test_PUBKEY",
 "test_check_key",
 "test_derive_key",
 "test_dh_compute_key",
 "test_dsa_sign_asn1_FIPS186_3",
 "test_ec_group",
 "test_ec_key",
 "test_ec_point",
 "test_ec_point_add",
 "test_ec_point_mul",
 "test_generate",
 "test_marshal",
 "test_sign_verify",
 "test_sign_verify_raw"]

irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):003:0> p filter
/\A(?=.*)(?!.*(?-mix:(?-mix:memory_leak)|(?-mix:OpenSSL::TestEC.test_check_key)))/
=> /\A(?=.*)(?!.*(?-mix:(?-mix:memory_leak)|(?-mix:OpenSSL::TestEC.test_check_key)))/

irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):004:0> method = "test_check_key"
=> "test_check_key"
~~~

The intention here is to exclude the `test_check_key` test case.
Unfortunately this does not work as expected, because the negative filter
is never checked:

~~~
irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):005:0> filter === method
=> true

irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):006:0> filter === "#{suite}##{method}"
=> false

irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):007:0> filter === method || filter === "#{suite}##{method}"
=> true
~~~

Therefore always filter against the fully qualified method name
`#{suite}##{method}`, which should provide the expected result.

However, if plain string filter is used, keep checking also only the
method name.

This resolves [Bug #16936].
2021-10-27 19:56:19 +09:00
Kazuhiro NISHIYAMA
9fc2f5375d
Sort URLs by issue numbers [ci skip] 2021-10-27 16:55:29 +09:00
Nobuyoshi Nakada
5ff47e0c8a Check old-style definitions 2021-10-27 16:28:10 +09:00
Kazuhiro NISHIYAMA
219f54152a
Update stdlib versions 2021-10-27 16:22:04 +09:00
Satoshi Moris Tagomori
489e5e3a82 the core problem is the Proc is not shareable 2021-10-27 16:13:43 +09:00
Kazuki Yamaguchi
9541b3b7c0 random.c: simplify Random object deallocation
This is a follow-up for commit 265c0022390e ("Do not allocate
ractor-local storage in dfree function during GC", 2021-02-09).

The comparison with the default rb_random_mt_t is useless in the first
place, since it is never equal: no actual Random object is associated
with it.

[Bug #17653] https://bugs.ruby-lang.org/issues/17653
2021-10-27 15:44:27 +09:00
David Rodríguez
ed5f8eaf49 [rubygems/rubygems] Don't warn when a lockfile is locked to a dev version
Even if it's newer than the running versions. Dev versions are not
released to rubygems.org, so the warning message suggests a command that
doesn't work. And dev versions are currently non deterministic
(2.3.0.dev can be many different versions), so the warning doesn't
really make sense at the moment.

https://github.com/rubygems/rubygems/commit/6f31af27ef
2021-10-27 14:47:21 +09:00
Yusuke Endoh
4c32fcb84f [ruby/error_highlight] Make the formatter mechanism support Ractor
Now the formatter configuration is per Ractor. DefaultFormatter is used
if not set.

DefaultFormatter#message_for is now a class method to allow sub-Ractors
to call the method.

https://github.com/ruby/error_highlight/commit/9fbaa8ab7c
2021-10-27 11:29:20 +09:00
Nobuyoshi Nakada
33844f3096
Prefer ANSI-style prototypes over old K&R-style definitions 2021-10-27 10:16:52 +09:00
Jean Boussier
e5319dc985 pack.c: add an offset argument to unpack and unpack1
[Feature #18254]

This is useful to avoid repeteadly copying strings when parsing binary formats
2021-10-26 22:27:30 +02:00
Jeremy Evans
717ab0bb2e
Add Class#descendants
Doesn't include receiver or singleton classes.

Implements [Feature #14394]

Co-authored-by: fatkodima <fatkodima123@gmail.com>
Co-authored-by: Benoit Daloze <eregontp@gmail.com>
2021-10-26 12:35:21 -07:00
Peter Zhu
a4d5ee4f31 [Bug #18264] Fix memory leak in TracePoint
TracePoint leaks memory because it allocates a `rb_tp_t` struct
without ever freeing it (it is created with `RUBY_TYPED_NEVER_FREE`).
2021-10-26 13:11:35 -04:00
Steven Nunez
f180fa6ca3 Fix Typo 2021-10-26 13:10:49 -04:00
git
66e318503f * 2021-10-27 [ci skip] 2021-10-27 02:05:22 +09:00
Nobuyoshi Nakada
26353c75a9 Embed bare double if sizeof(double) == sizeof(VALUE) 2021-10-27 02:05:06 +09:00
Nobuyoshi Nakada
e3a783b141 Align RFloat at VALUE boundary 2021-10-27 02:05:06 +09:00
Nobuyoshi Nakada
afdca0e780
Fix unaligned access to double in RFloat 2021-10-26 20:17:00 +09:00
Nobuyoshi Nakada
e1ecda297e
Make new object for negated float as Float is always frozen now 2021-10-26 20:17:00 +09:00
Shugo Maeda
37395ffa05
Make the metaclass of Refinement explicitly
Otherwise, singleton methods of Module are not inherited unless
Refinement.singleton_class is called.
2021-10-26 19:36:52 +09:00