85665 Commits

Author SHA1 Message Date
Nobuyoshi Nakada
0bae2f0002
[Bug #20510] Do not count optional hash argument for IO.new
Since `IO.new` accepts one or two positional arguments except for the
optional hash argument, exclude the optional hash argument from the
check for delegation to `IO.new`.
2024-05-25 19:15:25 +09:00
Jacklyn Ma
4d0c5486a2 [rubygems/rubygems] update cache checksums to decrease string allocations
https://github.com/rubygems/rubygems/commit/85371a961a
2024-05-24 21:04:21 +00:00
Kevin Newton
c7281e2d67 [ruby/prism] Fix up ruby_parser string concat
https://github.com/ruby/prism/commit/4b06eae0df
2024-05-24 19:27:44 +00:00
Kevin Newton
9f71393fe4 [ruby/prism] Fix up self-write order for lex
https://github.com/ruby/prism/commit/8f6da451b4
2024-05-24 17:37:51 +00:00
Kevin Newton
f8b750370e [ruby/prism] Remove Debug module
https://github.com/ruby/prism/commit/4d8929ff6a
2024-05-24 17:19:38 +00:00
Kevin Newton
745a948b6d [ruby/prism] Remove dynamic Debug module methods
https://github.com/ruby/prism/commit/b850794db9
2024-05-24 17:19:36 +00:00
Kevin Newton
79001c8b4a [ruby/prism] Remove error formatting, put directly in CRuby
https://github.com/ruby/prism/commit/53b2866487
2024-05-24 17:19:36 +00:00
Kevin Newton
653652bcbe [ruby/prism] Remove Debug#named_captures
https://github.com/ruby/prism/commit/5050dfbe70
2024-05-24 17:19:35 +00:00
Kevin Newton
e1041a8eda [ruby/prism] Move profiling to prism module directly
https://github.com/ruby/prism/commit/75fabf7081
2024-05-24 17:19:35 +00:00
Kevin Newton
b04c959621 [ruby/prism] Remove various unused memsize infra
https://github.com/ruby/prism/commit/283938ed1f
2024-05-24 17:19:34 +00:00
Kevin Newton
b8681c2e37 [ruby/prism] Remove Debug::integer_parse
https://github.com/ruby/prism/commit/14e397598b
2024-05-24 17:19:33 +00:00
Kevin Newton
870350253e [ruby/prism] Remove Debug::static_inspect
https://github.com/ruby/prism/commit/486c71c426
2024-05-24 17:19:33 +00:00
Kevin Newton
47b723f890
[PRISM] Use only bundled error formatting 2024-05-24 13:05:35 -04:00
Kevin Newton
ba336027be [PRISM] Move error formatting into Ruby 2024-05-24 12:58:44 -04:00
Kevin Newton
47f0965269 Update duplicated when clause warning message 2024-05-24 12:36:54 -04:00
Kevin Newton
7021e15652 [ruby/prism] Update duplicated when error message
https://github.com/ruby/prism/commit/54316fd8a0
2024-05-24 12:36:54 -04:00
David Rodríguez
180ae00989 [rubygems/rubygems] Rework bundle gem specs so that they work on Windows
Most of the commands run by these specs actually prompt for user input
but for some reason `Open3` outside of Windows ignores that and goes on
with no user input. Windows does not like this.

This commit refactors these specs so that:

* They don't prompt for user input when not necessary.
* They pass proper user input when necessary.

As long as no user input is needed, most specs pass, so it allows to
remove the `:readline` tag from most of them.

https://github.com/rubygems/rubygems/commit/3dfabcdae4
2024-05-24 16:25:40 +00:00
David Rodríguez
6a7e4c40e1 [rubygems/rubygems] Neither --force flag or inline mode should mandate a remote resolution
https://github.com/rubygems/rubygems/commit/50dd93e217
2024-05-24 15:02:31 +00:00
David Rodríguez
eef125fd09 [rubygems/rubygems] Fix error messages to not mention cached gems when they were not used
https://github.com/rubygems/rubygems/commit/5ce9a7ff17
2024-05-24 15:02:30 +00:00
David Rodríguez
744dd5a362 [rubygems/rubygems] Fix performance regression on applications with a local cache
Even if all gems are properly installed and no resolve is needed, we
recently started always reading all packages in `vendor/cache` and
extracting specifications from them.

This commit fixes the problem by longer making considering cached specs
the default and only enable them when a resolve is actually needed.

https://github.com/rubygems/rubygems/commit/edeb2c42bf
2024-05-24 15:02:30 +00:00
David Rodríguez
c23798c2c4 [rubygems/rubygems] Remove @remote instance variable from Definition
It's a sources specific concern, so keep it there. It allows to simplify
the code quite a lot.

https://github.com/rubygems/rubygems/commit/639f0b72f4
2024-05-24 15:02:30 +00:00
David Rodríguez
ea7e3e7b78 [rubygems/rubygems] Give better message when resolving because there's no lockfile
https://github.com/rubygems/rubygems/commit/4e048bc255
2024-05-24 15:02:29 +00:00
David Rodríguez
0f9781b5c1 [rubygems/rubygems] Use Definition#no_resolve_needed?
https://github.com/rubygems/rubygems/commit/5074c58ffb
2024-05-24 15:02:29 +00:00
David Rodríguez
3832a1bda8 [rubygems/rubygems] Make code more symmetric
https://github.com/rubygems/rubygems/commit/dc7c9f029a
2024-05-24 15:02:28 +00:00
Sampat Badhe
e49d68bf27 correct typo [ci skip] 2024-05-24 17:00:15 +09:00
Martin Emde
acdd19facc [rubygems/rubygems] Fiks speeling cott bye codespell
https://github.com/rubygems/rubygems/commit/508ed917a5
2024-05-24 01:53:35 +00:00
Kevin Newton
2d4d99f78a [PRISM] Update remaining test excludes 2024-05-23 21:27:36 -04:00
Martin Emde
76e31d9aa9 [rubygems/rubygems] Remove MD5 ETag generation from compact index
This was an offramp for generated etags to allow existing caches
to be served until people could upgrade. It has been about 6 months
since the transitional version was released, so we can remove this
transitional code now.

https://github.com/rubygems/rubygems/commit/4ec8cfe611
2024-05-23 22:57:26 +00:00
eileencodes
c96b5791ef [ruby/prism] Raise void value expression in begin clauses
In some cases Prism was either not raising an appropriate `void value
expression` error, or raising that error when the syntax is considered
valid.

To fix this Prism needs to check whether we have other clauses on the
`begin` rather than just returning `cast->statements`.

* If the `cast->statements` are null and the `cast->ensure_clause` is
not null, set the code to `cast->ensure_clause`
* else
  * If there is a `cast->rescue_clause`
    * Check if `cast->statements` are null and `cast->rescue_clause->statements`
    are null, and return `NULL`
    * Check if there is an `else_clause`, and set the node to
      `cast->else_clause`.
    * Otherwise return `cast->statements` as the node
  * return `cast->statements` as the node

See tests for test cases. Note I took these directly from CRuby so if
desired I can delete them since the test will now pass. This only fixes
one test in the `test_parse` file, taking failures from 14 to 13.

This fixes `TestParse#test_void_value_in_rhs` and is related to
issue #2791.

https://github.com/ruby/prism/commit/398152b412
2024-05-23 19:30:03 +00:00
Nobuyoshi Nakada
49fcd33e13 Introduce a specialize instruction for Array#pack
Instructions for this code:

```ruby
  # frozen_string_literal: true

[a].pack("C")
```

Before this commit:

```
== disasm: #<ISeq:<main>@test.rb:1 (1,0)-(3,13)>
0000 putself                                                          (   3)[Li]
0001 opt_send_without_block                 <calldata!mid:a, argc:0, FCALL|VCALL|ARGS_SIMPLE>
0003 newarray                               1
0005 putobject                              "C"
0007 opt_send_without_block                 <calldata!mid:pack, argc:1, ARGS_SIMPLE>
0009 leave
```

After this commit:

```
== disasm: #<ISeq:<main>@test.rb:1 (1,0)-(3,13)>
0000 putself                                                          (   3)[Li]
0001 opt_send_without_block                 <calldata!mid:a, argc:0, FCALL|VCALL|ARGS_SIMPLE>
0003 putobject                              "C"
0005 opt_newarray_send                      2, :pack
0008 leave
```

Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2024-05-23 12:11:50 -07:00
Kevin Newton
e5e079e70f [ruby/prism] Only accept command call when specified for constant path
https://github.com/ruby/prism/commit/0ae908b6ee
2024-05-23 18:45:04 +00:00
Kevin Newton
56a51fcd33 [PRISM] Fix up some masgn topn calculations 2024-05-23 13:22:22 -04:00
Kevin Newton
0ebd37234e [PRISM] Enable TestSyntax#test_unterminated_heredoc_cr 2024-05-23 12:41:22 -04:00
Kevin Newton
7d89d52714 [ruby/prism] Disallow newlines in heredoc identifiers
https://github.com/ruby/prism/commit/737f2c2117
2024-05-23 15:51:27 +00:00
Nobuyoshi Nakada
a99d79dd31 Remove dead code
Since 140512d2225e6fd046ba1bdbcd1a27450f55c233, `else` without
`rescue` has been a syntax error.
2024-05-23 19:28:02 +09:00
Yusuke Endoh
1471a160ba Add RB_GC_GUARD for rb_str_to_parser_string
I think this fixes the following random test failure that could not be
fixed for a long time:

```
  1) Failure:
TestSymbol#test_inspect_under_gc_compact_stress [/home/chkbuild/chkbuild/tmp/build/20240522T003003Z/ruby/test/ruby/test_symbol.rb:126]:
<":testing"> expected but was
<":\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"">.
```

The value passed to this function is the return value of `rb_id2str`, so
it is never collected.  However, if auto_compact is enabled, the string
may move and `RSTRING_PTR(str)` became invalid.

This change prevents the string from being moved by RB_GC_GUARD.
2024-05-23 19:26:45 +09:00
Nobuyoshi Nakada
ce20367a0e Define incflags also on mswin 2024-05-23 13:16:48 +09:00
Nobuyoshi Nakada
5fa6ba9568 [Bug #20500] Search non-default directories for jemalloc
Co-Authored-by: lish82 (Hiroki Katagiri)
2024-05-23 13:16:48 +09:00
dependabot[bot]
fc9acbaac2 Bump ruby/setup-ruby from 1.177.0 to 1.177.1
Bumps [ruby/setup-ruby](https://github.com/ruby/setup-ruby) from 1.177.0 to 1.177.1.
- [Release notes](https://github.com/ruby/setup-ruby/releases)
- [Commits](7dc18ff0ca...943103cae7)

---
updated-dependencies:
- dependency-name: ruby/setup-ruby
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-22 20:36:53 -07:00
git
aad09104b7 Update default gems list at 2cc047df9a92e0c6b9d0fb57f305f4 [ci skip] 2024-05-23 01:18:20 +00:00
Hiroshi SHIBATA
2cc047df9a [ruby/rdoc] Bump up 6.7.0
https://github.com/ruby/rdoc/commit/a667e616e1
2024-05-23 01:17:32 +00:00
Kevin Newton
6d81ae3f01 [PRISM] Properly support 'it' 2024-05-22 16:34:04 -04:00
Kevin Newton
e575954887 [ruby/prism] Fix support for 'it' implicit local variable
https://github.com/ruby/prism/commit/53bbcfe513
2024-05-22 16:34:04 -04:00
git
5613d6e95b Update bundled gems list as of 2024-05-22 2024-05-22 06:59:19 +00:00
Ellen Keal
5b9b6b4d2b [rubygems/rubygems] move git clone depth error handling to else branch
https://github.com/rubygems/rubygems/commit/022eb473f8
2024-05-22 06:01:51 +00:00
Ellen Keal
ec9de0c471 [rubygems/rubygems] fix for gems not downloading from git via http
https://github.com/rubygems/rubygems/commit/592a2fcd54
2024-05-22 06:01:50 +00:00
Nobuyoshi Nakada
1e08a9f0e9 [Bug #20499] Use Xcode owned tools for Xcode clang
Xcode has its own version tools that may be incompatible with genuine
LLVM tools, use the tools in the same directory.
2024-05-22 13:49:05 +09:00
Vladimir Támara Patiño
911b7d1dcf [ruby/reline] Catches Errno::ENODEV and Errno::EBADF in
get_screen_size. Closes https://github.com/ruby/reline/pull/690
(https://github.com/ruby/reline/pull/702)

* Catches exceptions Errno::ENODEV and Errno::EBADF in get_screen_size. Closes https://github.com/ruby/reline/pull/690

* Just catching Errno::ENOTTY and Errno::ENODEV

https://github.com/ruby/reline/commit/a5b5298e4a
2024-05-22 04:16:42 +00:00
dependabot[bot]
ae07c606b5 ---
updated-dependencies:
- dependency-name: ruby/setup-ruby
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-21 20:02:06 -07:00
Hiroshi SHIBATA
f8e6752219
Revert "[Bug #20499] Use consistent version tools with CC"
This reverts commit 8277cf0799145bed0c813bfcc187739f77b3102d.

This change break to build with `rbenv install ruby-dev` with the following error.

```
touch yjit/target/release/libyjit.a
transdb.h updated
./tool/darwin-ar: line 6: /nm: No such file or directory
./tool/darwin-ar: line 6: exec: /nm: cannot execute: No such file or directory
partial linking yjit/target/release/libyjit.a into yjit/target/release/libyjit.o
```
2024-05-22 10:45:02 +09:00