Skip to content

Commit 0879d0d

Browse files
committed
Merge branch 'master' into dev/mmtk-overrides-default
2 parents 23e902d + bef59ed commit 0879d0d

File tree

134 files changed

+1737
-1493
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+1737
-1493
lines changed

Diff for: .gdbinit

+8-8
Original file line numberDiff line numberDiff line change
@@ -523,14 +523,14 @@ document rp_bignum
523523
end
524524

525525
define rp_class
526+
set $class_and_classext = (struct RClass_and_rb_classext_t *)($arg0)
526527
printf "(struct RClass *) %p", (void*)$arg0
527-
if RCLASS_ORIGIN((struct RClass *)($arg0)) != $arg0
528-
printf " -> %p", RCLASS_ORIGIN((struct RClass *)($arg0))
528+
if $class_and_classext->classext->origin_ != (VALUE)$arg0
529+
printf " -> %p", $class_and_classext->classext->origin_
529530
end
530531
printf "\n"
531532
rb_classname $arg0
532-
print/x *(struct RClass *)($arg0)
533-
print *RCLASS_EXT((struct RClass *)($arg0))
533+
print/x *$class_and_classext
534534
end
535535
document rp_class
536536
Print the content of a Class/Module.
@@ -896,10 +896,10 @@ document rb_method_entry
896896
end
897897

898898
define rb_classname
899-
# up to 128bit int
900-
set $rb_classname = rb_mod_name($arg0)
901-
if $rb_classname != RUBY_Qnil
902-
rp $rb_classname
899+
set $rb_classname = ((struct RClass_and_rb_classext_t*)$arg0)->classext->classpath
900+
if $rb_classname != RUBY_Qfalse
901+
print_string $rb_classname
902+
printf "\n"
903903
else
904904
echo anonymous class/module\n
905905
end

Diff for: .github/workflows/dependabot_automerge.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
# from https://github.com/gofiber/swagger/blob/main/.github/workflows/dependabot_automerge.yml
22
name: Dependabot auto-merge
33
on:
4-
pull_request_target:
4+
pull_request:
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
59

610
jobs:
711
automerge:
812
runs-on: ubuntu-latest
9-
10-
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
11-
13+
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'ruby/ruby'
1214
steps:
1315
- name: Dependabot metadata
1416
uses: dependabot/fetch-metadata@dbb049abf0d677abbd7f7eee0375145b417fdd34 # v2.2.0

Diff for: .github/workflows/windows.yml

+18-13
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,24 @@ jobs:
2525
strategy:
2626
matrix:
2727
include:
28-
- vc: 2015
29-
vs: 2019
28+
- os: 2019
29+
vc: 2015
3030
vcvars: '10.0.14393.0 -vcvars_ver=14.0' # The oldest Windows 10 SDK w/ VC++ 2015 toolset (v140)
3131
test_task: check
32-
- vs: 2019
32+
- os: 2019
33+
vc: 2019
3334
test_task: check
34-
- vs: 2019
35+
- os: 2022
36+
vc: 2019
37+
vcvars: '10.0.22621.0 -vcvars_ver=14.2' # The defautl Windows 11 SDK and toolset are broken at windows-2022
38+
test_task: check
39+
- os: 2022
40+
vc: 2019
41+
vcvars: '10.0.22621.0 -vcvars_ver=14.2'
3542
test_task: test-bundled-gems
36-
# - vs: 2022
37-
# test_task: check
3843
fail-fast: false
3944

40-
runs-on: windows-${{ matrix.vs < 2022 && '2019' || matrix.vs }}
45+
runs-on: windows-${{ matrix.os < 2022 && '2019' || matrix.os }}
4146

4247
if: >-
4348
${{!(false
@@ -49,11 +54,11 @@ jobs:
4954
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
5055
)}}
5156
52-
name: VisualStudio ${{ matrix.vc || matrix.vs }} (${{ matrix.test_task }})
57+
name: Windows ${{ matrix.os }}/Visual C++ ${{ matrix.vc }} (${{ matrix.test_task }})
5358

5459
env:
5560
GITPULLOPTIONS: --no-tags origin ${{ github.ref }}
56-
OS_VER: windows-${{ matrix.vs < 2022 && '2019' || matrix.vs }}
61+
OS_VER: windows-${{ matrix.os < 2022 && '2019' || matrix.os }}
5762
VCPKG_DEFAULT_TRIPLET: ${{ matrix.target || 'x64' }}-windows
5863

