Commit graph

75067 commits

Author SHA1 Message Date
Stan Lo
c9076d546a [ruby/irb] Add show_doc as an alias to the help command
(https://github.com/ruby/irb/pull/475)

In the long-term, we want to align with `Pry`, `byebug` and `debug` to
use the `help` command to list all commands, which is what `show_cmds`
currently does. And `show_doc` will be the command to look up Ruby APIs.

By aliasing `show_doc` to the current `help` now, users will have time
to get use to it.
2022-12-08 21:46:55 +00:00
Stan Lo
12b7c129bf [ruby/irb] Gracefully handle missing command argument
(https://github.com/ruby/irb/pull/473)

* Handle file loading commands' argument error gracefully

Currently, if users don't provide an argument to `source`,
`irb_load`, and `irb_require`, IRB raises `ArgumentError` with full
stacktrace. This is confusing because it looks similar to when IRB has
internal issues. The message also isn't helpful on helping users avoid
the error.

So in this commit, I add a new `CommandArgumentError` for commands to
raise explicitly when users' input doesn't satisfy a command's argument
requirement.

* Gracefully handle `fg` command's argument requirement
2022-12-08 21:05:37 +00:00
git
234c3a056e Update default gems list at 8bbf4e5d8d [ci skip] 2022-12-08 21:00:41 +00:00
Sutou Kouhei
8bbf4e5d8d [ruby/stringio] bump up to 3.0.5
e62b9d78d3
2022-12-08 20:58:53 +00:00
Alan Wu
bb8afd7265 Freeze singleton class, not its origin
Previously, when we froze an object, we froze
`RCLASS_ORIGIN(object.singleton_class)`, which didn't freeze
`object.singleton_class` when it has some prepended modules.

Origin iclass are internal objects and users can't interact with
them through Kernel#freeze?, Kernel#freeze, or any mutation method
that checks the frozen status. So we shouldn't touch the origin
iclasses when the frozen status should be visible.

[Bug #19169]
2022-12-08 15:58:26 -05:00
Alan Wu
47a5b34aba YJIT: Fold check-yjit-bindings into yjit-bindgen
So it's shorter on CI and the hint about how the fix the failure shows
up. It's going to print a diff locally too, but that should be fine.
2022-12-08 15:58:00 -05:00
Alan Wu
2ae26554de YJIT: Add a hint for fixing "check-yjit-bindings"
This makes it clear what to do when the CI check
fails and should remove a few minutes of confusion
for people seeing this for the first time.
2022-12-08 15:58:00 -05:00
Stan Lo
a87f802f1e [ruby/irb] Kill PTY process after test is finished
(https://github.com/ruby/irb/pull/471)

The killing/waiting logic is borrowed from ruby/debug:

ec5ae5aebd/test/support/test_case.rb (L107-L136)
2022-12-08 19:11:51 +00:00
Stan Lo
3956bb859c [ruby/irb] Add "show_cmds" command to list all commands'
descriptions
(https://github.com/ruby/irb/pull/463)

7e857655ac
2022-12-08 19:10:23 +00:00
Takashi Kokubun
2cea8e014d
MJIT: Mark MJIT's objects from mjit_mark
It looks like the current way of marking objects was breaking
eightbitraptor's upcoming VWA changes and this seems to fix it.
2022-12-08 10:31:56 -08:00
Jean Boussier
73771e4b19 ObjectSpace.dump_all: dump shapes as well
I see several arguments in doing so.

First they use a non trivial amount of memory, so for various memory
profiling/mapping tools it is relevant to have visibility of the space
occupied by shapes.

Then, some pathological code can create a tons of shape, so it is
valuable to have a way to have a way to observe shapes without having
to compile Ruby with `SHAPE_DEBUG=1`.

And additionally it's likely much faster to dump then this way than
to use `RubyVM::Shape`.

There are however a few open questions:

- Shapes can't respect the `since:` argument. Not sure what to do when
  it is provided. Would probably make sense to not dump them.
- Maybe it would make more sense to have a separate `ObjectSpace.dump_shapes`?
- Maybe instead `dump_all` should take a `shapes: false` argument?

Additionally, `ObjectSpace.dump_shapes` is added for the use case of
debugging the evolution of the shape tree.
2022-12-08 18:46:16 +01:00
Nobuyoshi Nakada
b19490f75d Use the built bundled gems in test-all as well as test-bundled-gems 2022-12-09 02:20:16 +09:00
Jimmy Bourassa
5738ae70d9
[DOC] Update rb_gc_mark_locations doc
The documentation says that the `end` pointer will be marked
but looking at the source, that is not the case.
2022-12-09 00:38:23 +09:00
Jean Boussier
e9f6d6b3fb Ignore .o.tmp files 2022-12-08 13:29:13 +01:00
Jean Boussier
6081fd4564 [ruby/net-protocol] Failing test case for #19
Unfortunately we have to use a mock, but this test demonstrate the
mutation bug fixed in #19.

It fails on 0.2.0 but passes on 0.1.3 or 0.2.1.

40a1ab687c
2022-12-08 12:15:52 +00:00
git
516fe62734 Update default gems list at 6f44dc8edf [ci skip] 2022-12-08 07:24:21 +00:00
Hiroshi SHIBATA
6f44dc8edf [ruby/net-protocol] Bump version to 0.2.1
06d1420936
2022-12-08 07:23:46 +00:00
Jean Boussier
8547f61daf [ruby/net-protocol] Undo BufferedIO#rbuf_consume_all_shareable! optimization
This optimization is unsafe because `dest` is allowed to be a custom
object responding to `<<` (e.g. a block wrapped in `ReadAdapter`).

So the receiver can hold onto the passed buffer for as long as it wants.

If it was guaranteed that `ReadAdapter` was the only possible receiver
we could dup the buffer there for mutation safety, but I'm not certain
it's the case so I'd rather err on the safe side.

Ref: https://github.com/shrinerb/shrine/issues/610

7efa16d55d
2022-12-08 07:17:51 +00:00
Benoit Daloze
a57a3154d3 [rubygems/rubygems] Avoid deprecated Gem::Platform.match in Gem::Resolver::InstallerSet
05cb5410cb
2022-12-08 07:17:09 +00:00
Takashi Kokubun
3938bd1b42
MJIT: Remove Windows-specific code
because we no longer support it
2022-12-07 22:05:15 -08:00
Takashi Kokubun
09bc3abd2e
MJIT: Deal with a TODO with assertion 2022-12-07 21:20:05 -08:00
Samuel Williams
6fd5d2dc00
Introduce IO.new(..., path:) and promote File#path to IO#path. (#6867) 2022-12-08 18:19:53 +13:00
git
b2764752b2 Update default gems list at b9d055d760 [ci skip] 2022-12-08 05:13:10 +00:00
Sutou Kouhei
b9d055d760 [ruby/stringio] bump up to 3.0.4
5ba853d6ff
2022-12-08 05:12:15 +00:00
Akira Matsuda
7e121dc4a8 [ruby/logger] Another performance improvement on the Formatter by
using Kernel#sprintf over String#%
(https://github.com/ruby/logger/pull/75)

* Prefer Kernel#sprintf over String#% for formatting Strings
2022-12-08 03:31:36 +00:00
Samuel Williams
7ab4820af7 [ruby/logger] Only assign to @filename if the path is valid.
(https://github.com/ruby/logger/pull/81)

b41d7c699c
2022-12-08 03:28:18 +00:00
Hiroshi SHIBATA
2efaa80523
Don't sync jar artifact of CGI 2022-12-08 12:22:02 +09:00
Samuel Williams
701251c576 [ruby/logger] Drop RDoc development dependency to avoid CI failures.
(https://github.com/ruby/logger/pull/82)

8915627234
2022-12-08 03:21:40 +00:00
git
7cd0dacb0b Update default gems list at 9fce6014b5 [ci skip] 2022-12-08 02:09:25 +00:00
Hiroshi SHIBATA
9fce6014b5 [ruby/psych] Bump version to 5.0.1
bdf20e6042
2022-12-08 02:08:25 +00:00
Chris Seaton
645cd94d9a
Add debug counters to RubyVM.stat (#6086)
* Add debug counters to RubyVM.stat

* Use SIZET2NUM

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

* Prefix debug_counter_names
2022-12-07 17:09:30 -08:00
Stan Lo
a2d3f5606a [ruby/irb] Lazily load the multi-irb extension
(https://github.com/ruby/irb/pull/472)

* Lazily load the multi-irb extension

We now have plan to implement a command that prints all commands'
information, which will need to load all command files without actually
running them.

But because the `multi-irb` extension patches IRB's top-level methods,
loading it would cause unintentional side-effects.

So this commit moves related requires into command execution to avoid the problem.

* Make extend_irb_context private

Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2022-12-07 23:30:00 +00:00
Maxime Chevalier-Boisvert
30c76f4d0d
Update yjit.md
Update citation, fix outdated and inaccurate information.
2022-12-07 16:46:59 -05:00
Maxime Chevalier-Boisvert
9350c2b12f
Update YJIT warning, mention need to install rustc (#6873) 2022-12-07 15:02:45 -05:00
Maxime Chevalier-Boisvert
3bb7a40160
Update NEWS.md 2022-12-07 15:00:18 -05:00
Aaron Patterson
a89d856f26 Update spec/bundler/bundler/fetcher/compact_index_spec.rb
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2022-12-07 09:57:11 -08:00
Aaron Patterson
edc7af48ac Stop transitioning to UNDEF when undefining an instance variable
Cases like this:

```ruby
obj = Object.new
loop do
  obj.instance_variable_set(:@foo, 1)
  obj.remove_instance_variable(:@foo)
end
```

can cause us to use many more shapes than we want (and even run out).
This commit changes the code such that when an instance variable is
removed, we'll walk up the shape tree, find the shape, then rebuild any
child nodes that happened to be below the "targetted for removal" IV.

This also requires moving any instance variables so that indexes derived
from the shape tree will work correctly.

Co-Authored-By: Jemma Issroff <jemmaissroff@gmail.com>
Co-authored-by: John Hawthorn <jhawthorn@github.com>
2022-12-07 09:57:11 -08:00
nagachika
f725bf358a Fix a typo in NEWS.md. [ci-skip] 2022-12-07 21:27:36 +09:00
Ian Ker-Seymer
01fd1c482e [rubygems/rubygems] Remove remaining dev profile test
7d50e998b3
2022-12-07 11:31:26 +00:00
Ian Ker-Seymer
88497b2167 [rubygems/rubygems] Better tests are better
17abb80c2c
2022-12-07 11:31:25 +00:00
Ian Ker-Seymer
ef50934721 [rubygems/rubygems] Fix string match in test
82554f2bfd
2022-12-07 11:31:25 +00:00
Ian Ker-Seymer
554161236a [rubygems/rubygems] Always build in release mode
7b84fc1f19
2022-12-07 11:31:25 +00:00
Ian Ker-Seymer
37d10caa0d [rubygems/rubygems] Updates rb-sys to 0.9.46
6c2e7aafd6
2022-12-07 11:31:21 +00:00
Nobuyoshi Nakada
581b4a3c88
NEWS.md: Remove an extraneous word [ci skip] 2022-12-07 19:48:38 +09:00
Nobuyoshi Nakada
58cc3c9f38
[Bug #19187] Fix for tzdata-2022g 2022-12-07 19:19:54 +09:00
Nobuyoshi Nakada
c43203fd09
NEWS.md: Remove white space only lines [ci skip] 2022-12-07 19:19:26 +09:00
Jean Boussier
1968b4e2c7 Mention rb_hash_new_capa and rb_internal_thread_* in NEWS.md 2022-12-07 10:08:25 +01:00
Yusuke Endoh
bcd8b2f00a NEWS.md: Added some missing features
Also, tool/update-NEWS-refs.rb is added to help the update of NEWS.md.
2022-12-07 12:32:29 +09:00
Takashi Kokubun
65545c6608
MJIT: Fix an assertion broken with --mjit-wait enabled 2022-12-06 23:46:16 -08:00
Takashi Kokubun
17d45feeb6
MJIT: Refactor mjit_wait 2022-12-06 23:21:19 -08:00