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

86151 Коммитов

Автор SHA1 Сообщение Дата
Koichi Sasada 420ef906bd respect `--error-output stderr` on parallel mode
`MultiFormatter#print_exception` should respect `--error-output stderr`.
2024-06-14 04:30:19 +09:00
Kevin Newton 0321f2c8fe [ruby/prism] Handle implicit array precedence
When an implicit array is used in a write, is causes the whole
expression to become a statement. For example:

```ruby
a = *b
a = 1, 2, 3
```

Even though these expressions are exactly equivalent to their
explicit array counterparts:

```ruby
a = [*b]
a = [1, 2, 3]
```

As such, these expressions cannot be joined with other expressions
by operators or modifiers except if, unless, while, until, or
rescue.

https://github.com/ruby/prism/commit/7cd2407272
2024-06-13 18:46:02 +00:00
Alan Wu ffd895156f YJIT: Delete otherwise-empty defer_compilation() blocks
Calls to defer_compilation() leave behind a stub and a `struct Block`
that we retain. If the block is empty, it only exits to hold the
`struct Branch` that the stub needs.

This patch transplants the branch out of the empty block into the newly
generated block when the defer_compilation() stub is hit, and deletes
the empty block to save memory.

To assist the transplantation, `Block::outgoing` is now a
`MutableBranchList`, and `Branch::Block` now in a `Cell`. These types
don't incur a size cost.

On the `lobsters` benchmark, `yjit_alloc_size` is roughly 98% of what
it was before the change.

Co-authored-by: Kevin Menard <kevin.menard@shopify.com>
Co-authored-by: Randy Stauner <randy@r4s6.net>
Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
2024-06-13 13:00:46 -04:00
Alan Wu 28d1685ebb YJIT: Align number of `total_exits` for --yjit-stats 2024-06-13 13:00:46 -04:00
tompng a9b8981aac Simplify rb_str_resize clear range condition 2024-06-13 18:27:02 +02:00
tompng 04467218ce Add rb_str_resize coderange test 2024-06-13 18:27:02 +02:00
tompng 9c7374b0e6 Clear coderange when rb_str_resize change size
In some encoding like utf-16 utf-32, expanding the string with null bytes can change coderange to either broken or valid.
2024-06-13 18:27:02 +02:00
Jeremy Evans a60831f9b6 Use ENDBR instruction in amd64 coroutine on OpenBSD
When running on newer Intel processors supporting the feature,
OpenBSD enforces indirect branch tracking.  Without this endbr64
instruction, jumps to the coroutine_transfer function result
in SIGILL on OpenBSD/amd64 when using such processors.

The OpenBSD Ruby ports have been using a patch similar to this
for the past two months.

From some research, cet.h has been supported by GCC for about
6 years and LLVM for about 4 years.
2024-06-13 07:28:59 -07:00
David Rodríguez c2f8e91815 [rubygems/rubygems] Also disambiguate gems not in the first Gem.path position
https://github.com/rubygems/rubygems/commit/7e6e7ccc58
2024-06-13 14:25:14 +00:00
David Rodríguez 5c573b7652 [rubygems/rubygems] Fix default gem priority when sorting specs
https://github.com/rubygems/rubygems/commit/8dbe1dbdc7

Co-authored-by: MSP-Greg <Greg.mpls@gmail.com>
2024-06-13 14:25:14 +00:00
git 8b843b0dc7 Update default gems list at 205da89680 [ci skip] 2024-06-13 09:49:46 +00:00
Sutou Kouhei 205da89680 [ruby/stringio] Development of 3.1.2 started.
https://github.com/ruby/stringio/commit/9ad5551160
2024-06-13 09:48:38 +00:00
Koichi Sasada 513520a173 do not call `check_rvalue_consistency` here
in `free` is not valid object and should not call
`check_rvalue_consistency`.
2024-06-13 17:26:44 +09:00
Koichi Sasada fc33559c40 clear `kw_flag` if given hash is nil
https://bugs.ruby-lang.org/issues/20570 is caused I missed to
clear the `kw_flag` even if `keyword_hash` is nil.
2024-06-13 13:52:39 +09:00
Koichi Sasada e4385baaa2 avoid recursive calls on `check_rvalue_consistency`
`check_rvalue_consistency` uses bitmap and `RVALUE_WB_UNPROTECTED`
etc calls `check_rvalue_consistency` again.

