Commit graph

16692 commits

Author SHA1 Message Date
Takashi Kokubun
4445b9e2a2 Remove unused methods from JITSupport 2023-03-11 20:56:29 -08:00
Takashi Kokubun
195e32977f Skip test_udp_server on s390x RHEL 7.1
It seems like it never succeeds on this CI.
2023-03-11 20:51:49 -08:00
Hiroshi SHIBATA
f7b215af0e [rubygems/rubygems] Added another case of extconf.rb
3d0fa3dee8
2023-03-11 04:44:44 +00:00
Hiroshi SHIBATA
9801ad47bd [rubygems/rubygems] Added test for
https://github.com/rubygems/rubygems/pull/6444

7d6ece5c92
2023-03-11 04:44:44 +00:00
Takashi Kokubun
93e34fe42e RJIT: Write initial tests for Assembler 2023-03-10 14:57:37 -08:00
Takashi Kokubun
76808b1ee4 RJIT: Start testing Assembler 2023-03-10 13:57:52 -08:00
Takashi Kokubun
ac5f983f7d
RJIT: Break up and enable test_version (#7495) 2023-03-10 10:07:52 -08:00
Aaron Patterson
365fed6369
Revert "Allow classes and modules to become too complex"
This reverts commit 69465df424.
2023-03-10 08:50:43 -08:00
Hiroshi SHIBATA
5e27d82dd0 [rubygems/rubygems] rubocop -a test/rubygems/test_gem.rb
4d20ed7e32
2023-03-10 05:16:52 +00:00
Hiroshi SHIBATA
f1c9f89ff8 [rubygems/rubygems] Disable side-effect of GEM_HOME configuration
c43328ab03
2023-03-10 05:16:52 +00:00
Hiroshi SHIBATA
15739c66b7 [rubygems/rubygems] Added only missing extensions option into pristine command
cfd0e615d7
2023-03-10 03:51:16 +00:00
Nobuyoshi Nakada
a7bc000eaa
Revert and refine tests for uninitialized queue
`Queue` and `SizedQueue` still check array members.  Only the test of
`ConditionVariable` is useless.
2023-03-10 12:03:31 +09:00
Nobuyoshi Nakada
0a466e3072
Remove stale tests
These tests were added at a198bb3929,
when these classes were `Struct`s.  Since these classes have been
rewritten, these tests no longer make sense.
2023-03-10 11:54:59 +09:00
HParker
69465df424 Allow classes and modules to become too complex
This makes the behavior of classes and modules when there are too many instance variables match the behavior of objects with too many instance variables.
2023-03-09 15:34:49 -08:00
KJ Tsanaktsidis
7bd7aee02e Fix interpreter crash caused by RUBY_INTERNAL_EVENT_NEWOBJ + Ractors
When a Ractor is created whilst a tracepoint for
RUBY_INTERNAL_EVENT_NEWOBJ is active, the interpreter crashes. This is
because during the early setup of the Ractor, the stdio objects are
created, which allocates Ruby objects, which fires the tracepoint.
However, the tracepoint machinery tries to dereference the control frame
(ec->cfp->pc), which isn't set up yet and so crashes with a null pointer
dereference.

Fix this by not firing GC tracepoints if cfp isn't yet set up.
2023-03-09 09:46:14 +01:00
Nobuyoshi Nakada
cf08a85b85 [rubygems/rubygems] Ensure that TempIO is closed
dc7b9db514
2023-03-09 06:19:56 +00:00
lukeg
2ecdefab7d Make sure TestDefaultGems#test_validate_gemspec runs even when Dir.pwd != srcdir
For instance, when running tests in build directory like:

$ make test-all TESTOPTS="../ruby/test"
2023-03-09 13:18:07 +09:00
Samuel Williams
1658e7d966
Remove SIGCHLD waidpid. (#7476)
* Remove `waitpid_lock` and related code.

* Remove un-necessary test.

* Remove `rb_thread_sleep_interruptible` dead code.
2023-03-09 16:05:47 +13:00
Peter Zhu
e1bd45624c Fix crash when allocating classes with newobj hook
We need to zero out the whole slot when running the newobj hook for a
newly allocated class because the slot could be filled with garbage,
which would cause a crash if a GC runs inside of the newobj hook.

For example, the following script crashes:

```
require "objspace"

GC.stress = true

ObjectSpace.trace_object_allocations {
  100.times do
    Class.new
  end
}
```

[Bug #19482]
2023-03-08 08:47:18 -05:00
Martin Emde
85a1738ab3 [rubygems/rubygems] Add TarReader::Entry#seek to seek within the tar file entry
TarReader#each previously implemented a partial version of seek.
This code moved to Entry#seek for use from TarReader#each.

Entry#close now returns nil instead of true, like IO#close.

Closing an Entry now seeks to the end of the Entry, seeking past
any remaining zero byte tar file padding and moving the io to the
correcty position to read the next file in the archive.

Uses seek for Entry#rewind and #pos=, fixing the tar->gzip->tar nested
rewind that would break previous to this change.

Add Entry.open that behaves more like File.open.

f5149565d5
2023-03-07 20:21:43 +00:00
Josef Šimánek
dc33d32f12
Use proper memoized var name for Gem.state_home. 2023-03-07 16:52:28 +09:00
David Rodríguez
5d790264ea [rubygems/rubygems] Remove hardcoded master branch references
Let RubyGems use the default branch defined by each repo.

54bd3e9ebd
2023-03-07 16:51:35 +09:00
David Rodríguez
bd0f2c7958 [rubygems/rubygems] Let git source use default cloned repo branch
d8af770379
2023-03-07 16:51:34 +09:00
Takashi Kokubun
23ec248e48 s/mjit/rjit/ 2023-03-06 23:44:01 -08:00
Takashi Kokubun
2e875549a9 s/MJIT/RJIT/ 2023-03-06 23:44:01 -08:00
Samuel Williams
7abe47b85a
Improve robustness of io_wait implementation. (#7456)
- Restore correct handling of `duration`.
- Don't delete from `@readable` or `@writable` unless it was added.
- A little more documentation.
2023-03-07 19:38:58 +13:00
Takashi Kokubun
f68580890f Stop building mjit_build_dir.so 2023-03-06 22:14:44 -08:00
Takashi Kokubun
a1ad5a2165 Omit test_version for Cirrus for now 2023-03-05 23:28:59 -08:00
Takashi Kokubun
91f1dc532c Remove an obsoleted test 2023-03-05 23:28:59 -08:00
Takashi Kokubun
5ab8cf3f0d Skip a failing shape test 2023-03-05 22:11:20 -08:00
Takashi Kokubun
40ffc1e0f4 Drop existing MJIT tests 2023-03-05 22:11:20 -08:00
tomoya ishida
0463c5806a [ruby/irb] Improve method completion for string and regexp that
includes word break characters
(https://github.com/ruby/irb/pull/523)

* Improve method completion for string and regexp that includes word break characters

* Remove completion-test's assert_not_include because candidates no longer include every possible methods

* Add comment about string's method completion regexp

Co-authored-by: Stan Lo <stan001212@gmail.com>

* Add comment about regexp's method completion regexp

Co-authored-by: Stan Lo <stan001212@gmail.com>

---------

aa8128c533

Co-authored-by: Stan Lo <stan001212@gmail.com>
2023-03-06 05:52:46 +00:00
Hiroshi SHIBATA
bab809d98f [rubygems/rubygems] Introduce Gem::Specification.find_by_full_name for finding conbination of name and version for gemspec
0430551215
2023-03-05 23:52:28 +00:00
Stan Lo
191e4ae33f [ruby/irb] Drop chained methods' completion support
(https://github.com/ruby/irb/pull/529)

Consider completion for this example: `foo.bar.b`

Without type information, it is hard to know the return value of the `bar`
method, so the current implementation interates through `ObjectSpace` to
get all possible candidates for the second method.

In small projects, the performance and accuracy are acceptable. But in
bigger projects, the performance is unacceptable and the accuracy is mostly
poor.

So this commit drops the support for chained methods' completion.
2023-03-04 15:34:49 +00:00
tomoya ishida
6f81e38d1d [ruby/reline] Fix completion with multiline
(https://github.com/ruby/reline/pull/513)

d76c482c5f
2023-03-04 05:56:00 +00:00
Kevin Menard
8e13e705f9 [ruby/irb] Remove no longer necessary TruffleRuby test exclusions.
(https://github.com/ruby/irb/pull/527)

8473d0bc0f

Co-authored-by: Stan Lo <stan.lo@shopify.com>
2023-03-03 15:25:29 +00:00
tomoya ishida
b49053a6be [ruby/irb] Avoid slow symbol completion when completion target is an
empty symbol
(https://github.com/ruby/irb/pull/534)

35697f3ef3
2023-03-03 13:41:21 +00:00
tomoya ishida
a2b776a9b7 [ruby/irb] Fix prompt test not to change STDIO.external_encoding
(https://github.com/ruby/irb/pull/535)

09f16259db
2023-03-03 10:18:51 +00:00
Nobuyoshi Nakada
680bd9027f [Bug #19471] Regexp.compile should handle keyword arguments
As well as `Regexp.new`, it should pass keyword arguments to the
`Regexp#initialize` method.
2023-03-03 15:27:37 +09:00
David Rodríguez
90b74d8c65 [rubygems/rubygems] Fix warning about ambiguous /
```
/path/to/rubygems/test/rubygems/test_gem_commands_exec_command.rb:745: warning: ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `/' operator
```

e6a538b5c8
2023-03-03 13:43:59 +09:00
David Rodríguez
7fea848568 [rubygems/rubygems] Fix warnings about unused variable
```
/path/to/rubygems/test/rubygems/test_gem_commands_exec_command.rb:180: warning: assigned but unused variable - platforms
```

7e022cb5e3
2023-03-03 13:43:59 +09:00
David Rodríguez
b6d914c722 [rubygems/rubygems] Fix warning about ambiguous *
```
/path/to/rubygems/test/rubygems/test_gem_commands_exec_command.rb:42: warning: `*' interpreted as argument prefix
```

0806ebf4e0
2023-03-03 13:43:58 +09:00
Nobuyoshi Nakada
bd17bea6c5 [ruby/irb] Fix warnings because of @context.main.delete
If the main object of the context has `#delete` method, the following
warning is printed.

```
irb: warn: can't alias delete from irb_delete.
```

00b39be61f
2023-03-03 02:44:35 +00:00
David Rodríguez
4467084098 [rubygems/rubygems] Enable Layout/DefEndAlignment
4403613fae
2023-03-02 21:13:12 +00:00
tomoya ishida
556439613a [ruby/irb] Handle long inspect and control character in prompt
string
(https://github.com/ruby/irb/pull/528)

* Handle long inspect and control characters in prompt string

* Add constants for prompt truncate length, omission and replace pattern

* Simply compare string instead of regexp in prompt truncation test
2023-03-02 13:53:44 +00:00
Jeremy Evans
04cfb26bd3 Remove support for the Regexp.new 3rd argument
This was deprecated in Ruby 3.2.

Fixes [Bug #18797]
2023-03-01 23:42:47 -08:00
Stan Lo
9ddd73060b [ruby/irb] Display and prioritise instance methods in `ls
<module/class>`
(https://github.com/ruby/irb/pull/496)

e3d21f9329
2023-02-28 14:36:12 +00:00
lukeg
d2c38aa823 A file was missing in test/excludes for TestArraySubclass 2023-02-28 11:04:32 +09:00
lukeg
ba55706fb6 fix test/rubygems/test_gem_package_task.rb when in -j mode
This test skipped sometimes due to failure to load 'rake/packagetask'.
This is due to manipulation of $LOAD_PATH by other rubygems tests. If
rake is loaded before any rubygems tests run, then it works fine.

To reproduce the skipping behavior:
  $ make test-all TESTOPTS="-j6 --test-order=sorted test/rubygems/test_*.rb"
2023-02-28 06:34:27 +09:00
Alan Wu
0eb634ae73 YJIT: Detect and reject send(:alias_for_send, :foo)
Previously, YJIT failed to put the stack into the correct shape when
`BasicObject#send` calls an alias method for the send method itself.
This can manifest as strange `NoMethodError`s in the final non-send
receiver, as [seen][1] with the kt-paperclip gem. I also found a case
where it makes YJIT fail the stack size assertion while compiling
`leave`.

YJIT's `BasicObject#__send__` implementation already rejects sends to
`send`, but didn't detect sends to aliases of `send`. Adjust the
detection and reject these cases.

Fixes [Bug #19464]

[1]: https://github.com/Shopify/yjit/issues/306
2023-02-27 11:12:22 -05:00