Commit graph

15017 commits

Author SHA1 Message Date
David Rodríguez
2d0d1c339a [rubygems/rubygems] Recommend bundle install rather than gem install -g
4028cbc408
2021-08-31 19:06:14 +09:00
David Rodríguez
76b77d9275 [rubygems/rubygems] Refactor reseting RUBYGEMS_GEMDEPS in tests
91dca11112
2021-08-31 19:06:14 +09:00
David Rodríguez
87dfb55c16 [rubygems/rubygems] Use Gem.use_gemdeps only from binstubs
The previous behavior was to automatically require `bundler/setup`
everytime `rubygems` was required, which I think was too much.

b25379a295
2021-08-31 19:06:14 +09:00
David Rodríguez
b6c082fd09 [rubygems/rubygems] Remove misleading comment
When I read, I thought the assertion was incorrect. It's doing the right
thing, though.

e72c27367a
2021-08-31 19:06:14 +09:00
David Rodríguez
19d77a1cfc [rubygems/rubygems] Remove unnecessary spec manipulation
c7c00c280f
2021-08-31 19:06:14 +09:00
David Rodríguez
b17cdad2f8 [rubygems/rubygems] Remove redundant part of error message
It doesn't really add much, in my opinion. We want to be helpful, but
also concise when possible.