also `rb_raw_obj_info_common()` is called from `check_rvalue_consistency`
so it should not use call `check_rvalue_consistency`.
2024-06-13 13:14:44 +09:00
dependabot[bot] ab51e5fec4 Bump ruby/setup-ruby from 1.179.1 to 1.180.0
Bumps [ruby/setup-ruby](https://github.com/ruby/setup-ruby) from 1.179.1 to 1.180.0.
- [Release notes](https://github.com/ruby/setup-ruby/releases)
- [Commits](78c01b705f...ff740bc00a)

---
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-06-12 20:54:06 -07:00
dependabot[bot] 11bfa975f9 Bump actions/checkout from 4.1.6 to 4.1.7
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.6 to 4.1.7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](a5ac7e51b4...692973e3d9)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-12 20:15:51 -07:00
dependabot[bot] 333d12bb19 Bump actions/checkout in /.github/actions/setup/directories
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.6 to 4.1.7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](a5ac7e51b4...692973e3d9)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-12 20:00:09 -07:00
Peter Zhu 7c46aa5ed4 [Bug #20577] Fix freeing symbols when RUBY_FREE_AT_EXIT
Dynamic symbols point to a fstring. When we free the symbol, we hash the
fstring to remove it from the table. However, the fstring could have
already been freed, which can cause a crash.

This commit changes it to remove the reference to the fstring before
freeing the symbol so we can avoid this crash.
2024-06-12 16:12:46 -04:00
Gabriel Sobrinho 94a8f05f00 [rubygems/rubygems] Fix test description
https://github.com/rubygems/rubygems/commit/4bcdb854a2
2024-06-12 19:17:21 +00:00
Jean Boussier c81360db75 Kernel#warn: don't call `Warning.warn` unless the category is enabled
[Bug #20573]

Followup: https://github.com/ruby/ruby/pull/10960

I believe `Kernel#warn` should behave in the same way than internal
`rb_warning_* APIs
2024-06-12 20:57:31 +02:00
Maxime Chevalier-Boisvert ce06924a17
YJIT: add context cache hits stat (#10979)
* YJIT: add context cache hits stat

This stat should make more sense when it comes to interpreting
the effectiveness of the cache on large deployed apps.
2024-06-12 13:33:27 -04:00
Aaron Patterson 85190d4130 Add regression test for Bug #20573
Just a regression test to ensure behavior remains the same
2024-06-12 10:25:57 -07:00
tomoya ishida 783eaf70f8 [ruby/irb] Invalid encoding symbol now raises SyntaxError also in
3.3
(https://github.com/ruby/irb/pull/969)

https://github.com/ruby/irb/commit/bad7492ab0
2024-06-12 16:57:55 +00:00
Matt Valentine-House 96974c6c0d Simplify GC bitmap access macros
Now that we're using the inline predicate functions everywhere, the only
remaining use of the RVALUE_?_BITMAP macros is inside their respective
inline function, so we can remove them.
2024-06-12 17:09:07 +01:00
Matt Valentine-House 5cf5370116 Use RVALUE_UNCOLLECTIBLE consistently 2024-06-12 17:09:07 +01:00
Matt Valentine-House 4c38b4f70f Use RVALUE_WB_UNPROTECTED consistently 2024-06-12 17:09:07 +01:00
Matt Valentine-House cc700c3d8f Use RVALUE_MARKING consistently 2024-06-12 17:09:07 +01:00
Matt Valentine-House e006a58f07 Use RVALUE_MARKED consistently 2024-06-12 17:09:07 +01:00
Matt Valentine-House bb663fe0b2 Use RVALUE_PINNED consistently 2024-06-12 17:09:07 +01:00
git 22ad7d72e1 Update default gems list at 006ff5e29f [ci skip] 2024-06-12 14:24:30 +00:00
Mari Imaizumi 006ff5e29f [ruby/reline] Bump version to 0.5.9
(https://github.com/ruby/reline/pull/724)

https://github.com/ruby/reline/commit/aff1d852bb
2024-06-12 14:23:18 +00:00
Matt Valentine-House 1db19a2dbd Remove unneeded loop through size_pools
This function loops twice through the array of size pools. Once to set
up the pages list, and then again later on in the function to set the
allocatable_pages count.

We don't do anything with the size pools in between the invocation of
these loops that will affect the size pools, so this commit removes the
second loop and moves the allocatable_pages count update into the first
loop.
2024-06-12 13:54:20 +01:00
David Rodríguez 6b6fd16219 [rubygems/rubygems] Fix typo
https://github.com/rubygems/rubygems/commit/19a0e3730c
2024-06-12 12:46:06 +00:00
Nobuyoshi Nakada 32a555ea53
[Bug #20572] Abandon if replacing destination is the same 2024-06-12 19:57:50 +09:00
Yudai Takada 278a7cb057
[DOC] Fix a typo in dir.c
s/Retruns/Returns/
2024-06-12 10:42:01 +00:00
tomoya ishida c56d0adfa6 [ruby/irb] Cleanup irbrc generator cache always at teardown
(https://github.com/ruby/irb/pull/968)

https://github.com/ruby/irb/commit/905184ff9c
2024-06-12 07:48:03 +00:00
ydah 2eb31a6254 Fix a typo
s/sepcifier/specifier/
2024-06-12 15:45:06 +09:00
S-H-GAMELINKS 1fc0763724 Introduce `ident_or_const` inline rule 2024-06-12 15:36:55 +09:00
Nobuyoshi Nakada 01b13886dc [Bug #20562] Categorize `RUBY_FREE_AT_EXIT` warning as experimental 2024-06-12 15:36:10 +09:00
Nobuyoshi Nakada 0bc91fa6df
`File.umask` does not make sense on Windows 2024-06-12 14:46:29 +09:00
Koichi Sasada 39c9d99f6c 'SPEC_TEMP_DIR` should not be world-writable
`SPEC_TEMP_DIR` is not present until `tmp()` method is called
on parallel run. In this case `tmp()` is called with `File.umask = 0`.
This patch makes `SPEC_TEMP_DIR` before `File.umask = 0`.

To solve the issue essentially, I think `SPEC_TEMP_DIR` should be
prepared at the beginning of parallel process.
2024-06-12 14:06:42 +09:00
Nobuyoshi Nakada 206465e84d ripper: Unify `dispatch_end` 2024-06-12 11:49:33 +09:00
Aaron Patterson 1271ff72d5 Don't call `Warning.warn` unless the category is enabled
The warning category should be enabled if we want to call
`Warning.warn`.

This commit speeds up the following benchmark:

```ruby
eval "def test; " +
  1000.times.map { "'  '.chomp!" }.join(";") + "; end"

def run_benchmark count
  i = 0
  while i < count
    start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
    yield
    ms = Process.clock_gettime(Process::CLOCK_MONOTONIC) - start
    puts "itr ##{i}: #{(ms * 1000).to_i}ms"
    i += 1
  end
end

run_benchmark(25) do
  250.times do
    test
  end
end
```

On `master` this runs at about 92ms per iteration. With this patch, it
is 7ms per iteration.

[Bug #20573]
2024-06-11 14:54:15 -07:00
Takashi Kokubun 0a6b1a4d9d redmine-backporter.rb: Prepend commit: to shorter revs
Some of the places in Redmine (e.g. Associated revisions) print
revisions using only 8 characters. Even when I copied a revision from
there, I want to prepend commit: in the message.
2024-06-11 11:28:04 -07:00
Takashi Kokubun ec1ea2c5b9 YJIT: Make num_contexts_encoded a default counter 2024-06-11 10:17:41 -07:00
gartens c735f4947e [ruby/openssl] Pass through nil as digest when signing certificates
(https://github.com/ruby/openssl/pull/761)

In order to sign certificates with Ed25519 keys, NULL must be passed
as md to X509_sign.  This NULL is then passed
(via ASN1_item_sign_ex) as type to EVP_DigestSignInit.  The
documentation[1] of EVP_DigestSignInit states that type must be NULL
for various key types, including Ed25519.

[1]: https://www.openssl.org/docs/manmaster/man3/EVP_DigestSignInit.html

https://github.com/ruby/openssl/commit/b0fc100091
2024-06-11 17:12:28 +00:00
Maxime Chevalier-Boisvert 39019b6a63
YJIT: add context cache size stat, lazily allocate cache
* YJIT: add context cache size stat
* Allocate the context cache in a box so CRuby doesn't pay overhead
* Add an extra debug assertion
2024-06-11 12:46:11 -04:00
David Rodríguez 568132af16 [rubygems/rubygems] Keep credentials in lockfile if they are already there
So that those lockfiles still work with older Bundler versions.

https://github.com/rubygems/rubygems/commit/880275bb66
2024-06-11 16:27:44 +00:00
Peter Zhu 32683aa18d Remove use of symbols and arrays when freeing global table
This removes the use of symbol and array objects when freeing the global
table so we can now free symbols and arrays earlier.
2024-06-11 10:33:51 -04:00