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

86276 Коммитов

Автор SHA1 Сообщение Дата
Kevin Menard a119b5f879 Add a fast path implementation for appending single byte values to US-ASCII strings. 2024-06-17 09:44:48 -07:00
Kevin Menard 27e13fbc58 Add a fast path implementation for appending single byte values to binary strings.
Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2024-06-17 09:44:48 -07:00
Yuta Saito b73dd8f6d0 [ruby/io-console] Skip building extension on WASI
WASI does not support concept to provide termios, so it is not possible
to build io/console extension on WASI at the moment.

However, `io/console` is used by many gems, and removing the dependency
from them *conditionally* is impossible. So, this commit adds a
check to skip building `io/console` extension on WASI just to pass `gem
install` for the platform.

https://github.com/ruby/io-console/commit/ba9bf00184
2024-06-17 07:40:56 +00:00
git ef423dd6d4 Update default gems list at ce6a1ba9a1 [ci skip] 2024-06-15 20:14:58 +00:00
Stan Lo ce6a1ba9a1 [ruby/irb] Bump version to v1.13.2
(https://github.com/ruby/irb/pull/970)

https://github.com/ruby/irb/commit/35de7dacd4
2024-06-15 20:14:01 +00:00
Herwin 84947c515a [ruby/prism] Document MultiWriteNode fields
https://github.com/ruby/prism/commit/b6a97a43c2
2024-06-15 15:03:18 +00:00
Herwin 6184882b84 [ruby/prism] Document MultiTargetNode
https://github.com/ruby/prism/commit/b817cd25c5
2024-06-15 12:06:49 +00:00
Kevin Newton 7529591df1 [ruby/prism] Ensure ranges are non-associative
https://github.com/ruby/prism/commit/f59295938b
2024-06-14 19:22:54 +00:00
David Rodríguez 4d73f3f9eb [rubygems/rubygems] Fix funding metadata not being printed in some situations
Namely, when a gem has not previously been installed, and Bundler is
using the compact index API, fund metadata was not getting printed
because the proper delegation was not implemented in the specification
class used by the compact index.

https://github.com/rubygems/rubygems/commit/9ef5139f60
2024-06-14 14:27:02 +00:00
David Rodríguez 6a474ef266 [rubygems/rubygems] Don't print bug report template when bin dir is not writable
https://github.com/rubygems/rubygems/commit/f4ce3aae71
2024-06-14 10:05:20 +00:00
Nobuyoshi Nakada a1f72a563b [Bug #20579] ripper: Dispatch spaces at END-OF-INPUT without newline 2024-06-14 17:54:02 +09:00
Nobuyoshi Nakada 7f47469105 Include `__LINE__` in `add_delayed_token` macro 2024-06-14 17:54:02 +09:00
David Rodríguez 62fc473224 [rubygems/rubygems] Never remove executables that may belong to a default gem
https://github.com/rubygems/rubygems/commit/ed585f2fca
2024-06-14 08:02:38 +00:00
David Rodríguez 7767b60ff2 [rubygems/rubygems] Reuse `write_file` helper
https://github.com/rubygems/rubygems/commit/339f099870
2024-06-14 08:02:38 +00:00
Alan Wu 0dcb0fdfcd
Enable LeakChecker for RJIT previously disabled for MJIT (#10998)
RJIT doesn't spawn subprocesses so there should now be no need to
special case it.
2024-06-14 00:05:38 -07:00
Dmitry Ukolov 8ddb4de0ac
Fixed indents in recently RJIT patch (#11001) 2024-06-14 00:05:21 -07:00
Nobuyoshi Nakada 2e59cf00cc [Bug #20578] ripper: Fix dispatching part at invalid escapes 2024-06-14 15:02:15 +09:00
dependabot[bot] 2677ab1607 Bump github/codeql-action from 3.25.9 to 3.25.10
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.9 to 3.25.10.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](530d4feaa9...23acc5c183)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-13 20:14:32 -07:00
dependabot[bot] 7d6b7669dc Bump github/codeql-action from 3.25.8 to 3.25.9
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.8 to 3.25.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](2e230e8fe0...530d4feaa9)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-14 10:48:00 +09:00
Matt Valentine-House 4ab7cc1818 Guard against GC.compact when using in tests
This test will error on platforms that don't implement GC.compact

Co-Authored-By: Peter Zhu <peter@peterzhu.ca>
2024-06-13 18:58:49 -04:00
Matt Valentine-House c093fd86d2 Don't return inside assert_equal
The implementation of assert_equal inside bootstraptest/runner.rb wraps
a print around all the test code specified in the string, making returns
useless.

This change fixes this test for platforms that don't implement
GC.compact

Co-Authored-By: Peter Zhu <peter@peterzhu.ca>
2024-06-13 18:58:49 -04:00
Dmitry Ukolov b988ae3a06
RJIT: Fixed and/or reg+disp32 operations (#10856)
Fixed RJIT `and reg+disp32` and `or reg+disp32` operation.
2024-06-13 15:55:01 -07:00
Alan Wu 6416ee33eb Simplify unaligned write for pre-computed string hash 2024-06-13 18:52:09 -04:00
Alan Wu a8730adb60 rb_str_hash(): Avoid UB with making misaligned pointer
Previously, on common platforms, this code made a pointer to a union of
8 byte alignment out of a char pointer that is not guaranteed to satisfy
the alignment requirement. That is undefined behavior according
to [C99 6.3.2.3p7](https://port70.net/~nsz/c/c99/n1256.html#6.3.2.3p7).

Use memcpy() to do the unaligned read instead.
2024-06-13 18:52:09 -04:00
Alan Wu 2699e230e4
Crash instead of raising with Check_Type() in RBIMPL_ASSERT_TYPE() in debug builds
Previously, RBIMPL_ASSERT_TYPE() used Check_Type() only in RUBY_DEBUG
builds. It raised TypeError, but only in debug builds. For people testing
type mismatch using debug builds looking for a Ruby exception, this can
be misleading -- the code could be missing a type check in non-debug builds
if it is relying on for example RSTRING_LEN() to raise.

Also, Check_Type() can obscure the true cause of error in debug mode.
When type check fails because the object is corrupt, instead of crashing
with a clear type assertion message, it can crash while trying to
construct an exception object to raise. You can see this for example in
<https://github.com/ruby/ruby/actions/runs/9489999591/job/26152506434?pr=10985>,
where RB_ENCODING_GET() is used on a corrupt object, but the crash
happens later and says "Assertion Failed:
../src/vm_method.c:1477:callable_method_entry_or_negative".
RBIMPL_ASSERT_TYPE() should assert right away.

RBIMPL_ASSERT_OR_ASSUME() asserts when RUBY_DEBUG and assumes in release
builds, as desired.

This should help investigate flaky CI failures that show up as TypeError
from `Kernel#require`, e.g.
"'Kernel#require': wrong argument type false (expected String) (TypeError)".

Same CI failure examples:
 - https://github.com/ruby/ruby/actions/runs/9034787861/job/24828147431
 - https://github.com/ruby/ruby/actions/runs/9418303667/job/25945492440
 - https://github.com/ruby/ruby/actions/runs/9505650952/job/26201031314

The failure occurs with and without use of YJIT.
2024-06-13 21:43:41 +00:00
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