9d56009cf7
2021-08-31 19:06:14 +09:00
aycabta
3695d94b25 Omit some tests until debugging is complete 2021-08-31 16:21:40 +09:00
Nobuyoshi Nakada
2dd26bed86
[Feature #16972] Add mode: option to Pathname#mkpath 2021-08-31 11:53:41 +09:00
Nobuyoshi Nakada
66a4768f65 [ruby/irb] Relax backtrace nest levels
fb637bc68f
2021-08-30 13:16:46 +09:00
Hiroshi SHIBATA
b17dc55017 [ruby/irb] Added the extra stdout message with test-unit
b153d587a1
2021-08-30 12:39:37 +09:00
Hiroshi SHIBATA
f3ae14cbde [ruby/irb] Use capture_output instead of capture_io
077e4ae7de
2021-08-30 12:39:31 +09:00
Hiroshi SHIBATA
598f4f4219 [ruby/irb] Use pend instead of skip
f441ce35bf
2021-08-30 12:39:23 +09:00
aycabta
ece4ed0da7 Add --autocomplete / --noautocomplete options 2021-08-30 02:45:13 +09:00
aycabta
24a26db795 [ruby/reline] Disable autocompletion in tests
9b1913567a
2021-08-30 02:37:23 +09:00
aycabta
3bbe860e50 [ruby/irb] Remove path settings for debugging
48029944a5
2021-08-30 02:33:29 +09:00
Jeremy Evans
2d98593bf5 Support tracing of attr_reader and attr_writer
In vm_call_method_each_type, check for c_call and c_return events before
dispatching to vm_call_ivar and vm_call_attrset.  With this approach, the
call cache will still dispatch directly to those functions, so this
change will only decrease performance for the first (uncached) call, and
even then, the performance decrease is very minimal.

This approach requires that we clear the call caches when tracing is
enabled or disabled.  The approach currently switches all vm_call_ivar
and vm_call_attrset call caches to vm_call_general any time tracing is
enabled or disabled. So it could theoretically result in a slowdown for
code that constantly enables or disables tracing.

This approach does not handle targeted tracepoints, but from my testing,
c_call and c_return events are not supported for targeted tracepoints,
so that shouldn't matter.

This includes a benchmark showing the performance decrease is minimal
if detectable at all.

Fixes [Bug #16383]
Fixes [Bug #10470]

Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2021-08-29 07:23:39 -07:00
aycabta
7ea46c1ef2 [ruby/reline] Fix tests so that the completion journey starts on first C-n/C-p
52a40f2cd3
2021-08-29 20:30:33 +09:00
Nobuyoshi Nakada
a615885f1e
Free previously used tables [Bug #18134] 2021-08-29 17:18:58 +09:00
Nobuyoshi Nakada
523bf31564
Add negative position tests [Bug #18138] 2021-08-29 10:35:00 +09:00
Nobuyoshi Nakada
5dc36ddcd0
Add out of range tests for Array#slice! 2021-08-29 10:33:22 +09:00
Lars Kanis
9c0582704f Fix example fiber scheduler reg. writable events
There were two issues:

1. When an IO object is waiting for writablility only (as in test_tcp_accept) the selected hash is empty.
   Therefore selected[fiber] returns nil but needs to default to 0 in order to be or'ed with IO::WRITABLE.

2. When an IO object is waiting for read- or writability (as in test_tcp_connect), but only one of these
   two events arrive, the Fiber and IO object need to be removed from the other `@readable` or `@writable` list.
2021-08-26 21:49:12 +12:00
Jeremy Evans
14a9c364f7 Fix warnings in test_optimization.rb
These were introduced in the test for tracing optimized methods
added in 48c8df9e0e.
2021-08-24 08:34:48 -07:00
Nobuyoshi Nakada
bcc5a2b67e [ruby/fiddle] Simplify libc and libm path logics (https://github.com/ruby/fiddle/pull/91)
* Simplify libc_so and libm_so

If nil, no need to set to nil.

* Get rid of repeating inversions

4323e689d8
2021-08-24 16:18:24 +09:00
Aaron Patterson
0f1e8f38c9 [ruby/fiddle] Improve "offsetof" calculations (https://github.com/ruby/fiddle/pull/90)
I need to get the offset of members inside sub structures.  This patch
adds sub-structure offset support for structs.

cf78eddbb6
2021-08-24 16:18:22 +09:00
Lars Kanis
6594623f62 Fix Marshal.dump(closed_io) to raise TypeError and allow encoding on closed IO
Mashalling a closed IO object raised "closed stream (IOError)" before instead of TypeError.
This changes IO#(in|ex)ternal_encoding to still return the encoding even if the underlying FD is closed.

Fixes bug #18077
2021-08-22 10:33:22 +09:00
Jeremy Evans
48c8df9e0e
Allow tracing of optimized methods
This updates the trace instructions to directly dispatch to
opt_send_without_block.  So this should cause no slowdown in
non-trace mode.

To enable the tracing of the optimized methods, RUBY_EVENT_C_CALL
and RUBY_EVENT_C_RETURN are added as events to the specialized
instructions.

Fixes [Bug #14870]

Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2021-08-21 10:15:01 -07:00
Yusuke Endoh
5e9598baea [ruby/error_highlight] Fixed the argument for DidYouMean.formatter=
Looks like this bug was hidden by did_you_mean's rescuing any
exceptions.

7a8f0b4796
2021-08-20 16:27:07 +09:00
Yusuke Endoh
cad83fa3c4 ast.c: Rename "save_script_lines" to "keep_script_lines"
... as per ko1's preference. He is preparing to extend this feature to
ISeq for his new debugger. He prefers "keep" to "save" for this wording.
This API is internal and not included in any released version, so I
change it in advance.
2021-08-20 16:18:36 +09:00
Shugo Maeda
754adbee91
Module#ancestors should not return superclasses of refinements
[ruby-core:86949] [Bug #14744]

Reported by Eregon (Benoit Daloze).  Thanks!
2021-08-20 10:42:01 +09:00
Nobuyoshi Nakada
6963f8f743
Remove old warning aged nearly 8 years 2021-08-19 17:44:48 +09:00
Kazuki Tsujimoto
ecb6d6a4ef
Allow omission of parentheses in one line pattern matching [Feature #16182] 2021-08-19 17:07:58 +09:00
Martin Dürst
fd7f61cf21 Take into account data in emoji-variation-sequences.txt in tests.
The emoji data in emoji-variation-sequences.txt was not used for
in test/ruby/enc/test_emoji_breaks.rb, for unknown reasons.
It turned out that the format of each of the emoji data/test files
is slightly different, and that we didn't take into account that
empty fields after a semicolon, as present in
emoji-variation-sequences.txt, led to less fields than expected
when using split.
This addresses issue #18027.
2021-08-17 16:03:52 +09:00
Nobuyoshi Nakada
2aa6826e81 Extract the wrapped value when yydebug [Bug #18075] 2021-08-15 11:40:06 +09:00
Kazuki Tsujimoto
4568ba0711
Show verbose error messages when single pattern match fails
[0] => [0, *, a]
    #=> [0] length mismatch (given 1, expected 2+) (NoMatchingPatternError)

Ignore test failures of typeprof caused by this change for now.
2021-08-15 09:38:24 +09:00
aycabta
9f88135f78 [ruby/readline-ext] Give up Editline
d924cfc1e6
2021-08-14 22:13:56 +09:00
aycabta
2c056816c4 [ruby/reline] Add workspace member for the latest IRB's implementation
8b55fc8fee
2021-08-14 22:13:31 +09:00
aycabta
a2f649374d [ruby/reline] Remove private visibility
fa54e521da
2021-08-14 22:13:31 +09:00
Takashi Kokubun
ac4d53bd46
Don't cancel JIT-ed code on TracePoint :class
events get enabled
2021-08-12 23:26:44 -07:00
Takashi Kokubun
b3f8c491ef
Print JIT cancel when all JIT-ed code is cancelled 2021-08-12 23:11:38 -07:00
aycabta
5196b171d9 Revert "Try to run test_interrupt_in_other_thread with Editline"
This reverts commit c66b27efbb.
2021-08-12 19:47:41 +09:00
aycabta
c66b27efbb Try to run test_interrupt_in_other_thread with Editline 2021-08-12 15:35:05 +09:00
aycabta
e5f6cd7045 Outer block is required to rescue Timeout::Error 2021-08-12 07:52:39 +09:00
aycabta
c06b39d1d1 Add TODO comment to #test_interrupt_in_other_thread 2021-08-11 17:45:31 +09:00
aycabta
c59da370a5 Add comments about testing steps 2021-08-11 14:08:45 +09:00
aycabta
4f324514aa Put the result of the process into a variable once
To make the meaning of assertion easier to understand,
2021-08-11 14:08:45 +09:00
aycabta
01e49af81d Stop exiting to show "SUCCESS" 2021-08-11 14:08:45 +09:00
aycabta
2217b82af1 Add logging about Errno::EPIPE 2021-08-11 14:08:45 +09:00
aycabta
7d84251500 Write log to stdout immediately 2021-08-11 14:08:45 +09:00
aycabta
67e06102a3 Stop checking char from "read"
Because it's sometimes nil due to race condition.
2021-08-11 14:08:45 +09:00
aycabta
7b10f55354 Break immediately if assertions finished 2021-08-11 14:08:45 +09:00