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

16896 Коммитов

Автор SHA1 Сообщение Дата
Hiroshi SHIBATA cbeea5f3e6 [rubygems/rubygems] Unify java_platform? to Gem.java_platform?
https://github.com/rubygems/rubygems/commit/7f27ab32b8
2023-04-05 05:49:24 +00:00
Hiroshi SHIBATA bf8afe434f [rubygems/rubygems] Removed self.mingw_windows?, It's not used rubygems
https://github.com/rubygems/rubygems/commit/ba3c985701
2023-04-05 05:49:24 +00:00
lukeg 28d6c6d69b [rubygems/rubygems] add some test suites under the Gem namespace, so as not to collide
To avoid collisions especially in ruby/ruby

https://github.com/rubygems/rubygems/commit/e6b2359975
2023-04-05 14:38:20 +09:00
Étienne Barrié 52ff2ce9da
Use `em_delete` in `key_delete` (#504)
* Test existing behavior

Typing Ctrl-D ends editing but typing <Del> does not.

Also renamed a test that is not testing ed_delete_next_char but
key_delete.

* Check if line empty first in em_delete

By distributivity of AND over OR, we can factor out this condition. This
will make the next commit simpler.

* Use em_delete in key_delete

When the editing mode is emacs, use `em_delete` in `key_delete`. We need
to add a condition though to `em_delete`, because it implements both
`delete-char` and `end-of-file`. We only want the `end-of-file` behavior
is the key is really Ctrl-D.

This matches the behavior of the <Del> key with readline, i.e. deleting
the next character if there is one, but not moving the cursor, while not
finishing the editing if there are no characters.
2023-04-05 08:59:12 +09:00
Peter Zhu 1da2e7fca3
[Feature #19579] Remove !USE_RVARGC code (#7655)
Remove !USE_RVARGC code

[Feature #19579]

The Variable Width Allocation feature was turned on by default in Ruby
3.2. Since then, we haven't received bug reports or backports to the
non-Variable Width Allocation code paths, so we assume that nobody is
using it. We also don't plan on maintaining the non-Variable Width
Allocation code, so we are going to remove it.
2023-04-04 17:30:06 -04:00
Aaron Patterson 8525603c72
Revert "Fix transient heap mode"
This reverts commit 87253d047c.

Revert "Implement `Process.warmup`"

This reverts commit ba6ccd8714.
2023-04-04 12:59:14 -07:00
Jean Boussier ba6ccd8714 Implement `Process.warmup`
[Feature #18885]

For now, the optimizations performed are:

  - Run a major GC
  - Compact the heap
  - Promote all surviving objects to oldgen

Other optimizations may follow.
2023-04-04 19:49:08 +02:00
Peter Zhu a84c99468f Fix crash in Time on 32-bit systems
[Bug #19575]

struct vtm is packed causing it to have a size that is not aligned on
32-bit systems. When allocating it on the stack, it will have unaligned
addresses which means that the fields won't be marked by the GC when
scanning the stack (since the GC only marks aligned addresses). This can
cause crashes when the fields are heap allocated objects like Bignums.

This commit moves the flags in struct time_object into struct vtm for
space efficiency and removes the need for packing.

This is an example of a crash:

    ruby(rb_print_backtrace+0xd) [0x56848945] ../src/vm_dump.c:785
    ruby(rb_vm_bugreport) ../src/vm_dump.c:1101
    ruby(rb_assert_failure+0x7a) [0x56671857] ../src/error.c:878
    ruby(vm_search_cc+0x0) [0x56666e47] ../src/vm_method.c:1366
    ruby(rb_vm_search_method_slowpath) ../src/vm_insnhelper.c:2090
    ruby(callable_method_entry+0x5) [0x568232d3] ../src/vm_method.c:1406
    ruby(rb_callable_method_entry) ../src/vm_method.c:1413
    ruby(gccct_method_search_slowpath) ../src/vm_eval.c:427
    ruby(gccct_method_search+0x20f) [0x568237ef] ../src/vm_eval.c:476
    ruby(opt_equality_by_mid_slowpath+0x2c) [0x5682388c] ../src/vm_insnhelper.c:2338
    ruby(rb_equal+0x37) [0x566fe577] ../src/object.c:133
    ruby(rb_big_eq+0x34) [0x56876ee4] ../src/bignum.c:5554
    ruby(rb_int_equal+0x14) [0x566f3ed4] ../src/numeric.c:4640
    ruby(rb_int_equal) ../src/numeric.c:4634
    ruby(vm_call0_cfunc_with_frame+0x6d) [0x568303c2] ../src/vm_eval.c:148
    ruby(vm_call0_cfunc) ../src/vm_eval.c:162
    ruby(vm_call0_body) ../src/vm_eval.c:208
    ruby(rb_funcallv_scope+0xd1) [0x56833971] ../src/vm_eval.c:85
    ruby(RB_TEST+0x0) [0x567e8488] ../src/time.c:78
    ruby(eq) ../src/time.c:78
    ruby(small_vtm_sub) ../src/time.c:1523
    ruby(timelocalw+0x23b) [0x567f3e9b] ../src/time.c:1593
    ruby(time_s_alloc+0x0) [0x567f536b] ../src/time.c:3698
    ruby(time_new_timew) ../src/time.c:2694
    ruby(time_s_mktime) ../src/time.c:3698
2023-04-04 11:12:07 -04:00
Hiroshi SHIBATA 06da0d1456 [rubygems/rubygems] util/rubocop -A
https://github.com/rubygems/rubygems/commit/8c9ea5d180
2023-04-04 12:20:43 +00:00
Hiroshi SHIBATA a881b33818 [rubygems/rubygems] util/rubocop -A --only Performance/RegexpMatch
https://github.com/rubygems/rubygems/commit/52ae4452c2
2023-04-04 12:20:43 +00:00
Hiroshi SHIBATA a78e0ca968 [rubygems/rubygems] Don't copy and paste methods in helper methods
https://github.com/rubygems/rubygems/commit/b87ac64343
2023-04-04 12:13:13 +00:00
Hiroshi SHIBATA 822f01b36c [rubygems/rubygems] Disabled to test rustc with msys2 platform.
https://github.com/rubygems/rubygems/actions/runs/4598776839/jobs/8123290246

https://github.com/rubygems/rubygems/commit/5c3b0a112e
2023-04-04 06:08:04 +00:00
Takashi Kokubun ba4ff2552e Avoid failing test_enable on warnings
This fails on RubyCI due to RJIT warnings too often. It should be enough
to test RJIT feature in test_rjit_version. We only want warnings instead
of test failures when there are warnings, at least for this case.
2023-04-03 08:59:05 -07:00
Stan Lo cd94bcdc46 [ruby/irb] Don't check RUBY_ENGINE when deciding whether to accept kargs
Ruby implementations like JRuby and TruffleRuby already indicate their
compatibility target with RUBY_VERSION. We don't need to exclude
them from accepting keyword arguments as long as they target 2.7+.

https://github.com/ruby/irb/commit/bf20faa4e6

Co-authored-by: Kevin Menard <kevin@nirvdrum.com>
2023-04-02 15:34:28 +00:00
Kazuki Tsujimoto 4ac8d11724
`*` in an array pattern should not be parsed as nil in ripper
After 6c0925ba70, it was impossible
to distinguish between the presence or absence of `*`.

    # Before the commit
    Ripper.sexp('0 in []')[1][0][2][1]  #=> [:aryptn, nil, nil, nil, nil]
    Ripper.sexp('0 in [*]')[1][0][2][1] #=> [:aryptn, nil, nil, [:var_field, nil], nil]

    # After the commit
    Ripper.sexp('0 in []')[1][0][2][1]  #=> [:aryptn, nil, nil, nil, nil]
    Ripper.sexp('0 in [*]')[1][0][2][1] #=> [:aryptn, nil, nil, nil, nil]

This commit reverts it.
2023-04-01 16:35:24 +09:00
Stan Lo 23892d95f5 [ruby/irb] Drop unnecessary pends for truffleruby
https://github.com/ruby/irb/commit/2517039812
2023-03-31 22:02:58 +00:00
Nobuyoshi Nakada 5116e8bdf8 [ruby/rdoc] Read generated files in binary mode
So that fixes crash with "invalid byte sequence in US-ASCII" on
ci.rvm.jp and some RubyCIs.

https://github.com/ruby/rdoc/commit/4b416644f0
2023-03-31 01:14:34 +00:00
Samuel Williams 648870b5c5
Support `IO#pread` / `IO#pwrite` using fiber scheduler. (#7594)
* Skip test if non-blocking file IO is not supported.
2023-03-31 00:48:55 +13:00
Nobuyoshi Nakada 6f122965cf [Bug #19547] Add token for unescaped backslash
This token is exposed only when `RubyVM::AbstractSyntaxTree` with
`keep_tokens` option.
2023-03-30 19:47:36 +09:00
Nobuyoshi Nakada 623027bf0b [ruby/time] Test for quadratic backtracking on invalid time
https://hackerone.com/reports/1485501

https://github.com/ruby/time/commit/b30b7bc6e6
2023-03-30 10:44:37 +00:00
tomoya ishida e26908dc4b [ruby/reline] Improve OSC sequence regexp. OSC sequence can end with
ST(ESC\) and it should not to include \a and \e inside.
(https://github.com/ruby/reline/pull/527)

https://github.com/ruby/reline/commit/a88052adec
2023-03-29 06:54:08 +00:00
Hiroshi SHIBATA 8c8d068016 [ruby/win32ole] Skip test failure with mswin platform
https://github.com/ruby/win32ole/actions/runs/4507614838/jobs/7935550685?pr=18

https://github.com/ruby/win32ole/commit/39ae6c2bc7
2023-03-29 04:00:22 +00:00
Nobuyoshi Nakada f241a8de56
[ruby/uri] Increase rehearsals 2023-03-29 09:52:33 +09:00
Maxime Chevalier-Boisvert 39a34694a0
YJIT: Add `--yjit-pause` and `RubyVM::YJIT.resume` (#7609)
* YJIT: Add --yjit-pause and RubyVM::YJIT.resume

This allows booting YJIT in a suspended state. We chose to add a new
command line option as opposed to simply allowing YJIT.resume to work
without any command line option because it allows for combining with
YJIT tuning command line options. It also simpifies implementation.

Paired with Kokubun and Maxime.

* Update yjit.rb

Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>

---------

Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2023-03-28 15:21:19 -04:00
Stan Lo 1e9a218ade [ruby/reline] Expand the scanned array to later case statement more
straightforward
(https://github.com/ruby/reline/pull/526)

* Improve test coverage on Unicode.take_range

* Add test for Unicode.calculate_width

* Expand the scanned array to later case statement more straightforward
2023-03-28 12:49:49 +00:00
Peter Zhu 417b1a3644 Fix memory leak for iclass
[Bug #19550]

If !RCLASS_EXT_EMBEDDED (e.g. 32 bit systems) then the rb_classext_t is
allocated throug malloc so it must be freed.

The issue can be seen in the following script:

```
20.times do
  100_000.times do
    mod = Module.new
    Class.new do
      include mod
    end
  end

  # Output the Resident Set Size (memory usage, in KB) of the current Ruby process
  puts `ps -o rss= -p #{$$}`
end
```

Before this fix, the max RSS is 280MB, while after this change, it's
30MB.
2023-03-28 08:20:06 -04:00
Nobuyoshi Nakada 040fab3782 Ripper: Add keyword options to `assert_parse_files` 2023-03-28 17:14:34 +09:00
dependabot[bot] 2322b189b6 [rubygems/rubygems] Bump rb-sys
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.68 to 0.9.70.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.68...v0.9.70)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-28 15:25:46 +09:00
Hiroshi SHIBATA cd4b4ac737 [rubygems/rubygems] Use double-quotes instead of single-quotes in warnings
https://github.com/rubygems/rubygems/commit/c7f1cb9941
2023-03-28 15:25:45 +09:00
Nobuyoshi Nakada 9c687c65ee [ruby/uri] Test for quadratic backtracking on invalid URI
https://hackerone.com/reports/1444501

https://github.com/ruby/uri/commit/54abaa739b
2023-03-28 02:12:21 +00:00
tomoya ishida 8f569d41cb [ruby/reline] Fix cursor position overrun
(https://github.com/ruby/reline/pull/515)

* Fix cursor position overrun

* Remove unnecessary local variable

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

---------

https://github.com/ruby/reline/commit/d4ad9b96c8

Co-authored-by: Stan Lo <stan001212@gmail.com>
2023-03-27 13:57:16 +00:00
Hiroshi SHIBATA cc8a48a496
Revert an accidentally sync.
Revert "[ruby/open3] Removed to load jit_support.rb"

  This reverts commit 67feb782f9.
2023-03-27 12:28:11 +09:00
Hiroshi SHIBATA 67feb782f9 [ruby/open3] Removed to load jit_support.rb
It's removed at https://github.com/ruby/open3/commit/4445b9e2a2dd

https://github.com/ruby/open3/commit/41b180deab
2023-03-27 03:24:48 +00:00
Nobuyoshi Nakada ac458f6bc3
Historical timezones of Lisbon in tzdata are unstable 2023-03-26 23:10:50 +09:00
Kazuki Tsujimoto d51529244f
[Bug #19175] p_kw without a sub pattern should be `assignable' 2023-03-26 18:57:34 +09:00
Kazuki Tsujimoto 6c0925ba70
[Bug #19175] p_rest should be `assignable'
It should also check for duplicate names.
2023-03-26 18:56:21 +09:00
Takashi Kokubun 2f916812a9 Skip test_europe_lisbon on macOS
until we figure out why it's failing.
2023-03-25 23:23:11 -07:00
tomoya ishida 60ca800d4f [ruby/reline] Fix split_by_width to retain color sequences
(https://github.com/ruby/reline/pull/490)

* Fix split_by_width to retain color sequences

* Add OSC escape sequence testcase of Reline::Unicode.split_by_width
2023-03-25 15:01:35 +00:00
Samuel Williams 466aa8010f
Fix incorrect usage of `rb_fiber_scheduler_io_(p)(read|write)`. (#7593) 2023-03-25 18:36:27 +13:00
Kasumi Hanazuki 09295ea796
IO::Buffer#resize: Free internal buffer if new size is zero (#7569)
`#resize(0)` on an IO::Buffer with internal buffer allocated will
result in calling `realloc(data->base, 0)`. The behavior of `realloc`
with size = 0 is implementation-defined (glibc frees the object
and returns NULL, while BSDs return an inaccessible object). And
thus such usage is deprecated in standard C (upcoming C23 will make it
UB).

To avoid this problem, just `free`s the memory when the new size is zero.
2023-03-25 12:12:23 +13:00
Jeremy Evans 6c60006de5 Raise ArgumentError if IO.read is provided negative offset
Fixes [Bug #19380]
2023-03-24 12:29:00 -07:00
Jeremy Evans 836e9a192b Add Dir.for_fd
This returns a Dir instance for the given directory file descriptor.
If fdopendir is not supported, this raises NotImplementedError.

Implements [Feature #19347]
2023-03-24 11:18:57 -07:00
Jeremy Evans 3be65f63c7 Add Dir#chdir
This uses Dir.fchdir if supported, or Dir.chdir otherwise.

Implements [Feature #19347]
2023-03-24 11:18:57 -07:00
MSP-Greg 7149f5763e [rubygems/rubygems] remove test skips/pends on mswin platform
https://github.com/rubygems/rubygems/commit/1d52eff8bf
2023-03-24 13:00:53 +00:00
Nobuyoshi Nakada 2759cf46f2 Write keyword arguments directly
`assert_normal_exit` uses keyword arguments since 2013, commit
05dd6b194c.
2023-03-24 15:41:37 +09:00
Takashi Kokubun b4e438d8aa
YJIT: Save PC on rb_str_concat (#7586)
[Bug #19483]

Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
2023-03-23 13:42:49 -07:00
Mau Magnaguagno 069640d355 Avoid intermediate array in TarHeader#calculate_checksum
String#sum(0) sums the character bytes without a modulo.
Follow-up of #6476 based on comment from @nobu.
2023-03-23 17:18:49 +09:00
Hiroshi SHIBATA 6ad6ae680a Skip test_gem_with_platform_and_platform_dependencies only ruby/ruby repository 2023-03-23 17:18:49 +09:00
Hiroshi SHIBATA f24a86d83f util/rubocop -A --only Layout/EmptyLineAfterMagicComment 2023-03-23 17:18:49 +09:00
Hiroshi SHIBATA 4dd418f877 util/rubocop -A --only Style/FrozenStringLiteralComment 2023-03-23 17:18:49 +09:00
Hiroshi SHIBATA 2e3cd1dc3e [rubygems/rubygems] Enabled Style/RedundantReturn cop
https://github.com/rubygems/rubygems/commit/05cc97bdf8
2023-03-23 17:18:49 +09:00
Hiroshi SHIBATA 19e9c4004b [rubygems/rubygems] util/rubocop -A --only Lint/BinaryOperatorWithIdenticalOperands
Many of class of RubyGems have original <=> methods. We should ignore
  these cops for testing.

https://github.com/rubygems/rubygems/commit/0a8645dc3b
2023-03-23 17:18:49 +09:00
Hiroshi SHIBATA 8a364b8512 [rubygems/rubygems] util/rubocop -A --only Style/MultilineTernaryOperator
https://github.com/rubygems/rubygems/commit/be853dfe3b
2023-03-23 17:18:49 +09:00
Hiroshi SHIBATA 01be518eba [rubygems/rubygems] util/rubocop -A --only Lint/UnderscorePrefixedVariableName
https://github.com/rubygems/rubygems/commit/6dc4bc3a5b
2023-03-23 17:18:49 +09:00
Hiroshi SHIBATA 1a60012612 [rubygems/rubygems] util/rubocop -A --only Lint/RescueException
https://github.com/rubygems/rubygems/commit/e8a5db50af
2023-03-23 17:18:49 +09:00
Nobuyoshi Nakada 348412c7fa [rubygems/rubygems] Use indented heredoc
https://github.com/rubygems/rubygems/commit/085d2776d8
2023-03-22 21:21:08 +00:00
Aaron Patterson 7c307e0379 Lazily allocate id tables for children
This patch lazily allocates id tables for shape children.  If a shape
has only one single child, it tags the child with a bit.  When we read
children, if the id table has the bit set, we know it's a single child.
If we need to add more children, then we create a new table and evacuate
the child to the new table.

Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
2023-03-22 12:50:42 -07:00
Hiroshi SHIBATA aa5d195712 [rubygems/rubygems] @orig_RUBY_ENGINE is always provided now
https://github.com/rubygems/rubygems/commit/c5e8ad4823
2023-03-22 11:17:26 +00:00
Hiroshi SHIBATA 1697869500 [rubygems/rubygems] Fix test failure with missing RUBY_REVISION constants
https://github.com/rubygems/rubygems/commit/c5b80945c6
2023-03-22 11:17:26 +00:00
Hiroshi SHIBATA 3725850297 [rubygems/rubygems] ditto: RUBY_ENGINE_VERSION
https://github.com/rubygems/rubygems/commit/dc82ebeac6
2023-03-22 11:17:25 +00:00
Hiroshi SHIBATA 3dc4bc313f [rubygems/rubygems] RUBY_REVISION is also provided by supported platforms
https://github.com/rubygems/rubygems/commit/71a237aeec
2023-03-22 11:17:25 +00:00
Hiroshi SHIBATA ea1dcb3e23 [rubygems/rubygems] RUBY_DESCRIPTION is always provided by supported platforms
https://github.com/rubygems/rubygems/commit/8a7028bc7e
2023-03-22 11:17:24 +00:00
Hiroshi SHIBATA 92f78b0e0b [rubygems/rubygems] Fixup
https://github.com/rubygems/rubygems/pull/6486

https://github.com/rubygems/rubygems/commit/ad50221acf
2023-03-22 11:17:24 +00:00
Hiroshi SHIBATA 8c00b130a4
Fixup 43d20596b8 2023-03-22 18:07:40 +09:00
Hiroshi SHIBATA 43d20596b8
Relax timeout limit for FreeBSD
* http://rubyci.s3.amazonaws.com/freebsd12/ruby-master/log/20230322T063002Z.fail.html.gz
  * http://rubyci.s3.amazonaws.com/freebsd13/ruby-master/log/20230322T063002Z.fail.html.gz
2023-03-22 16:32:23 +09:00
dependabot[bot] 65a725633b [rubygems/rubygems] Bump rb-sys
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.67 to 0.9.68.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.67...v0.9.68)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-22 03:25:47 +00:00
Alan Wu 08eaf7c5fa
YJIT: Fix deadlock in tests due to pipe capacity
Previously, when there is enough stats that the child process fills up
the pipe capacity, the child process would block, with the parent
process waiting forever as no one is reading to clear up the pipe. The
test timed out in these situations.

Use a separate thread in the parent to read from the pipe to unblock the
child in these situation. EnvUtil also does this for handling stdout and
stderr.

I had the test suite deadlock on a Linux VM.
2023-03-21 18:16:33 -04:00
Phillip Hellewell f67f0d7268 [ruby/reline] Add key bindings for PgUp and PgDn
(https://github.com/ruby/reline/pull/509)

* Add key bindings for PgUp, PgDn

* Match behavior of readline 8.2

In the latest readline (8.2), page-up and page-down are bound to
history-search-backward and history-search-forward by default.

We would like reline to have the same default behavior.
2023-03-21 14:48:32 +00:00
Nobuyoshi Nakada 9b85ff01a1
Use indented heredoc 2023-03-21 22:59:09 +09:00
Aaron Patterson 54dbd8bea8 Use an st table for "too complex" objects
st tables will maintain insertion order so we can marshal dump / load
objects with instance variables in the same order they were set on that
particular instance

[ruby-core:112926] [Bug #19535]

Co-Authored-By: Jemma Issroff <jemmaissroff@gmail.com>
2023-03-20 13:54:18 -07:00
Jean Boussier 1db8951d3a Cache `Process.pid`
[Feature #19443]

It's not uncommon for database client and similar network libraries
to protect themselves from Process.fork by regularly checking Process.pid

Until recently most libc would cache `getpid()` so this was a cheap
check to make.

However as of glibc version 2.25 the PID cache is removed and calls to
`getpid()` always invoke the actual system call which significantly degrades
the performance of existing applications.

The reason glibc removed the cache is that some libraries were bypassing
`fork(2)` by issuing system calls themselves, causing stale cache issues.

That isn't a concern for Ruby as bypassing MRI's primitive for forking
would render the VM unusable, so we can safely cache the PID.
2023-03-20 08:21:23 +00:00
Takashi Kokubun 2f29044de4 RJIT: Optimize Kernel#block_given? 2023-03-19 14:15:45 -07:00
Takashi Kokubun 2121282753 RJIT: Optimize String#<< 2023-03-19 13:25:41 -07:00
Nobuyoshi Nakada 67dd52d59c
[Bug #19539] Match heredoc identifier from end of line
Not to ignore leading spaces in indented heredoc identifier.
2023-03-19 01:35:21 +09:00
tomoya ishida e8e7ff1333 [ruby/reline] Fix: line longer than terminal width breaks rendering
(https://github.com/ruby/reline/pull/516)

https://github.com/ruby/reline/commit/ae5f9b87ab
2023-03-18 14:37:10 +00:00
Peter Zhu cb22d78354 Fix frozen status loss when moving objects
[Bug #19536]

When objects are moved between size pools, their frozen status is lost
in the shape. This will cause the frozen check to be bypassed when there
is an inline cache. For example, the following script should raise a
FrozenError, but doesn't on Ruby 3.2 and master.

    class A
      def add_ivars
        @a = @b = @c = @d = 1
      end

      def set_a
        @a = 10
      end
    end

    a = A.new
    a.add_ivars
    a.freeze

    b = A.new
    b.add_ivars
    b.set_a # Set the inline cache in set_a

    GC.verify_compaction_references(expand_heap: true, toward: :empty)

    a.set_a
2023-03-18 09:07:05 -04:00
Josef Haider 2c8f2871a8
Fix handling of 6-byte codepoints in left_adjust_char_head in CESU-8 encoding 2023-03-18 15:43:54 +09:00
Jean Boussier 3592b24cdc ObjectSpace::WeakMap: clean inverse reference when an entry is re-assigned
[Bug #19531]

```ruby
wmap[1] = "A"
wmap[1] = "B"
```

In the example above, we need to remove the `"A" => 1` inverse reference
so that when `"A"` is GCed the `1` key isn't deleted.
2023-03-17 17:50:08 +00:00
Nobuyoshi Nakada ccd2dbc4c1 core_assertions.rb: Relax `assert_linear_performance`
* Use an `Enumerable` as factors, instead of three arguments.

* Include `assert_operator` time in rehearsal time.

* Round up max expected time.
2023-03-18 02:41:02 +09:00
lukeg 418cf344fb [ruby/irb] Fix 2 minor issues in test suite
* undefine Kernel#irb_original_require in without_rdoc method
* Don't rescue all LoadErrors/NameErrors in test_rendering.rb, just
the one for require 'yamatanooroti'

https://github.com/ruby/irb/commit/52b79806ea
2023-03-17 15:19:40 +00:00
Hiroshi SHIBATA f8fe151ca9 util/rubocop -A --only Style/TernaryParentheses 2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 5211900d37 util/rubocop -A --only Style/SymbolProc 2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 0373615948 util/rubocop -A --only Layout/SpaceInsideArrayLiteralBrackets 2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 866831d8e9 [rubygems/rubygems] util/rubocop -A --only Style/Semicolon
https://github.com/rubygems/rubygems/commit/97f062be05
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA ab644ae497 [rubygems/rubygems] util/rubocop -A --only Style/CharacterLiteral
https://github.com/rubygems/rubygems/commit/aa058ff6b8
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 72d09a568f [rubygems/rubygems] util/rubocop -A --only Style/RedundantBegin
https://github.com/rubygems/rubygems/commit/b595d3cf0f
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA ee7475734f [rubygems/rubygems] util/rubocop -A --only Style/BarePercentLiterals
https://github.com/rubygems/rubygems/commit/02d8147243
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA f4b073ef7a [rubygems/rubygems] util/rubocop -A --only Style/UnlessElse
https://github.com/rubygems/rubygems/commit/184c03270c
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 4868cfcf1d [rubygems/rubygems] util/rubocop -A --only Style/IdenticalConditionalBranches
https://github.com/rubygems/rubygems/commit/64f437a428
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 6ad269dc39 [rubygems/rubygems] util/rubocop -A --only Style/RescueStandardError
https://github.com/rubygems/rubygems/commit/80b57da926
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 70164eec0f [rubygems/rubygems] util/rubocop -A --only Style/RescueModifier
https://github.com/rubygems/rubygems/commit/b490379eab
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 38664ede7e [rubygems/rubygems] util/rubocop -A --only Style/NonNilCheck
https://github.com/rubygems/rubygems/commit/2b056b25c3
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 4cd8a46f45 [rubygems/rubygems] util/rubocop -A --only Style/ParenthesesAroundCondition
https://github.com/rubygems/rubygems/commit/c766a65885
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 4ab23df2c4 [rubygems/rubygems] util/rubocop -A --only Style/RedundantParentheses
https://github.com/rubygems/rubygems/commit/295691d4dc
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA b8914a9d5d [rubygems/rubygems] util/rubocop -A --only Style/StabbyLambdaParentheses
https://github.com/rubygems/rubygems/commit/23ce9793e5
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA d8c5fa963f [rubygems/rubygems] util/rubocop -A --only Style/YodaCondition
https://github.com/rubygems/rubygems/commit/3594945391
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 66bd2c1a1c [rubygems/rubygems] util/rubocop -A --only Style/CommentAnnotation
https://github.com/rubygems/rubygems/commit/4e77a1d1d5
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 52ea7afa5f [rubygems/rubygems] util/rubocop -A --only Style/NegatedIf
https://github.com/rubygems/rubygems/commit/aa95ee27a2
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 9ab860f9af [rubygems/rubygems] util/rubocop -A --only Style/ColonMethodCall
https://github.com/rubygems/rubygems/commit/823113f39e
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA bd57322bfe [rubygems/rubygems] util/rubocop -A --only Style/DefWithParentheses
https://github.com/rubygems/rubygems/commit/91391ceedf
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 03b82d1865 [rubygems/rubygems] util/rubocop -A --only Style/SingleLineMethods
https://github.com/rubygems/rubygems/commit/fa2e835ed2
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA d2cebb4e31 [rubygems/rubygems] util/rubocop -A --only Style/NumericLiterals
https://github.com/rubygems/rubygems/commit/860669b08a
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 712d6e675b [rubygems/rubygems] util/rubocop -A --only Style/RedundantInterpolation
https://github.com/rubygems/rubygems/commit/add44e56eb
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 0b632b9cdd [rubygems/rubygems] util/rubocop -A --only Style/ClassCheck
https://github.com/rubygems/rubygems/commit/1c3356a872
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 567db6064b [rubygems/rubygems] util/rubocop -A --only Style/NestedParenthesizedCalls
https://github.com/rubygems/rubygems/commit/a875fdb535
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 3d4c3f9e4f [rubygems/rubygems] util/rubocop -A --only Style/ParallelAssignment
https://github.com/rubygems/rubygems/commit/5c88c77873
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 4bb5ce8188 [rubygems/rubygems] util/rubocop -A --only Style/StringLiteralsInInterpolation
https://github.com/rubygems/rubygems/commit/cb554f6eb7
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 83f9aa8f02 [rubygems/rubygems] util/rubocop -A --only Style/Alias
https://github.com/rubygems/rubygems/commit/fba6e94de9
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA ae81ff0c9b [rubygems/rubygems] util/rubocop -A --only Layout/MultilineBlockLayout
https://github.com/rubygems/rubygems/commit/9aa6101942
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 26d6604343 [rubygems/rubygems] util/rubocop -A --only Layout/MultilineMethodCallBraceLayout
https://github.com/rubygems/rubygems/commit/acb0548bf6
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 41f304d5bf [rubygems/rubygems] util/rubocop -A --only Layout/SpaceInsideStringInterpolation
https://github.com/rubygems/rubygems/commit/a06f8ae3bb
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 3233b1fe3f [rubygems/rubygems] util/rubocop -A --only Layout/SpaceInLambdaLiteral
https://github.com/rubygems/rubygems/commit/e76088b699
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA f8daae91c4 [rubygems/rubygems] util/rubocop -A --only Layout/SpaceBeforeSemicolon
https://github.com/rubygems/rubygems/commit/c92c6d8e85
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 4b285e5c6f [rubygems/rubygems] util/rubocop -A --only Layout/AssignmentIndentation
https://github.com/rubygems/rubygems/commit/8e64298989
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 9ffd73523d [rubygems/rubygems] util/rubocop -A --only Layout/EmptyLinesAroundExceptionHandlingKeywords
https://github.com/rubygems/rubygems/commit/ad1fe68d97
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 583fbc627c [rubygems/rubygems] util/rubocop -A --only Layout/EmptyLinesAroundModuleBody
https://github.com/rubygems/rubygems/commit/48c88466b7
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA c480a0c46a [rubygems/rubygems] util/rubocop -A --only Layout/LeadingCommentSpace
https://github.com/rubygems/rubygems/commit/4d680320e3
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA d9f92511ad [rubygems/rubygems] util/rubocop -A --only Layout/SpaceInsidePercentLiteralDelimiters
https://github.com/rubygems/rubygems/commit/c6de27fc6d
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 85fd33c526 [rubygems/rubygems] util/rubocop -A --only Layout/SpaceInsideArrayPercentLiteral
https://github.com/rubygems/rubygems/commit/75abd2e504
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA dab1d0ed20 [rubygems/rubygems] util/rubocop -A --only Layout/EmptyLineBetweenDefs
https://github.com/rubygems/rubygems/commit/00117e69cc
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 7c1d590a8a [rubygems/rubygems] util/rubocop -A --only Layout/SpaceBeforeComma
https://github.com/rubygems/rubygems/commit/4a5b70b508
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 23150e0274 [rubygems/rubygems] util/rubocop -A --only Layout/MultilineHashBraceLayout
https://github.com/rubygems/rubygems/commit/bf33d106d0
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 05208c3875 [rubygems/rubygems] util/rubocop -A --only Lint/UnusedBlockArgument
https://github.com/rubygems/rubygems/commit/d8efd919db
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 65752b61e7 [rubygems/rubygems] util/rubocop -A --only Performance/Count
https://github.com/rubygems/rubygems/commit/46d5d6d1d3
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 2dddac0475 [rubygems/rubygems] util/rubocop -a test/rubygems/helper.rb and styling
https://github.com/rubygems/rubygems/commit/fe331736d4
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA b09973a995 [rubygems/rubygems] Also removed condition of RUBY_PATCHLEVEL
https://github.com/rubygems/rubygems/commit/16f381be4b
2023-03-17 18:50:55 +09:00
David Rodríguez dd0f0a5e6e [rubygems/rubygems] Fix `gem uninstall` with `--install-dir`
https://github.com/rubygems/rubygems/commit/ac23687353
2023-03-17 18:50:55 +09:00
David Rodríguez 123bedd295 [rubygems/rubygems] Extract some common logic to a test helper
https://github.com/rubygems/rubygems/commit/ef4741b7cb
2023-03-17 18:50:55 +09:00
David Rodríguez 5733828734 [rubygems/rubygems] Fix `rake check_manifest` when `rake` is `--user-installed`'d
Otherwise we get

```
✗ rake TEST=test/rubygems/test_project_sanity.rb
Loaded suite /Users/deivid/.gem/ruby/3.2.0/gems/rake-13.0.6/lib/rake/rake_test_loader
Started
E
============================================================================================================================================================================================================
Error: test_manifest_is_up_to_date(TestProjectSanity):
  RuntimeError: There was an error running `rake check_manifest`: /Users/deivid/.asdf/installs/ruby/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems.rb:263:in `find_spec_for_exe': can't find gem rake (>= 0.a) with executable rake (Gem::GemNotFoundException)
  	from /Users/deivid/.asdf/installs/ruby/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems.rb:282:in `activate_bin_path'
  	from /Users/deivid/.asdf/installs/ruby/3.2.1/bin/rake:25:in `<main>'
/Users/deivid/Code/rubygems/rubygems/test/rubygems/test_project_sanity.rb:27:in `test_manifest_is_up_to_date'
     24:
     25:         raise "Expected Manifest.txt to be up to date, but it's not. Run `rake update_manifest` to sync it."
     26:       else
  => 27:         raise "There was an error running `rake check_manifest`: #{out}"
     28:       end
     29:     end
     30:   end
============================================================================================================================================================================================================
.
Finished in 0.188192 seconds.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2 tests, 1 assertions, 0 failures, 1 errors, 0 pendings, 0 omissions, 0 notifications
50% passed
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
10.63 tests/s, 5.31 assertions/s
rake aborted!
```

https://github.com/rubygems/rubygems/commit/29829933a6
2023-03-17 18:50:55 +09:00
David Rodríguez 37c2e903e8 [rubygems/rubygems] Show error when `rake check_manifest` fails for unknown reason
https://github.com/rubygems/rubygems/commit/98de85c11e
2023-03-17 18:50:55 +09:00
lukeg d2c6dca8f4 Fix small issues concerning namespacing in test-all suite
* Fix temporary methods on Object leaking across test cases.
* Remove temporary classes/modules leaking across test cases.
2023-03-17 08:46:37 +09:00
Takashi Kokubun a8e7fee801 Revert "core_assertions.rb: Refine `assert_linear_performance`"
This reverts commit cae4342dd5.

This is failing a lot of CIs and nobody is actively looking into fixing
it. Let me revert this until we have a solution to it.
2023-03-16 09:22:42 -07:00
Alan Wu 2f81bb793f Add thread and ractor counts to bug reports
This is useful for crash triaging. It also helps to hint extension
developers about the misuse of `rb_thread_call_without_gvl()`.

Example:

    $ ./miniruby -e 'Ractor.new{Ractor.receive};
        Thread.new{sleep}; Process.kill:SEGV,Process.pid'
    <snip>
    -- Threading information ---------------------------------------------------
    Total ractor count: 2
    Ruby thread count for this ractor: 2
2023-03-16 10:46:30 -04:00
Mau Magnaguagno 89f7acba3c [rubygems/rubygems] Improve TarTestCase#calc_checksum
https://github.com/rubygems/rubygems/commit/97add0d1d7
2023-03-16 12:55:01 +00:00
Nobuyoshi Nakada cae4342dd5
core_assertions.rb: Refine `assert_linear_performance`
* Use an `Enumerable` as factors, instead of three arguments.
2023-03-16 18:51:02 +09:00
Nobuyoshi Nakada 0b303c6830 [ruby/openssl] Relax error message check for OpenSSL 3.1
A tentative measures fo https://github.com/ruby/openssl/issues/606.

With OpenSSL 3.1.0, the error message at connection using "self-signed
certificate" seems to return `SSL_R_TLSV1_ALERT_UNKNOWN_CA` instead of
`SSL_R_CERTIFICATE_VERIFY_FAILED`.

https://github.com/ruby/openssl/commit/fc4629d246
2023-03-16 17:17:46 +09:00
Hiroshi SHIBATA a90302adec [rubygems/rubygems] Added OpenSSL namespace explicitly
https://github.com/rubygems/rubygems/commit/bf4382e7a7
2023-03-15 11:21:21 +00:00
Koichi Sasada 6462c1a042 `Hash#dup` for kwsplat arguments
On `f(*a, **kw)` method calls, a rest keyword parameter is identically
same Hash object is passed and it should make `#dup`ed Hahs.

fix https://bugs.ruby-lang.org/issues/19526
2023-03-15 18:05:13 +09:00
Samuel Williams 7fd53eeb46
Remove SIGCHLD `waidpid`. (#7527)
* Remove `waitpid_lock` and related code.

* Remove un-necessary test.

* Remove `rb_thread_sleep_interruptible` dead code.
2023-03-15 19:48:27 +13:00
Hiroshi SHIBATA 31137dc67f [rubygems/rubygems] Removed test for
https://github.com/rubygems/rubygems/pull/6444, I have no idea to
migrate this test to bundler example
yet

https://github.com/rubygems/rubygems/commit/0d869019bf
2023-03-15 03:35:54 +00:00
Peter Zhu 3dc8cde700 Fix crash during compaction
[Bug #19529]

The fix for [Bug #19529] in commit 548086b contained a bug that crashes
on the following script:

```
wm = ObjectSpace::WeakMap.new
obj = Object.new
100.times do
  wm[Object.new] = obj
  GC.start
end
GC.compact
```
2023-03-14 23:18:11 -04:00
Jean Boussier 548086b34e ObjectSpace::WeakMap: fix compaction support
[Bug #19529]

`rb_gc_update_tbl_refs` can't be used on `w->obj2wmap` because it's
not a `VALUE -> VALUE` table, but a `VALUE -> VALUE *` table, so
we need some dedicated iterator.
2023-03-14 16:49:23 +01:00
Samuel Williams ac65ce16e9
Revert SIGCHLD changes to diagnose CI failures. (#7517)
* Revert "Remove special handling of `SIGCHLD`. (#7482)"

This reverts commit 44a0711eab.

* Revert "Remove prototypes for functions that are no longer used. (#7497)"

This reverts commit 4dce12bead.

* Revert "Remove SIGCHLD `waidpid`. (#7476)"

This reverts commit 1658e7d966.

* Fix change to rjit variable name.
2023-03-14 20:07:59 +13:00
dependabot[bot] 5868a7843a [rubygems/rubygems] Bump rb-sys
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.65 to 0.9.67.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.65...v0.9.67)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-14 04:08:17 +00:00
Hiroshi SHIBATA c58759f494
Removed to load jit_support.rb
It's removed at 4445b9e2a2
2023-03-14 12:51:58 +09:00
Takashi Kokubun d8344559b2 RJIT: Simplify how Capstone is used in tests 2023-03-13 20:42:19 -07:00
Stan Lo 1095baed34 [ruby/irb] Support inspecting BasicObject
(https://github.com/ruby/irb/pull/541)

https://github.com/ruby/irb/commit/1dc2a406a3
2023-03-13 14:31:37 +00:00
TSUYUSATO Kitsune dddc542e9b
[Bug #19476]: correct cache index computation for repetition (#7457) 2023-03-13 18:31:13 +09:00
git 7686687a79 * remove trailing spaces. [ci skip] 2023-03-13 06:46:54 +00:00
TSUYUSATO Kitsune e22c4e8877
[Bug #19467] correct cache points and counting failure on `OP_ANYCHAR_STAR_PEEK_NEXT` (#7454) 2023-03-13 15:46:41 +09:00
Nobuyoshi Nakada 7ce4b716bd
Add test for linear performance 2023-03-12 18:50:39 +09:00
Takashi Kokubun 3efe4639ec RJIT: Handle Mod 10 for CMP r/m64, r64 2023-03-11 23:47:11 -08:00
Takashi Kokubun 9c220bf5e1 RJIT: Use lambda constants to match operands 2023-03-11 23:35:58 -08:00
Takashi Kokubun e4caf59cc1 Move yjit_force_enabled? to JITSupport
for consistency
2023-03-11 20:59:03 -08:00
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
https://github.com/rubygems/rubygems/commit/3d0fa3dee8
2023-03-11 04:44:44 +00:00
Hiroshi SHIBATA 9801ad47bd [rubygems/rubygems] Added test for
https://github.com/rubygems/rubygems/pull/6444

https://github.com/rubygems/rubygems/commit/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
https://github.com/rubygems/rubygems/commit/4d20ed7e32
2023-03-10 05:16:52 +00:00
Hiroshi SHIBATA f1c9f89ff8 [rubygems/rubygems] Disable side-effect of GEM_HOME configuration
https://github.com/rubygems/rubygems/commit/c43328ab03
2023-03-10 05:16:52 +00:00
Hiroshi SHIBATA 15739c66b7 [rubygems/rubygems] Added only missing extensions option into pristine command
https://github.com/rubygems/rubygems/commit/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
https://github.com/rubygems/rubygems/commit/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.

https://github.com/rubygems/rubygems/commit/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.

https://github.com/rubygems/rubygems/commit/54bd3e9ebd
2023-03-07 16:51:35 +09:00
David Rodríguez bd0f2c7958 [rubygems/rubygems] Let git source use default cloned repo branch
https://github.com/rubygems/rubygems/commit/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>

---------

https://github.com/ruby/irb/commit/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
https://github.com/rubygems/rubygems/commit/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)

https://github.com/ruby/reline/commit/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)

https://github.com/ruby/irb/commit/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)

https://github.com/ruby/irb/commit/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)

https://github.com/ruby/irb/commit/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
```

https://github.com/rubygems/rubygems/commit/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
```

https://github.com/rubygems/rubygems/commit/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
```

https://github.com/rubygems/rubygems/commit/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.
```

https://github.com/ruby/irb/commit/00b39be61f
2023-03-03 02:44:35 +00:00
David Rodríguez 4467084098 [rubygems/rubygems] Enable `Layout/DefEndAlignment`
https://github.com/rubygems/rubygems/commit/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