5964
steps:
@@ -105,7 +110,7 @@ jobs:
105110
run: |
106111
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
107112
Join-Path (Resolve-Path ~).Path "scoop\shims" >> $Env:GITHUB_PATH
108-
scoop install vcpkg
113+
scoop install vcpkg [email protected]
109114
shell: pwsh
110115

111116
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
@@ -123,7 +128,7 @@ jobs:
123128
# %TEMP% is inconsistent with %TMP% and test-all expects they are consistent.
124129
# https://github.com/actions/virtual-environments/issues/712#issuecomment-613004302
125130
run: |
126-
::- Set up VC ${{ matrix.vc || matrix.vs }}
131+
::- Set up VC ${{ matrix.vc }}
127132
set vswhere="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
128133
for /f "delims=;" %%I in ('%vswhere% -latest -property installationPath') do (
129134
set VCVARS="%%I\VC\Auxiliary\Build\vcvars64.bat"
@@ -179,7 +184,7 @@ jobs:
179184
- name: Set up Launchable
180185
uses: ./.github/actions/launchable/setup
181186
with:
182-
os: windows-${{ matrix.vs < 2022 && '2019' || matrix.vs }}
187+
os: windows-${{ matrix.os < 2022 && '2019' || matrix.os }}
183188
launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }}
184189
builddir: build
185190
srcdir: src
@@ -194,7 +199,7 @@ jobs:
194199

195200
- uses: ./.github/actions/slack
196201
with:
197-
label: VS${{ matrix.vc || matrix.vs }} / ${{ matrix.test_task || 'check' }}
202+
label: Windows ${{ matrix.os }} / VC ${{ matrix.vc }} / ${{ matrix.test_task || 'check' }}
198203
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
199204
if: ${{ failure() }}
200205

Diff for: CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
See ["Contributing to Ruby"](https://docs.ruby-lang.org/en/master/contributing_md.html), which includes setup and build instructions.
1+
See ["Contributing to Ruby"](https://docs.ruby-lang.org/en/master/contributing/contributing_md.html), which includes setup and build instructions.

Diff for: NEWS.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ The following bundled gems are promoted from default gems.
3434
* benchmark 0.4.0
3535
* logger 1.7.0
3636
* rdoc 6.13.1
37-
* win32ole 1.9.1
38-
* irb 1.15.1
39-
* reline 0.6.0
37+
* win32ole 1.9.2
38+
* irb 1.15.2
39+
* reline 0.6.1
4040
* readline 0.0.4
4141
* fiddle 1.1.6
4242

@@ -58,6 +58,7 @@ The following default gems are updated.
5858
* prism 1.4.0
5959
* psych 5.2.3
6060
* stringio 3.1.6
61+
* strscan 3.1.3
6162
* uri 1.0.3
6263

6364
The following bundled gems are added.
@@ -66,14 +67,15 @@ The following bundled gems are added.
6667
The following bundled gems are updated.
6768

6869
* minitest 5.25.5
70+
* test-unit 3.6.8
6971
* rexml 3.4.1
7072
* net-imap 0.5.6
7173
* net-smtp 0.5.1
7274
* rbs 3.9.2
7375
* bigdecimal 3.1.9
7476
* syslog 0.3.0
75-
* csv 3.3.3
76-
* repl_type_completor 0.1.10
77+
* csv 3.3.4
78+
* repl_type_completor 0.1.11
7779

7880
## Supported platforms
7981

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Bugs should be reported at https://bugs.ruby-lang.org. Read ["Reporting Issues"]
8585

8686
## Contributing
8787

88-
See ["Contributing to Ruby"](https://docs.ruby-lang.org/en/master/contributing_md.html), which includes setup and build instructions.
88+
See ["Contributing to Ruby"](https://docs.ruby-lang.org/en/master/contributing/contributing_md.html), which includes setup and build instructions.
8989

9090
## The Author
9191

Diff for: bootstraptest/test_method.rb

+8
Original file line numberDiff line numberDiff line change
@@ -1419,3 +1419,11 @@ def internal_foo = foo
14191419
"ok"
14201420
end
14211421
}
1422+
1423+
assert_equal 'ok', <<~RUBY
1424+
def test(*, kw: false)
1425+
"ok"
1426+
end
1427+
1428+
test
1429+
RUBY

Diff for: bootstraptest/test_ractor.rb

+22-1
Original file line numberDiff line numberDiff line change
@@ -1638,7 +1638,7 @@ class C
16381638
16391639
1_000.times { idle_worker, tmp_reporter = Ractor.select(*workers) }
16401640
"ok"
1641-
} if !yjit_enabled? || ENV['GITHUB_WORKFLOW'] == 'ModGC' # flaky
1641+
} if !yjit_enabled? && ENV['GITHUB_WORKFLOW'] != 'ModGC' # flaky
16421642

16431643
assert_equal "ok", %q{
16441644
def foo(*); ->{ super }; end
@@ -2103,3 +2103,24 @@ def ==(o)
21032103
:fail
21042104
end
21052105
}
2106+
2107+
# move objects inside frozen containers
2108+
assert_equal 'ok', %q{
2109+
ractor = Ractor.new { Ractor.receive }
2110+
obj = Array.new(10, 42)
2111+
original = obj.dup
2112+
ractor.send([obj].freeze, move: true)
2113+
roundtripped_obj = ractor.take[0]
2114+
roundtripped_obj == original ? :ok : roundtripped_obj
2115+
}
2116+
2117+
# move object with generic ivar
2118+
assert_equal 'ok', %q{
2119+
ractor = Ractor.new { Ractor.receive }
2120+
obj = Array.new(10, 42)
2121+
obj.instance_variable_set(:@array, [1])
2122+
2123+
ractor.send(obj, move: true)
2124+
roundtripped_obj = ractor.take
2125+
roundtripped_obj.instance_variable_get(:@array) == [1] ? :ok : roundtripped_obj
2126+
}

Diff for: class.c

+2-5
Original file line numberDiff line numberDiff line change
@@ -1004,9 +1004,8 @@ rb_define_class(const char *name, VALUE super)
10041004
}
10051005
klass = rb_define_class_id(id, super);
10061006
rb_vm_register_global_object(klass);
1007-
rb_const_set_raw(rb_cObject, id, klass);
1007+
rb_const_set(rb_cObject, id, klass);
10081008
rb_class_inherited(super, klass);
1009-
rb_const_added(klass, id);
10101009

