Skip to content

Commit c7fca03

Browse files
committed
Merge branch 'master' into dev/mmtk-overrides-default
2 parents e4f5cb7 + 3861e50 commit c7fca03

323 files changed

Lines changed: 6891 additions & 6065 deletions

File tree

Some content is hidden

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

‎.github/actions/capiext/action.yml‎

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: rubyspec C-API extensions
2+
3+
inputs:
4+
builddir:
5+
required: false
6+
default: '.'
7+
make:
8+
required: false
9+
default: 'make -s'
10+
11+
outputs:
12+
key:
13+
value: >-
14+
${{
15+
!steps.restore.outputs.cache-hit &&
16+
github.ref == 'refs/heads/master' &&
17+
steps.config.outputs.key
18+
}}
19+
20+
runs:
21+
using: composite
22+
23+
steps:
24+
- id: config
25+
shell: bash
26+
run: |
27+
eval $(grep -e '^arch *=' -e '^ruby_version *=' -e '^DLEXT *=' Makefile |
28+
sed 's/ *= */=/')
29+
case "${ruby_version}" in
30+
*+*) key=capiexts-${arch}-${ruby_version};;
31+
*) key=;;
32+
esac
33+
echo version=$ruby_version >> $GITHUB_OUTPUT
34+
echo key=$key >> $GITHUB_OUTPUT
35+
echo DLEXT=$DLEXT >> $GITHUB_OUTPUT
36+
working-directory: ${{ inputs.builddir }}
37+
38+
- name: Restore previous CAPI extensions
39+
uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
40+
id: cache
41+
with:
42+
path: ${{ inputs.builddir }}/spec/ruby/optional/capi/ext/
43+
key: ${{ steps.config.outputs.key }}
44+
if: ${{ steps.config.outputs.key }}
45+
46+
- name: Run test-spec with previous CAPI extension binaries
47+
id: check
48+
shell: bash
49+
run: |
50+
touch spec/ruby/optional/capi/ext/*.$DLEXT
51+
[ ! -f spec/ruby/optional/capi/ext/\*.$DLEXT ]
52+
${{ inputs.make }} SPECOPTS=optional/capi test-spec
53+
env:
54+
DLEXT: ${{ steps.config.outputs.DLEXT }}
55+
working-directory: ${{ inputs.builddir }}
56+
if: ${{ steps.cache.outputs.cache-hit }}
57+
58+
- name: Strip CAPI extensions
59+
id: strip
60+
shell: bash
61+
run: |
62+
rm -f spec/ruby/optional/capi/ext/*.c
63+
[ "$DLEXT" = bundle ] || # separated to .dSYM directories
64+
strip spec/ruby/optional/capi/ext/*.$DLEXT
65+
env:
66+
DLEXT: ${{ steps.config.outputs.DLEXT }}
67+
working-directory: ${{ inputs.builddir }}
68+
if: >-
69+
${{true
70+
&& ! steps.cache.outputs.cache-hit
71+
&& github.ref_name == 'master'
72+
}}
73+
74+
- name: Save CAPI extensions
75+
uses: actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
76+
with:
77+
path: ${{ inputs.builddir }}/spec/ruby/optional/capi/ext/
78+
key: ${{ steps.config.outputs.key }}
79+
if: ${{ steps.strip.outcome == 'success' }}
80+
81+
- shell: bash
82+
run: |
83+
echo "::error::Change from ${prev} detected; bump up ABI version"
84+
env:
85+
prev: ${{ steps.config.outputs.version }}
86+
if: ${{ always() && steps.check.outcome == 'failure' }}

‎.github/auto_request_review.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ files:
1111
'doc/zjit*': [team:jit]
1212
'test/ruby/test_zjit*': [team:jit]
1313
'defs/jit.mk': [team:jit]
14+
# Skip github workflow files because the team don't necessarily need to review dependabot updates for GitHub Actions. It's noisy in notifications, and they're auto-merged anyway.
1415
options:
1516
ignore_draft: true
1617
# This currently doesn't work as intended. We want to skip reviews when only

‎.github/workflows/compilers.yml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@ jobs:
281281
- { uses: './.github/actions/compilers', name: 'GC_PROFILE_MORE_DETAIL', with: { cppflags: '-DGC_PROFILE_MORE_DETAIL' } }
282282
- { uses: './.github/actions/compilers', name: 'MALLOC_ALLOCATED_SIZE_CHECK', with: { cppflags: '-DMALLOC_ALLOCATED_SIZE_CHECK' } }
283283
- { uses: './.github/actions/compilers', name: 'RGENGC_ESTIMATE_OLDMALLOC', with: { cppflags: '-DRGENGC_ESTIMATE_OLDMALLOC' } }
284-
- { uses: './.github/actions/compilers', name: 'RGENGC_OBJ_INFO', with: { cppflags: '-DRGENGC_OBJ_INFO' } }
285284
- { uses: './.github/actions/compilers', name: 'RGENGC_PROFILE', with: { cppflags: '-DRGENGC_PROFILE' } }
286285

287286
compileC:
@@ -297,9 +296,6 @@ jobs:
297296
- { uses: './.github/actions/setup/directories', with: { srcdir: 'src', builddir: 'build', makeup: true, fetch-depth: 10 } }
298297
- { uses: './.github/actions/compilers', name: 'VM_DEBUG_BP_CHECK', with: { cppflags: '-DVM_DEBUG_BP_CHECK' } }
299298
- { uses: './.github/actions/compilers', name: 'VM_DEBUG_VERIFY_METHOD_CACHE', with: { cppflags: '-DVM_DEBUG_VERIFY_METHOD_CACHE' } }
300-
- { uses: './.github/actions/compilers', name: 'enable-yjit', with: { append_configure: '--enable-yjit' } }
301-
- { uses: './.github/actions/compilers', name: 'enable-{y,z}jit', with: { append_configure: '--enable-yjit --enable-zjit' } }
302-
- { uses: './.github/actions/compilers', name: 'enable-{y,z}jit=dev', with: { append_configure: '--enable-yjit=dev --enable-zjit' } }
303299
- { uses: './.github/actions/compilers', name: 'YJIT_FORCE_ENABLE', with: { cppflags: '-DYJIT_FORCE_ENABLE' } }
304300
- { uses: './.github/actions/compilers', name: 'UNIVERSAL_PARSER', with: { cppflags: '-DUNIVERSAL_PARSER' } }
305301

‎.github/workflows/dependabot_automerge.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
id: metadata
1818

1919
- name: Wait for status checks
20-
uses: lewagon/wait-on-check-action@0dceb95e7c4cad8cc7422aee3885998f5cab9c79 # v1.4.0
20+
uses: lewagon/wait-on-check-action@3603e826ee561ea102b58accb5ea55a1a7482343 # v1.4.1
2121
with:
2222
repo-token: ${{ secrets.GITHUB_TOKEN }}
2323
ref: ${{ github.event.pull_request.head.sha || github.sha }}

‎.github/workflows/macos.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
os: macos-14
4646
- test_task: check
4747
os: macos-15
48+
extra_checks: [capi]
4849
- test_task: check
4950
os: macos-13
5051
fail-fast: false
@@ -159,6 +160,14 @@ jobs:
159160
if: ${{ matrix.test_task == 'check' && matrix.skipped_tests }}
160161
continue-on-error: ${{ matrix.continue-on-skipped_tests || false }}
161162

163+
- name: CAPI extensions
164+
uses: ./.github/actions/capiext
165+
with:
166+
builddir: build
167+
env:
168+
RUBY_TESTOPTS: '-v --tty=no'
169+
if: ${{ contains(matrix.extra_checks, 'capi') }}
170+
162171
- uses: ./.github/actions/slack
163172
with:
164173
label: ${{ matrix.os }} / ${{ matrix.test_task }}

‎.github/workflows/ubuntu.yml‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ jobs:
3939
- test_task: test-bundled-gems
4040
- test_task: check
4141
os: ubuntu-24.04
42-
# ubuntu-24.04-arm jobs don't start on ruby/ruby as of 2025-09-04
43-
#- test_task: check
44-
# os: ubuntu-24.04-arm
42+
extra_checks: [capi]
43+
- test_task: check
44+
os: ubuntu-24.04-arm
45+
extra_checks: [capi]
4546
fail-fast: false
4647

4748
env:
@@ -152,6 +153,15 @@ jobs:
152153
DESTDIR=${RUNNER_TEMP-${TMPDIR-/tmp}}/installed
153154
$SETARCH make test-pc "DESTDIR=$DESTDIR"
154155
156+
- name: CAPI extensions
157+
uses: ./.github/actions/capiext
158+
with:
159+
builddir: build
160+
make: '$SETARCH make'
161+
env:
162+
RUBY_TESTOPTS: '-v --tty=no'
163+
if: ${{ contains(matrix.extra_checks, 'capi') }}
164+
155165
- uses: ./.github/actions/slack
156166
with:
157167
label: ${{ matrix.test_task }} ${{ matrix.configure }}${{ matrix.arch }}

‎.github/workflows/yjit-macos.yml‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,10 @@ jobs:
115115
ruby -ne 'raise "Disassembly seems broken in dev build (output has too few lines)" unless $_.to_i > 10'
116116
if: ${{ contains(matrix.configure, 'jit=dev') }}
117117

118-
- name: Enable YJIT through ENV
119-
run: echo "RUBY_YJIT_ENABLE=1" >> $GITHUB_ENV
118+
- name: Set ENV for YJIT
119+
run: |
120+
echo "RUBY_YJIT_ENABLE=1" >> $GITHUB_ENV
121+
echo "RUBY_CRASH_REPORT=$(pwd)/rb_crash_%p.txt" >> $GITHUB_ENV
120122
121123
- name: Set test options for skipped tests
122124
run: |
@@ -143,6 +145,7 @@ jobs:
143145
test -n "${LAUNCHABLE_STDOUT}" && exec 1> >(tee "${LAUNCHABLE_STDOUT}")
144146
test -n "${LAUNCHABLE_STDERR}" && exec 2> >(tee "${LAUNCHABLE_STDERR}")
145147
148+
set -x
146149
make -s ${{ matrix.test_task }} ${TESTS:+TESTS="$TESTS"} \
147150
RUN_OPTS="$RUN_OPTS" \
148151
SPECOPTS="$SPECOPTS"
@@ -166,6 +169,10 @@ jobs:
166169
if: ${{ matrix.test_task == 'check' && matrix.skipped_tests }}
167170
continue-on-error: ${{ matrix.continue-on-skipped_tests || false }}
168171

172+
- if: ${{ failure() }}
173+
continue-on-error: true
174+
run: tail --verbose --lines=+1 rb_crash_*.txt
175+
169176
- uses: ./.github/actions/slack
170177
with:
171178
label: ${{ matrix.test_task }} ${{ matrix.configure }} ${{ matrix.yjit_opts }}

‎.github/workflows/yjit-ubuntu.yml‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ jobs:
145145
if: ${{ matrix.rust_version }}
146146
run: rustup install ${{ matrix.rust_version }} --profile minimal
147147

148+
- name: Remove cargo
149+
# Since this tests a `rustc` build for release, remove `cargo` to ensure
150+
# that only `rustc` is used.
151+
if: ${{ contains(matrix.configure, 'rustc') }}
152+
run: sudo rm $(which -a cargo | uniq)
153+
148154
- name: Run configure
149155
run: ../src/configure -C --disable-install-doc --prefix=$(pwd)/install ${{ matrix.configure }}
150156

@@ -162,8 +168,10 @@ jobs:
162168
ruby -ne 'raise "Disassembly seems broken in dev build (output has too few lines)" unless $_.to_i > 10'
163169
if: ${{ contains(matrix.configure, 'jit=dev') }}
164170

165-
- name: Enable YJIT through ENV
166-
run: echo "RUBY_YJIT_ENABLE=1" >> $GITHUB_ENV
171+
- name: Set ENV for YJIT
172+
run: |
173+
echo "RUBY_YJIT_ENABLE=1" >> $GITHUB_ENV
174+
echo "RUBY_CRASH_REPORT=$(pwd)/rb_crash_%p.txt" >> $GITHUB_ENV
167175
168176
# Check that the binary was built with YJIT
169177
- name: Check YJIT enabled
@@ -187,6 +195,7 @@ jobs:
187195
test -n "${LAUNCHABLE_STDOUT}" && exec 1> >(tee "${LAUNCHABLE_STDOUT}")
188196
test -n "${LAUNCHABLE_STDERR}" && exec 2> >(tee "${LAUNCHABLE_STDERR}")
189197
198+
set -x
190199
make -s ${{ matrix.test_task }} ${TESTS:+TESTS="$TESTS"} \
191200
RUN_OPTS="$RUN_OPTS" MSPECOPT=--debug SPECOPTS="$SPECOPTS" \
192201
YJIT_BENCH_OPTS="$YJIT_BENCH_OPTS" YJIT_BINDGEN_DIFF_OPTS="$YJIT_BINDGEN_DIFF_OPTS"
@@ -202,6 +211,11 @@ jobs:
202211
LAUNCHABLE_STDERR: ${{ steps.launchable.outputs.stderr_report_path }}
203212
continue-on-error: ${{ matrix.continue-on-test_task || false }}
204213

214+
- name: Dump crash logs
215+
if: ${{ failure() }}
216+
continue-on-error: true
217+
run: tail --verbose --lines=+1 rb_crash_*.txt
218+
205219
- uses: ./.github/actions/slack
206220
with:
207221
label: ${{ matrix.test_task }} ${{ matrix.configure }}

‎.github/workflows/zjit-macos.yml‎

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,15 @@ jobs:
3333
matrix:
3434
include:
3535
- test_task: 'check'
36-
configure: '--enable-zjit=dev'
3736
run_opts: '--zjit-call-threshold=1'
3837
specopts: '-T --zjit-call-threshold=1'
38+
configure: '--enable-zjit=dev'
39+
test_all_opts: '--seed=46450'
40+
41+
- test_task: 'check'
42+
run_opts: '--zjit-call-threshold=1 --zjit-disable-hir-opt'
43+
specopts: '-T --zjit-call-threshold=1 -T --zjit-disable-hir-opt'
44+
configure: '--enable-zjit=dev'
3945
test_all_opts: '--seed=46450'
4046

4147
- test_task: 'zjit-check' # zjit-test + quick feedback of test_zjit.rb
@@ -51,6 +57,7 @@ jobs:
5157
RUN_OPTS: ${{ matrix.run_opts }}
5258
SPECOPTS: ${{ matrix.specopts }}
5359
TESTOPTS: ${{ matrix.testopts }}
60+
ZJIT_RB_BUG: 1
5461

5562
runs-on: macos-14
5663

@@ -106,12 +113,17 @@ jobs:
106113
ruby -ne 'raise "Disassembly seems broken in dev build (output has too few lines)" unless $_.to_i > 10'
107114
if: ${{ contains(matrix.configure, 'jit=dev') }}
108115

116+
- name: Set ENV for ZJIT
117+
run: |
118+
echo "RUBY_CRASH_REPORT=$(pwd)/rb_crash_%p.txt" >> $GITHUB_ENV
119+
109120
- name: make ${{ matrix.test_task }}
110-
run: >-
111-
make -s ${{ matrix.test_task }} ${TESTS:+TESTS="$TESTS"}
112-
RUN_OPTS="$RUN_OPTS"
113-
SPECOPTS="$SPECOPTS"
114-
TESTOPTS="$TESTOPTS"
121+
run: |
122+
set -x
123+
make -s ${{ matrix.test_task }} ${TESTS:+TESTS="$TESTS"} \
124+
RUN_OPTS="$RUN_OPTS" \
125+
SPECOPTS="$SPECOPTS" \
126+
TESTOPTS="$TESTOPTS"
115127
timeout-minutes: 60
116128
env:
117129
RUBY_TESTOPTS: '-q --tty=no'
@@ -121,6 +133,11 @@ jobs:
121133
TESTS: ${{ matrix.test_all_opts }}
122134
continue-on-error: ${{ matrix.continue-on-test_task || false }}
123135

136+
- name: Dump crash logs
137+
if: ${{ failure() }}
138+
continue-on-error: true
139+
run: tail --verbose --lines=+1 rb_crash_*.txt
140+
124141
- uses: ./.github/actions/slack
125142
with:
126143
label: ${{ matrix.test_task }} ${{ matrix.configure }}

‎.github/workflows/zjit-ubuntu.yml‎

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,15 @@ jobs:
5252
matrix:
5353
include:
5454
- test_task: 'check'
55-
configure: '--enable-zjit=dev'
5655
run_opts: '--zjit-call-threshold=1'
5756
specopts: '-T --zjit-call-threshold=1'
57+
configure: '--enable-zjit=dev'
58+
test_all_opts: '--seed=39471'
59+
60+
- test_task: 'check'
61+
run_opts: '--zjit-call-threshold=1 --zjit-disable-hir-opt'
62+
specopts: '-T --zjit-call-threshold=1 -T --zjit-disable-hir-opt'
63+
configure: '--enable-zjit=dev'
5864
test_all_opts: '--seed=39471'
5965

6066
- test_task: 'zjit-check' # zjit-test + quick feedback of test_zjit.rb
@@ -75,6 +81,7 @@ jobs:
7581
RUBY_DEBUG: ci
7682
BUNDLE_JOBS: 8 # for yjit-bench
7783
RUST_BACKTRACE: 1
84+
ZJIT_RB_BUG: 1
7885

7986
runs-on: ubuntu-22.04
8087

@@ -146,12 +153,17 @@ jobs:
146153
run: ./miniruby --zjit -v | grep "+ZJIT"
147154
if: ${{ matrix.configure != '--disable-zjit' }}
148155

156+
- name: Set ENV for ZJIT
157+
run: |
158+
echo "RUBY_CRASH_REPORT=$(pwd)/rb_crash_%p.txt" >> $GITHUB_ENV
159+
149160
- name: make ${{ matrix.test_task }}
150-
run: >-
151-
make -s ${{ matrix.test_task }} ${TESTS:+TESTS="$TESTS"}
152-
RUN_OPTS="$RUN_OPTS" MSPECOPT=--debug SPECOPTS="$SPECOPTS"
153-
TESTOPTS="$TESTOPTS"
154-
ZJIT_BINDGEN_DIFF_OPTS="$ZJIT_BINDGEN_DIFF_OPTS"
161+
run: |
162+
set -x
163+
make -s ${{ matrix.test_task }} ${TESTS:+TESTS="$TESTS"} \
164+
RUN_OPTS="$RUN_OPTS" MSPECOPT=--debug SPECOPTS="$SPECOPTS" \
165+
TESTOPTS="$TESTOPTS" \
166+
ZJIT_BINDGEN_DIFF_OPTS="$ZJIT_BINDGEN_DIFF_OPTS"
155167
timeout-minutes: 90
156168
env:
157169
RUBY_TESTOPTS: '-q --tty=no'
@@ -163,6 +175,11 @@ jobs:
163175
TESTS: ${{ matrix.test_all_opts }}
164176
continue-on-error: ${{ matrix.continue-on-test_task || false }}
165177

178+
- name: Dump crash logs
179+
if: ${{ failure() }}
180+
continue-on-error: true
181+
run: tail --verbose --lines=+1 rb_crash_*.txt
182+
166183
- uses: ./.github/actions/slack
167184
with:
168185
label: ${{ matrix.test_task }} ${{ matrix.configure }}

0 commit comments

Comments
 (0)