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

85679 Коммитов

Автор SHA1 Сообщение Дата
Étienne Barrié 1376881e9a Stop marking chilled strings as frozen
They were initially made frozen to avoid false positives for cases such
as:

    str = str.dup if str.frozen?

But this may cause bugs and is generally confusing for users.

[Feature #20205]

Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
2024-05-28 07:32:33 +02:00
Yusuke Endoh 2114d0af1e Make test_nested_timeouts less flaky
This test randomly fails due to the bug reported in [Bug #20314], where
the two timeouts are too close so that they can expire at the same time.

As a workaround, this change increases the time difference between
timeouts. This will reduce the probability of simultaneous expirations
and lower flakiness.
2024-05-28 12:49:46 +09:00
verdy89 7c6e4bc7ca [ruby/reline] Implement the redo command
(https://github.com/ruby/reline/pull/707)

* Implement the redo command

* Commented out a test that does not pass

* Changed key assignment for redo from "\C-[" to "\C-g"

* Changed redo key assignment from `\C-g` to `\M-\C-_`

* Revert the first implemantation

* Implemented redo by sharing `@past_lines` between undo and redo

* Fixed the index of past_lines that is updated when the cursor is moved

* Fixed deletion of the redo history in regular input

* Renamed variables: past_lines -> input_lines

* Rename @position to @input_lines_position

* Deleted unused variables: `@old_byte_pointer` and `@old_line_index`

https://github.com/ruby/reline/commit/0b2d9fab5f
2024-05-27 16:38:22 +00:00
Yusuke Endoh bc47ca5546 Add a debug print for a random failure
```
  1) Error:
TestRubyLiteral#test_float:
ArgumentError: SyntaxError#path changed: "(eval at /home/chkbuild/chkbuild/tmp/build/20240527T050036Z/ruby/test/ruby/test_literal.rb:642)"->"(eval at /home/chkbuild/chkbuild/tmp/build/20240527T050036Z/ruby/test/ruby/test_literal.rb:642)"
```
https://rubyci.s3.amazonaws.com/s390x/ruby-master/log/20240527T050036Z.fail.html.gz
2024-05-27 18:16:28 +09:00
Yusuke Endoh 4fee1019f6 Try to upload core file on macos GitHub Actions
A core dump occurred, but failed to capture the core file.
https://app.launchableinc.com/organizations/ruby/workspaces/ruby/data/test-sessions/2935062?tab=retried-tests

Looks like a core file was not created. I am not unsure why, so make
sure that the /cores directory is writable and try `ulimit` command.
2024-05-27 13:40:19 +09:00
Nobuyoshi Nakada f4b475993e
Apply optimizations for `putstring` to `putchilledstring` as well 2024-05-27 12:41:38 +09:00
License Update 5853a38043 [rubygems/rubygems] Update SPDX license list as of 2024-05-22
https://github.com/rubygems/rubygems/commit/f91ac04397
2024-05-27 01:45:38 +00:00
Marcus Stollsteimer 4949f0a928 [rubygems/rubygems] Fix typo in description of build:checksum task
https://github.com/rubygems/rubygems/commit/351ff2512f
2024-05-26 21:42:45 +00:00
Nobuyoshi Nakada 0d44e23831
Prevent test-bundled-gems outputs from mixing
Run test-bundled-gems-run and test-bundled-gems-spec sequentially.
2024-05-26 22:17:57 +09:00
Nobuyoshi Nakada bc50f2a3f1
Debug unexpectedly changed path 2024-05-26 20:14:18 +09:00
eileencodes 0f9e50b8c5 Fix macos bug deleting too many files
Since #10209 we've been noticing that on macos after running `make
clean` the `coroutine/arm64/Context.S` file is missing, causing
subsequent make calls to fail because `Context.S` is needed to build
`Context.o`.

The reason this is happening is because macos is case-insensitive so the
`.s` looks for `coroutine/arm64/Context.s` and finds
`coroutine/arm64/Context.s`. This does not happen on linux because the
filesystem is case sensitive.

I attempted to use `find` because it is case sensitive regardless of
filesystem, but it was a lot slower than `rm` since we can't pass
multiple file names the same way to `find`.

Reverting this small part of #10209 fixes the issue for macos and it
wasn't clear that those changes were strictly necessary for the rest of
the PR.

We changed the original code to use `rm` instead of `delete` because it
is not standarized on POSIX.
2024-05-26 19:11:23 +09:00
Go 508f331048 [ruby/reline] allow space in config value
(https://github.com/ruby/reline/pull/705)

* allow space in config value

fix https://github.com/ruby/reline/pull/657

* remove inline comments

* Revert "remove inline comments"

This reverts commit https://github.com/ruby/reline/commit/2438347c1a10.

* refactoring

* remove unnecessary comment handling

https://github.com/ruby/reline/commit/d60f1e1e39
2024-05-26 08:28:25 +00:00
Martin Emde d2c4363e0c [rubygems/rubygems] Add CompactIndexClient::Parser specs
https://github.com/rubygems/rubygems/commit/4bf455a498
2024-05-25 17:47:07 +00:00
Martin Emde 6b0afbb111 [rubygems/rubygems] Reorganize and refactor CompactIndexClient
https://github.com/rubygems/rubygems/commit/71bcf354f5
2024-05-25 17:47:07 +00:00
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 140512d222, `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