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

16257 Коммитов

Автор SHA1 Сообщение Дата
Stan Lo 16b2e03014 [ruby/reline] Remove unapproved color setting APIs
These APIs/configs are not approved by the Ruby core, so they can't be
released to the public. This means having them in the codebase will
block other fixes/features from being released as well.

So this commit removes those exposed interfaces to unblock the release.

Hopefully when https://bugs.ruby-lang.org/issues/18996 is approved we
can re-implement better APIs.

https://github.com/ruby/reline/commit/f7a961c550
2022-12-05 03:14:55 +00:00
Aaron Patterson dba61f487c return early if there is no is_entries buffer
If there is a compilation error, is_entries may not be allocated, but
ic_size could be greater than 0.  If we don't have a buffer to iterate
over, just return early.  Otherwise GC could segv

[Bug #19173]
2022-12-03 13:03:51 -06:00
Koichi Sasada 59e389af28 UnboundMethod only refer defined_class
UnboundMethod records caller's class, like `D` or `E` on the
following case:

```ruby
class C
  def foo = :foo
end

class D < C
end

class E < C
end

d = D.instance_method(:foo)
e = E.instance_method(:foo)
```

But `d` and `e` only refers `C#foo` so that UnboundMethod doesn't
record `D` or `E`. This behavior changes the following methods:

* `UnboundMethod#inspect` (doesn't show caller's class)
* `UnboundMethod#==` (`d == e` for example)

fix https://bugs.ruby-lang.org/issues/18798
2022-12-03 08:53:12 +09:00
Stan Lo 7161bf34e1 [ruby/irb] Require pathname in test helper
(https://github.com/ruby/irb/pull/467)

https://github.com/ruby/irb/commit/39c6924c12
2022-12-02 22:00:42 +00:00
Stan Lo 69fd673b1a [ruby/irb] Disable debug cmd tests based on project structure
instead of env
(https://github.com/ruby/irb/pull/466)

It's hard to find an env var that's universally set in all Ruby CI
environments but not in local. Checking gemspec seems to be a better way
as `syntax_suggest` already uses it for a while.

d8f1bca297/spec/spec_helper.rb (L47)
2022-12-02 20:43:59 +00:00
Ellen Marie Dash 82b86b4c97 [rubygems/rubygems] Delete partial file and re-raise on Errno::ENOSPC.
Add test for not leaving empty files if ENOSPC is raised during 'gem install'

https://github.com/rubygems/rubygems/commit/8e0e20f079
2022-12-02 19:21:08 +00:00
Takashi Kokubun 5fafff15c6
Do not run drb SSL tests on Windows
These tests often cause a timeout and this issue seems specific to the
Windows platforms.
https://github.com/ruby/ruby/actions/runs/3603761925/jobs/6072346738
2022-12-02 10:49:56 -08:00
Nobuyoshi Nakada bb0ec7df32
Wait killed threads 2022-12-02 23:46:21 +09:00
Nobuyoshi Nakada 21ed929e15 [ruby/io-console] Omit on JRuby
https://github.com/ruby/io-console/commit/9122c181eb
2022-12-02 10:33:36 +00:00
Nobuyoshi Nakada 678bcfcaa6 [ruby/io-console] Check rawmode option names strictly
https://github.com/ruby/io-console/commit/aa8fc7e947
2022-12-02 10:33:35 +00:00
Takashi Kokubun f01bfa8af7 [ruby/irb] This doesn't work on RubyCI either
http://rubyci.s3.amazonaws.com/rhel_zlinux/ruby-master/log/20221202T063302Z.fail.html.gz
http://rubyci.s3.amazonaws.com/openbsd-current/ruby-master/log/20221202T053006Z.fail.html.gz
http://rubyci.s3.amazonaws.com/freebsd12/ruby-master/log/20221202T063002Z.fail.html.gz
http://rubyci.s3.amazonaws.com/osx1013/ruby-master/log/20221202T054503Z.fail.html.gz

https://github.com/ruby/irb/commit/13c2484d59
2022-12-02 07:41:18 +00:00
Nobuyoshi Nakada ad4eab1a8c
Wait killed thread 2022-12-02 16:20:43 +09:00
Takashi Kokubun 7e3b42d008 [ruby/irb] Skip debug command tests on ruby/ruby
Stan has said these tests could be excluded if they don't work on
ruby/ruby CI.

https://github.com/ruby/irb/commit/11e779ecb7
2022-12-02 04:43:36 +00:00
Nobuyoshi Nakada b6c66ead9d [ruby/irb] Use the proper ruby command and library path
https://github.com/ruby/irb/commit/1416cc1871
2022-12-02 03:14:51 +00:00
Stan Lo 8abf9e6ad0 [ruby/irb] Test debug commands without yamatanooroti
(https://github.com/ruby/irb/pull/464)

* Add debug command tests that don't require yamatanooroti

* Remove debug command related yamatanooroti tests

As discussed in https://github.com/ruby/irb/pull/449#pullrequestreview-1187255149,
we should avoid adding new tests that need yamatanooroti because it's
not maintained by the Ruby org. And since debug commands are now tested
in `test/irb/test_debug_cmd.rb`, we don't need these tests anymore.

* Test against latest debug gem

https://github.com/ruby/irb/commit/78a8aa8834
2022-12-02 01:05:22 +00:00
Takashi Kokubun 8ffa8fc192
Relax the timeout of a YAML test
https://cirrus-ci.com/task/4752663775019008
2022-12-01 15:37:41 -08:00
Jean byroot Boussier 3d272b0fc8
Module#remove_method: Check frozen on the right object
Previously, the frozen check happened on `RCLASS_ORIGIN(self)`, which
can return an iclass. The frozen check is supposed to respond to objects
that users can call methods on while iclasses are hidden from users.
Other mutation methods like Module#{define_method,alias_method,public}
don't do this. Check frozen status on the module itself.

Fixes [Bug #19164] and [Bug #19166].

Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
2022-12-01 17:32:41 -05:00
Nobuyoshi Nakada c0dc717c45 [Bug #19087] Disallow successive underscores in Complex string 2022-12-02 01:35:45 +09:00
Takashi Kokubun 2c939458ca
YJIT: Reorder branches for Fixnum opt_case_dispatch (#6841)
* YJIT: Reorder branches for Fixnum opt_case_dispatch

Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>

* YJIT: Don't support too large values

Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
2022-12-01 10:59:56 -05:00
Nobuyoshi Nakada 5872fd6f6c [Feature #19163] Marshal-loaded Data object also should be frozen 2022-12-02 00:56:52 +09:00
Nobuyoshi Nakada a14a1a5626 [Feature #19163] Data object should be frozen 2022-12-02 00:56:52 +09:00
Samuel Williams 0436f1e15a
Introduce `Fiber#storage` for inheritable fiber-scoped variables. (#6612) 2022-12-01 23:00:33 +13:00
Nobuyoshi Nakada 9869bd1d61 [Bug #19108] Check for the encoding of pack/unpack format 2022-12-01 17:38:33 +09:00
Nobuyoshi Nakada a1d341efaf [ruby/delegate] Revert "Fix `DelegateClass` block "method redefined" warning"
https://github.com/ruby/delegate/commit/2a91436284
2022-12-01 08:08:02 +00:00
Nobuyoshi Nakada 4e68b59431 [Feature #19138] Add `SyntaxError#path` 2022-12-01 17:05:41 +09:00
Alan Wu 5752d11f1f Use RTEST and add test for GH-6832
Technically we shouldn't see Qfalse now, but RTEST also compiles down to
just one branch anyways. Pretty contrived issue, but easy to fix.
2022-11-30 16:27:39 -05:00
Takashi Kokubun 0d3fc08ff4
YJIT: Optimize rb_int_equal (#6838) 2022-11-30 16:16:11 -05:00
Yusuke Endoh ab4c7077cc Prevent segfault in String#scan with ObjectSpace.each_object
Calling `String#scan` without a block creates an incomplete MatchData
object whose `RMATCH(match)->str` is Qfalse. Usually this object is not
leaked, but it was possible to pull it by using ObjectSpace.each_object.

This change hides the internal MatchData object by using rb_obj_hide.

Fixes [Bug #19159]
2022-12-01 02:38:51 +09:00
Nobuyoshi Nakada 99cad3fccd [ruby/rdoc] Non-RD part feature has not been imported to RDoc
https://github.com/ruby/rdoc/commit/fe0159de2f
2022-12-01 02:36:20 +09:00
yui-knk 67ae3e9738 Add a test case for argument forwarding 2022-11-29 18:23:00 +09:00
Shugo Maeda 74bdf09215
Add tests for [Feature #19134]
https://bugs.ruby-lang.org/issues/19134?next_issue_id=19133&prev_issue_id=19135#note-4
2022-11-29 14:18:16 +09:00
Takashi Kokubun 129d208f9a [ruby/erb] Fix line numbers after multi-line <%#
(https://github.com/ruby/erb/pull/42)

https://github.com/ruby/erb/commit/526885923e
2022-11-29 04:56:03 +00:00
Shugo Maeda 4fc668a4f3 Allow ** in def foo(...)
[Feature #19134]
2022-11-29 11:22:09 +09:00
Yusuke Endoh f3ad68dd16 [ruby/optparse] Fix the test failure i ruby/ruby
```
$ make test-all TESTS=test/optparse/
...

[148/178] TestOptionParserDidYouMean#test_raise_unknown = 0.00 s
  1) Failure:
TestOptionParserDidYouMean#test_raise_unknown [/home/mame/work/ruby/test/optparse/test_optparse.rb:106]:
<["--bar"]> expected but was
<[]>.
```

In the old test/unit (bundled in ruby/ruby), when a test class inherits from
another test class, the child class runs all the tests defined in the parent
class.
However, it looks like the new test/unit does not do so. This is because the
test failure does not occur in ruby/optparse.

As a tentative solution, this changes the option names in TestOptionParser to
avoid the name conflict with TestOptionParserDidYouMean.

https://github.com/ruby/optparse/commit/fee86ef7a4
2022-11-28 16:20:40 +00:00
Nobuyoshi Nakada 0bfb185654 [ruby/optparse] Add `raise_unknown` flag
(https://github.com/ruby/optparse/pull/38)

https://github.com/ruby/optparse/commit/12529653cd
2022-11-28 14:24:06 +00:00
Takashi Kokubun 168b0e1f02 Make the timeout of test_system_sigpipe longer
https://github.com/ruby/ruby/actions/runs/3562236318/jobs/5983796689
2022-11-27 22:48:19 -08:00
Takashi Kokubun 880e8fd1f9 Relax a too strict timeout
Regexp tests are flaky.
http://rubyci.s3.amazonaws.com/s390x/ruby-master/log/20221128T050004Z.fail.html.gz
2022-11-27 21:48:32 -08:00
Sven Riedel e0901f46b7 [ruby/rdoc] Add `--no-skipping-tests` option
https://github.com/ruby/rdoc/commit/33925f885f
2022-11-28 04:36:29 +00:00
Xenor Chang 745dcf5326 [ruby/cgi] Loosen the domain regex to accept '.'
(https://github.com/ruby/cgi/pull/29)

* Loosen the domain regex to accept '.'

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>

https://github.com/ruby/cgi/commit/5e09d632f3
Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>
2022-11-28 04:34:11 +00:00
Takashi Kokubun 03b96319b4 Skip a broken RDoc test
http://ci.rvm.jp/results/trunk-yjit@phosphorus-docker/4309535
http://ci.rvm.jp/results/trunk-random0@phosphorus-docker/4309536
http://ci.rvm.jp/results/trunk-random1@phosphorus-docker/4309538
http://ci.rvm.jp/results/trunk-random2@phosphorus-docker/4309541
http://ci.rvm.jp/results/trunk-random3@phosphorus-docker/4309544
http://ci.rvm.jp/results/trunk-no-mjit@phosphorus-docker/4309550
http://ci.rvm.jp/results/trunk-yjit@phosphorus-docker/4309556
http://ci.rvm.jp/results/trunk-random0@phosphorus-docker/4309562
http://ci.rvm.jp/results/trunk-random1@phosphorus-docker/4309564
http://ci.rvm.jp/results/trunk-random2@phosphorus-docker/4309567
http://ci.rvm.jp/results/trunk-random3@phosphorus-docker/4309570
http://rubyci.s3.amazonaws.com/solaris10-gcc/ruby-master/log/20221127T200003Z.fail.html.gz
http://ci.rvm.jp/results/trunk-random-repeat@phosphorus-docker/4309581
http://rubyci.s3.amazonaws.com/freebsd12/ruby-master/log/20221127T203002Z.fail.html.gz
http://ci.rvm.jp/results/trunk-yjit@phosphorus-docker/4309588
2022-11-27 13:02:43 -08:00
Nobuyoshi Nakada 5b1db79129 [ruby/rdoc] Revert "Refactor `RDoc::Markup::Parser#tokenize`"
This reverts commit https://github.com/ruby/rdoc/commit/41ceae93b3bc.

https://github.com/ruby/rdoc/commit/5d2c47e8b8
2022-11-27 19:46:12 +00:00
Nobuyoshi Nakada 21977b95e2 [ruby/rdoc] Refactor `RDoc::Markup::Parser#tokenize`
Make verbatims text or newline only, and simplify `build_verbatim`.

https://github.com/ruby/rdoc/commit/41ceae93b3
2022-11-27 17:24:38 +00:00
nick evans ae3817bc61 [ruby/rdoc] Darkfish: Nest sidebar ToC as a tree of headings
This uses `<details><summary>heading</summary><ul>nested</ul></detail>`,
similar to how the classes and pages lists are now nested.

https://github.com/ruby/rdoc/commit/e57beff287
2022-11-27 17:18:16 +00:00
Stan Lo ec76c9868b [ruby/irb] Activate yamatanooroti tests on CI
(https://github.com/ruby/irb/pull/459)

* Activate yamatanooroti tests on CI

* Fix delete test

https://github.com/ruby/irb/commit/750cf4c480
2022-11-27 06:09:50 +00:00
Peter Zhu de9e2a5ac7 [ruby/net-http] Fix test for Ruby head
The error raised for broken coderanges was changed in ruby/ruby@571d21f
and the test was fixed in that commit but not ported to this repo.

ruby/net-http@e6185dda26
2022-11-26 16:06:05 -05:00
Takashi Kokubun 4ea9d7d7c2 MJIT: Remove the code to optimize shape transition
because this code crashes on railsbench. I'll try adding a repro for it
later, but I don't know shapes enough to craft it right away.
2022-11-25 15:18:34 -08:00
Alan Wu 1d64a5a7c0 YJIT: Run test-all tests without requiring RUN_OPTS
Most tests in test_yjit.rb use a sub process, so we can run them even
when the parent process is not running with YJIT. Run them so simply
running `make check` tests YJIT a bit.

[Misc #19149]
2022-11-25 17:15:24 -05:00
Alan Wu 790cf4b6d0 Fix autoload status of statically linked extensions
Previously, for statically-linked extensions, we used
`vm->loading_table` to delay calling the init function until the
extensions are required. This caused the extensions to look like they
are in the middle of being loaded even before they're required.
(`rb_feature_p()` returned true with a loading path output.) Combined
with autoload, queries like `defined?(CONST)` and `Module#autoload?`
were confused by this and returned nil incorrectly. RubyGems uses
`defined?` to detect if OpenSSL is available and failed when OpenSSL was
available in builds using `--with-static-linked-ext`.

Use a dedicated table for the init functions instead of adding them to
the loading table. This lets us remove some logic from non-EXTSTATIC
builds.

[Bug #19115]
2022-11-25 16:21:40 -05:00
Nobuyoshi Nakada 58dc9c931b [rubygems/rubygems] Stop installing everything under "lib" at the top in all tests
https://github.com/rubygems/rubygems/commit/f9772d62e1
2022-11-25 08:02:28 +00:00
Nobuyoshi Nakada ffc6c5d056 [Bug #18971] Add precheck to enumerator 2022-11-25 16:11:17 +09:00