93801 Commits

Author SHA1 Message Date
Nobuyoshi Nakada
0887d82406
dtoa.c: Add shortcut if arguments are zero 2025-09-10 15:34:29 +09:00
git
6a4222f475 Update default gems list at 6c9a0173332121f15fa0c654b1a728 [ci skip] 2025-09-10 05:38:10 +00:00
Hiroshi SHIBATA
6c9a017333 [ruby/fcntl] Bump up to v1.3.0
https://github.com/ruby/fcntl/commit/13d8aa4785
2025-09-10 05:37:21 +00:00
Aaron Patterson
37884c4a68 [ruby/fcntl] Add macOS specific flags around file preallocation
I wanted to use file preallocation with fcntl, but the flags weren't
available.  This commit just adds the missing flags.

https://github.com/ruby/fcntl/commit/7d4ab83a84
2025-09-10 04:42:18 +00:00
Takashi Kokubun
8f040a571b
ZJIT: Resurrect --seed to stabilize CI (#14489) 2025-09-09 14:17:39 -07:00
Takashi Kokubun
a734c04b38 Revert "ZJIT: Resurrect --seed to stabilize CI"
This reverts commit 9d0b621b051c0f3cc356c9bedf081456f1d7dfd6.

It didn't work for `make check`. I'll fix it in a PR.
2025-09-09 13:48:22 -07:00
Takashi Kokubun
9d0b621b05 ZJIT: Resurrect --seed to stabilize CI
ref: https://github.com/ruby/ruby/pull/14459
2025-09-09 13:40:02 -07:00
Stan Lo
d14b4a7008
ZJIT: Remove unneeded omission for optional param test (#14488) 2025-09-09 13:25:12 -07:00
Takashi Kokubun
138451f853 Notify ZJIT CI failures 2025-09-09 13:22:55 -07:00
Peter Zhu
72c7d9f4c5 Update JIT bindings 2025-09-09 20:07:10 +02:00
Peter Zhu
82d62d4bea Remove unused fields from iseq_inline_constant_cache_entry 2025-09-09 20:07:10 +02:00
BurdetteLamar
9e3a16220c [DOC] Tweaks for String#lstrip! 2025-09-09 19:33:10 +02:00
Takashi Kokubun
d524e795af
ZJIT: Implement getblockparamproxy (#14483)
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
2025-09-09 09:27:01 -07:00
André Luiz Tiago Soares
f7fe43610b
ZJIT: Optimize ObjToString with type guards (#14469)
* failing test for ObjToString optimization with GuardType

* profile ObjToString receiver and rewrite with guard

* adjust integration tests for objtostring type guard optimization

* Implement new GuardTypeNot HIR; objtostring sends to_s directly on profiled nonstrings

* codegen for GuardTypeNot

* typo fixes

* better name for tests; fix side exit reason for GuardTypeNot

* revert accidental change

* make bindgen

* Fix is_string to identify subclasses of String; fix codegen for identifying if val is String
2025-09-09 08:58:03 -07:00
Daniel Colson
fe362beb89
ZJIT: Avoid mutating string in zjit stats (#14485)
[ZJIT] Avoid mutating string in zjit stats

GitHub runs with a Symbol patch that causes a frozen string error when
running `--zjit-stats`

```rb
Class Symbol
  alias_method :to_s, :name
end
```

I remember hearing that Shopify runs a similar patch, and that we might
try to make this the default behavior in Ruby some day.

Any chance we can avoid mutating the string here in case it's frozen?
That does mean we'll end up making some extra strings when it's not
frozen, but I think that's OK for printing stats.
2025-09-09 08:55:00 -07:00
Peter Zhu
ce94add7fb Fix global variable counter for alias
If we alias two variable multiple times, for example like this:

    alias $foo $bar
    alias $foo $bar

Then we will increment the counter for entry2->var->counter each time,
which is not correct because we are not adding more references to
entry2->var. This reports as a memory leak in RUBY_FREE_AT_EXIT because
entry2->var->counter will never reach 0 and thus will never be freed.
2025-09-09 11:29:35 +02:00
dependabot[bot]
5c98b899e6 Bump actions/github-script from 7.0.1 to 8.0.0
Bumps [actions/github-script](https://github.com/actions/github-script) from 7.0.1 to 8.0.0.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](60a0d83039...ed597411d8)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: 8.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-09 13:53:26 +09:00
dependabot[bot]
89bce81516 Bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-09 13:01:00 +09:00
dependabot[bot]
27d9c67bfc Bump actions/checkout in /.github/actions/setup/directories
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.2 to 5.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](11bd71901b...08c6903cd8)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-09 12:22:34 +09:00
Peter Zhu
8d79187523 Fix undefined behaviour in rb_alias_variable
entry1 is allocated using xmalloc (through ALLOC), which returns undefined
memory. We never set the ractor_local field, so the value is undefined.
2025-09-09 01:18:41 +02:00
Takashi Kokubun
a3eb4601e8
ZJIT, YJIT: Make the workflow names consistent with file names (#14462)
ZJIT, YJIT: Make the workflow names consistent

with file names
2025-09-08 13:11:34 -07:00
Randy Stauner
4263b7eb45
ZJIT: Add RubyVM::ZJIT.reset_stats! method (GH-14479)
This allows for more precise tracking of stats programmatically
which is particularly useful for our nightly benchmarking suite.

- Define rust function
- Expose to C
- Wrap with Ruby API
- Add a test
2025-09-08 19:11:56 +00:00
Aiden Fox Ivey
80079ba425
ZJIT: Fix 30k if stmt test (#14446)
* ZJIT: Allow label generation above 19 bits

* Refactor emit_conditional_jump to use generate_branch
* Make branching functionality generic across Label and CodePtr

* ZJIT: Add > 19 bit jump test and helper function

* Remove an empty line

---------

Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2025-09-08 11:56:14 -07:00
Takashi Kokubun
1b95afdee3
YJIT: Add more information to an assert message in jit_guard_known_class (#14480)
* YJIT: Add more information to an assert message

in jit_guard_known_class

* Say "should be a heap object" instead

Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>

---------

Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
2025-09-08 11:52:55 -07:00
Takashi Kokubun
866e474ac8
ZJIT: Fix backtraces on opt_new (#14461) 2025-09-08 09:50:33 -07:00
Jean Boussier
5ee083c71a Bump ABI version
Followup changes in https://github.com/ruby/ruby/pull/14470 /
03c86b053197f3cd6bece1925e634c1d74d196d0
2025-09-08 18:33:51 +02:00
Randy Stauner
41b11a3512
ZJIT: Add --zjit-stats=quiet option to collect stats without printing (#14467)
Similar to YJIT's --yjit-stats=quiet, this option allows ZJIT to collect
statistics and make them available via the Ruby API without printing them
at exit. This is useful for programmatic access to stats without the
output noise.

- Added print_stats field to Options struct
- Modified option parsing to support --zjit-stats=quiet
- Added rb_zjit_print_stats_p primitive to check if stats should be printed
- Updated zjit.rb to only register at_exit handler when print_stats is true
- Update the help text shown by `ruby --help` to indicate that
  --zjit-stats now accepts an optional =quiet parameter.
- Added test for --zjit-stats=quiet option
2025-09-08 08:53:19 -07:00
Jean Boussier
08091adec3 Add spec for missing or faulty to_proc methods
Followup: https://github.com/ruby/ruby/pull/14463
2025-09-08 16:22:50 +02:00
Nobuyoshi Nakada
ac24f70fb0
Align the conditions for did_you_mean
Probably due to the testing order, sometimes it looks like that
`Gem::UnknownCommandError` happens to be used without registered in
`DidYouMean`.
2025-09-08 21:06:17 +09:00
Nobuyoshi Nakada
7c5ddb793b
Remove debug code
* Revert "Debug: More inspections"
  e5a6e952467eef5444eaf63b77d8c91aa367d4de.

* Revert "Debug for sporadical failures on RubyCI"
  7cafc61e7df044644f47937694c46835c316e86b.
2025-09-08 21:04:19 +09:00
Jean Boussier
03c86b0531 Move IS_TYPED_DATA in RBasic.flags
Ref: https://github.com/ruby/ruby/pull/14134#issuecomment-3207733725

We can't safely use low-bit pointer tagging anymore because `RTypedData.type`
lines up with `RData.dfree` and there is no aligment guarantee on function
pointers, as evidenced by `memcached` and `gpgme` gems.

We also can't use FL_USER* for this, because extensions may use these
for other purposes.

Using a general flag for this is a bit unfortunate, as general flags
are hard to come by, however I recently freed several of them, and
we still have two or three free ones left.
2025-09-08 13:24:21 +02:00
Nobuyoshi Nakada
e5a6e95246
Debug: More inspections 2025-09-08 19:23:04 +09:00
Nobuyoshi Nakada
7cafc61e7d
Debug for sporadical failures on RubyCI 2025-09-08 18:09:06 +09:00
David Rodríguez
1e7ee6a4ba
[DOC] Improve format specification docs
One example to describe how `*` works actually prints a warning:

```
$ ruby -we "sprintf('%d', 20, 14)"
=> -e:1: warning: too many arguments for format string
```

I think it's better to not use examples that print warnings, so I
propose to merge `*` docs with "width" specifier docs, and only include
the "correct" example.

After I believe `*` is not an actual flag, but a special value that the
width specifier can take.

Mention `*` special value in initial summary as well.
2025-09-08 00:41:59 +09:00
YO4
6cd98c24fe Allow IO#each_codepoint to work with unetc even when encoding conversion active
Using IO#each_codepoint together with IO#ungetc causes an unwanted exception when encoding conversion is active.

C:\>ruby -e "open('NUL', 'rt') { |f| f.ungetc('aa'); f.each_codepoint { |c| p c }}"
97
-e:1:in 'IO#each_codepoint': byte oriented read for character buffered IO (IOError)
        from -e:1:in 'block in <main>'
        from -e:1:in 'Kernel#open'
        from -e:1:in '<main>'

Fixes [Bug #21131]
2025-09-08 00:23:01 +09:00
Nobuyoshi Nakada
85bd3fb870
sync_default_gems.rb: Support log.showSignature case 2025-09-07 10:41:32 +09:00
Jeremy Evans
953e1ef992 Make invalid & operator type error message consistent with */**
If #to_proc is defined, this uses the following error message format,
matching the error message format used for * when to_a returns non-Array
and for ** when to_hash returns non-Hash:

```
can't convert ClassName to Proc (ClassName#to_proc gives OtherClassName)
```

If #to_proc is not defined, this uses the following error message format,
matching the error message format used when ** is called on a non-Hash
not implementing to_hash.

```
no implicit conversion of ClassName into Proc
```

There isn't a similar error for * when called on a non-Array not
implementing to_a, as Ruby does not raise for that case.

Fixes [Bug #21563]
2025-09-07 00:52:45 +09:00
Nobuyoshi Nakada
5c875519f3 Refine use of Pathname::SEPARATOR_PAT
- Remove unnecessary string interpolations.
- `/#{SEPARATOR_PAT}/o` is always same as `SEPARATOR_PAT` Regexp.
2025-09-07 00:01:55 +09:00
Nobuyoshi Nakada
1a8536cce9
Transform the manpages using the given substitution 2025-09-06 22:42:27 +09:00
Nobuyoshi Nakada
de1feea72e
Increase the rehearsal count 2025-09-06 21:57:30 +09:00
BurdetteLamar
c0d168068f [DOC] Fix link 2025-09-06 07:17:52 +09:00
Burdette Lamar
6fe7626109
[DOC] Fix link in Regexp 2025-09-05 15:17:07 -07:00
Takashi Kokubun
72ddfc131f
ZJIT: Fix tests for ZJIT (#14460) 2025-09-05 15:08:21 -07:00
Takashi Kokubun
8aa885c460 test_gem_command_manager.rb: Fix the environment variable
The previous one failed:
https://github.com/ruby/ruby/actions/runs/17504307509/job/49724437021

$GITHUB_ACTION_REPOSITORY points to the owner of the action,
so it might not be ruby/ruby.
2025-09-05 14:18:49 -07:00
Takashi Kokubun
11275d13c1
ZJIT: Merge make check jobs (#14459) 2025-09-05 14:14:22 -07:00
Takashi Kokubun
cd07c3cbae test_gem_command_manager.rb: Skip an unstable test for ruby/ruby
This fails way too often these days, probably since
https://github.com/rubygems/rubygems/pull/8948.

To make sure we can merge ruby/ruby PRs, we need this to not fail
randomly.
2025-09-05 13:57:15 -07:00
Takashi Kokubun
ef3c3e6582
ZJIT: Stop optimizing toplevel locals (#14458) 2025-09-05 13:27:35 -07:00
Jun Aruga
c06e7046a6 CI: ubuntu-ibm.yml: Set the runner user's primary group from the "id -g".
Set the runner user's primary group to avoid a mismatch between the group IDs of
"id -g" and C function getpwuid(uid_t uid) pw_gid in a test as a better
workaround.
2025-09-05 21:08:59 +01:00
Jun Aruga
76deabd3db CI: ubuntu-ibm.yml: Fix a typo to print HOME env. 2025-09-05 21:08:59 +01:00
Takashi Kokubun
0ab7833773 ruby.c: Fallback FEATURE_BIT(jit) to FEATURE_BIT(zjit)
if it's the only JIT enabled in the build
2025-09-05 12:36:40 -07:00