10111010
return klass;
10121011
}
@@ -1044,10 +1043,8 @@ rb_define_class_id_under_no_pin(VALUE outer, ID id, VALUE super)
10441043
}
10451044
klass = rb_define_class_id(id, super);
10461045
rb_set_class_path_string(klass, outer, rb_id2str(id));
1047-
1048-
rb_const_set_raw(outer, id, klass);
1046+
rb_const_set(outer, id, klass);
10491047
rb_class_inherited(super, klass);
1050-
rb_const_added(outer, id);
10511048

10521049
return klass;
10531050
}

Diff for: compile.c

+13-2
Original file line numberDiff line numberDiff line change
@@ -2599,7 +2599,13 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
25992599
else {
26002600
body->is_entries = NULL;
26012601
}
2602-
body->call_data = ZALLOC_N(struct rb_call_data, body->ci_size);
2602+
2603+
if (body->ci_size) {
2604+
body->call_data = ZALLOC_N(struct rb_call_data, body->ci_size);
2605+
}
2606+
else {
2607+
body->call_data = NULL;
2608+
}
26032609
ISEQ_COMPILE_DATA(iseq)->ci_index = 0;
26042610

26052611
// Calculate the bitmask buffer size.
@@ -10749,7 +10755,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const no
1074910755
if (nd_fl_newline(node)) {
1075010756
int event = RUBY_EVENT_LINE;
1075110757
ISEQ_COMPILE_DATA(iseq)->last_line = line;
10752-
if (ISEQ_COVERAGE(iseq) && ISEQ_LINE_COVERAGE(iseq)) {
10758+
if (line > 0 && ISEQ_COVERAGE(iseq) && ISEQ_LINE_COVERAGE(iseq)) {
1075310759
event |= RUBY_EVENT_COVERAGE_LINE;
1075410760
}
1075510761
ADD_TRACE(ret, event);
@@ -13379,6 +13385,11 @@ ibf_load_ci_entries(const struct ibf_load *load,
1337913385
unsigned int ci_size,
1338013386
struct rb_call_data **cd_ptr)
1338113387
{
13388+
if (!ci_size) {
13389+
*cd_ptr = NULL;
13390+
return;
13391+
}
13392+
1338213393
ibf_offset_t reading_pos = ci_entries_offset;
1338313394

1338413395
unsigned int i;

Diff for: doc/exceptions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ divided by 0
181181

182182
Two read-only global variables always have `nil` value
183183
except in a rescue clause;
184-
there:
184+
they're:
185185

186186
- `$!`: contains the rescued exception.
187187
- `$@`: contains its backtrace.

Diff for: doc/windows.md

+39-17
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@ ridk enable ucrt64
2121
2222
pacman -S --needed %MINGW_PACKAGE_PREFIX%-openssl %MINGW_PACKAGE_PREFIX%-libyaml %MINGW_PACKAGE_PREFIX%-libffi
2323
24-
cd c:\
25-
mkdir work
26-
cd work
27-
git clone https://github.com/ruby/ruby
28-
29-
cd c:\work\ruby
30-
sh autogen.sh
31-
sh configure -C --disable-install-doc
24+
mkdir c:\work\ruby
25+
cd /d c:\work\ruby
26+
27+
git clone https://github.com/ruby/ruby src
28+
29+
sh ./src/autogen.sh
30+
31+
mkdir build
32+
cd build
33+
sh ../src/configure -C --disable-install-doc
3234
make
3335
```
3436

@@ -40,17 +42,24 @@ bash
4042

4143
pacman -S --needed $MINGW_PACKAGE_PREFIX-openssl $MINGW_PACKAGE_PREFIX-libyaml $MINGW_PACKAGE_PREFIX-libffi
4244

43-
cd /c/
44-
mkdir work
45-
cd work
46-
git clone https://github.com/ruby/ruby
47-
cd ruby
45+
mkdir /c/work/ruby
46+
cd /c/work/ruby
47+
48+
git clone https://github.com/ruby/ruby src
4849

49-
./autogen.sh
50-
./configure -C --disable-install-doc
50+
./src/autogen.sh
51+
cd build
52+
../src/configure -C --disable-install-doc
5153
make
5254
```
5355

56+
If you have other MSYS2 environment via other package manager like `scoop`, you need to specify `$MINGW_PACKAGE_PREFIX` is `mingw-w64-ucrt-x86_64`.
57+
And you need to add `--with-opt-dir` option to `configure` command like:
58+
59+
```batch
60+
sh ../../ruby/configure -C --disable-install-doc --with-opt-dir=C:\Users\username\scoop\apps\msys2\current\ucrt64
61+
```
62+
5463
[RubyInstaller-Devkit]: https://rubyinstaller.org/
5564
[git-for-windows]: https://gitforwindows.org/
5665
[VSCode]: https://code.visualstudio.com/
@@ -66,6 +75,12 @@ make
6675
**Note** if you want to build x64 version, use native compiler for
6776
x64.
6877

78+
The minimum requirement is here:
79+
* VC++/MSVC on VS 2017/2019 version build tools.
80+
* Visual Studio 2022 17.13.x is broken. see https://bugs.ruby-lang.org/issues/21167
81+
* Windows 10/11 SDK
82+
* 10.0.26100 is broken, 10.0.22621 is recommended. see https://bugs.ruby-lang.org/issues/21255
83+
6984
3. Please set environment variable `INCLUDE`, `LIB`, `PATH`
7085
to run required commands properly from the command line.
7186
These are set properly by `vcvarall*.bat` usually.
@@ -80,13 +95,20 @@ make
8095

8196
4. If you want to build from GIT source, following commands are required.
8297
* `git`
83-
* `sed`
8498
* `ruby` 3.0 or later
8599

86100
You can use [scoop](https://scoop.sh/) to install them like:
87101

88102
```batch
89-
scoop install git sed ruby
103+
scoop install git ruby
104+
```
105+
106+
The windows version of `git` configured with `autocrlf` is `true`. The Ruby
107+
test suite may fail with `autocrlf` set to `true`. You can set it to `false`
108+
like:
109+
110+
```batch
111+
git config --global core.autocrlf false
90112
```
91113
92114
5. You need to install required libraries using [vcpkg](https://vcpkg.io/) on

0 commit comments

Comments
 (0)