8000 Merge branch 'main' into split-register-allocation · github/ruby@ae89704 · GitHub
[go: up one dir, main page]

Skip to content

Commit ae89704

Browse files
authored
Merge branch 'main' into split-register-allocation
2 parents 5f6a261 + 746efc8 commit ae89704

File tree

314 files changed

+5764
-4535
lines changed

Some content is hidden

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

314 files changed

+5764
-4535
lines changed

.github/codeql/codeql-config.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
name: "CodeQL config for the Ruby language"
22

3-
paths-ignore:
4-
- '/ext/**/*/conftest.c'
3+
languages: cpp

.github/workflows/baseruby.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ jobs:
4242
}
4343
env:
4444
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
45-
if: failure() && github.event_name == 'push'
45+
if: ${{ failure() && github.event_name == 'push' }}

.github/workflows/check_dependencies.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ jobs:
1313
set -x
1414
sudo apt-get update -q || :
1515
sudo apt-get install --no-install-recommends -q -y build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev bison autoconf ruby
16-
if: "contains(matrix.os, 'ubuntu')"
16+
if: ${{ contains(matrix.os, 'ubuntu') }}
1717
- name: Install libraries
1818
run: |
1919
brew upgrade
2020
brew install gmp libffi openssl@1.1 zlib autoconf automake libtool readline
21-
if: "contains(matrix.os, 'macos')"
21+
if: ${{ contains(matrix.os, 'macos') }}
2222
- name: git config
2323
run: |
2424
git config --global advice.detachedHead 0
@@ -42,4 +42,4 @@ jobs:
4242
}
4343
env:
4444
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
45-
if: failure() && github.event_name == 'push'
45+
if: ${{ failure() && github.event_name == 'push' }}

.github/workflows/codeql-analysis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,13 @@ jobs:
2121
2222
- name: Checkout repository
2323
uses: actions/checkout@v2
24-
with:
25-
fetch-depth: 2
2624

2725
- name: Remove an obsolete rubygems vendored file
2826
run: sudo rm /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb
2927

3028
- name: Initialize CodeQL
3129
uses: github/codeql-action/init@v1
3230
with:
33-
languages: cpp
3431
config-file: ./.github/codeql/codeql-config.yml
3532

3633
- name: Autobuild

.github/workflows/compilers.yml

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ name: Compilations
33
on: [push, pull_request]
44

55
# Github actions does not support YAML anchors. This creative use of
6-
# environment variables (plus the "echo ::set-env" hack) is to reroute that
6+
# environment variables (plus the "echo $GITHUB_ENV" hack) is to reroute that
77
# restriction.
88
env:
9-
default_cc: clang-13
9+
default_cc: clang-14
1010
append_cc: ''
1111
crosshost: ''
1212

1313
# -O1 is faster than -O3 in our tests... Majority of time are consumed trying
14-
# to optimize binaries. Also Github Actions runs on a relatively modern CPU
14+
# to optimize binaries. Also Github Actions run on relatively modern CPUs
1515
# compared to, say, GCC 4 or Clang 3. We don't specify `-march=native`
1616
# because compilers tend not understand what the CPU is.
1717
optflags: '-O1'
@@ -55,6 +55,7 @@ jobs:
5555
- { key: default_cc, name: gcc-6, value: gcc-6, container: gcc-6 }
5656
- { key: default_cc, name: gcc-5, value: gcc-5, container: gcc-5 }
5757
- { key: default_cc, name: gcc-4.8, value: gcc-4.8, container: gcc-4.8 }
58+
- { key: default_cc, name: clang-14, value: clang-14, container: clang-14 }
5859
- { key: default_cc, name: clang-13, value: clang-13, container: clang-13 }
5960
- { key: default_cc, name: clang-12, value: clang-12, container: clang-12 }
6061
- { key: default_cc, name: clang-11, value: clang-11, container: clang-11 }
@@ -87,7 +88,7 @@ jobs:
8788
- { key: CXXFLAGS, name: c++2a, value: '-std=c++2a -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' }
8889

8990
- { key: optflags, name: '-O0', value: '-O0 -march=x86-64 -mtune=generic' }
90-
# - { key: optflags, name: '-O3', value: '-O3 -march=x86-64 -mtune=generic' }
91+
# - { key: optflags, name: '-O3', value: '-O3 -march=x86-64 -mtune=generic', check: true }
9192

9293
- { key: append_configure, name: gmp, value: '--with-gmp' }
9394
- { key: append_configure, name: jemalloc, value: '--with-jemalloc' }
@@ -157,7 +158,7 @@ jobs:
157158

158159
name: ${{ matrix.entry.name }}
159160
runs-on: ubuntu-latest
160-
container: ghcr.io/ruby/ruby-ci-image:${{ matrix.entry.container || 'clang-13' }}
161+
container: ghcr.io/ruby/ruby-ci-image:${{ matrix.entry.container || 'clang-14' }}
161162
steps:
162163
- run: mkdir build
163164
working-directory:
@@ -171,33 +172,26 @@ jobs:
171172
- run: ./autogen.sh
172173
working-directory: src
173174
- name: Run configure
174-
run: |
175-
if [ -n "${crosshost}" ]; then
176-
../src/configure -C \
177-
${default_configure} \
178-
${append_configure} \
179-
--host="${crosshost}"
180-
else
181-
../src/configure -C \
182-
${default_configure} \
183-
${append_configure} \
184-
--with-gcc="${default_cc} ${append_cc}"
185-
fi
175+
run: ../src/configure -C ${default_configure} ${append_configure} --with-gcc="${default_cc} ${append_cc}"
176+
if: ${{ matrix.entry.key != 'crosshost' }}
177+
- name: Run cross configure
178+
run: ../src/configure -C ${default_configure} ${append_configure} --host="${crosshost}"
179+
if: ${{ matrix.entry.key == 'crosshost' }}
186180
- run: $make extract-extlibs
187181
- run: $make incs
188182
- run: $make
189183
# - run: $make leaked-globals
190184
- run: $make test
191185
- run: $make install
192-
if: "matrix.entry.name == '-O3'"
186+
if: ${{ matrix.entry.check }}
193187
- run: /usr/local/bin/gem install --no-doc timezone tzinfo
194-
if: "matrix.entry.name == '-O3'"
188+
if: ${{ matrix.entry.check }}
195189
- run: $make test-tool
196-
if: "matrix.entry.name == '-O3'"
190+
if: ${{ matrix.entry.check }}
197191
- run: $make test-all TESTS='-- ruby -ext-'
198-
if: "matrix.entry.name == '-O3'"
192+
if: ${{ matrix.entry.check }}
199193
- run: $make test-spec
200-
if: "matrix.entry.name == '-O3'"
194+
if: ${{ matrix.entry.check }}
201195

202196
- uses: k0kubun/action-slack@v2.0.0
203197
with:
@@ -211,7 +205,7 @@ jobs:
211205
}
212206
env:
213207
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
214-
if: failure() && github.event_name == 'push'
208+
if: ${{ failure() && github.event_name == 'push' }}
215209

216210
defaults:
217211
run:

.github/workflows/macos.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
# - run: make leaked-globals
3737
# if: matrix.test_task == 'check'
3838
- run: make prepare-gems
39-
if: matrix.test_task == 'check'
39+
if: ${{ matrix.test_task == 'check' }}
4040
- run: make $JOBS -s ${{ matrix.test_task }}
4141
timeout-minutes: 60
4242
env:
@@ -54,7 +54,7 @@ jobs:
5454
}
5555
env:
5656
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
57-
if: failure() && github.event_name == 'push'
57+
if: ${{ failure() && github.event_name == 'push' }}
5858

5959
defaults:
6060
run:

.github/workflows/mingw.disabled

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ jobs:
136136
}
137137
env:
138138
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
139-
if: failure() && github.event_name == 'push'
139+
if: ${{ failure() && github.event_name == 'push' }}
140140

141141
defaults:
142142
run:

.github/workflows/mjit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
}
7171
env:
7272
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
73-
if: failure() && github.event_name == 'push'
73+
if: ${{ failure() && github.event_name == 'push' }}
7474

7575
defaults:
7676
run:

.github/workflows/spec_guards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ jobs:
3535
}
3636
env:
3737
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
38-
if: failure() && github.event_name == 'push'
38+
if: ${{ failure() && github.event_name == 'push' }}

.github/workflows/ubuntu.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ jobs:
5050
# - run: make leaked-globals
5151
# if: matrix.test_task == 'check'
5252
- run: make prepare-gems
53-
if: matrix.test_task == 'check'
53+
if: ${{ matrix.test_task == 'check' }}
5454
- name: Create dummy files in build dir
5555
run: |
5656
./miniruby -e '(("a".."z").to_a+("A".."Z").to_a+("0".."9").to_a+%w[foo bar test zzz]).each{|basename|File.write("#{basename}.rb", "raise %(do not load #{basename}.rb)")}'
57-
if: matrix.test_task == 'check'
57+
if: ${{ matrix.test_task == 'check' }}
5858
- run: make $JOBS -s ${{ matrix.test_task }}
5959
timeout-minutes: 60
6060
env:
@@ -72,7 +72,7 @@ jobs:
7272
}
7373
env:
7474
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
75-
if: failure() && github.event_name == 'push'
75+
if: ${{ failure() && github.event_name == 'push' }}
7676

7777
defaults:
7878
run:

.github/workflows/windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
}
9393
env:
9494
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
95-
if: failure() && github.event_name == 'push'
95+
if: ${{ failure() && github.event_name == 'push' }}
9696

9797
defaults:
9898
run:

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ matrix:
123123
- <<: *ppc64le-linux
124124
- <<: *s390x-linux
125125
allow_failures:
126-
# An arm64 job sometimes does not start right now.
127-
# https://travis-ci.community/t/11629
126+
# The "TestReadline#test_interrupt_in_other_thread" started failing on arm32
127+
# from https://www.travis-ci.com/github/ruby/ruby/jobs/529005145
128128
- name: arm32-li 10000 nux
129-
- name: arm64-linux
129+
# - name: arm64-linux
130130
# - name: ppc64le-linux
131131
# - name: s390x-linux
132132
fast_finish: true

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,4 +218,5 @@ Excluding feature bug fixes.
218218
[Feature #17470]: https://bugs.ruby-lang.org/issues/17470
219219
[Feature #17853]: https://bugs.ruby-lang.org/issues/17853
220220
[Bug #17827]: https://bugs.ruby-lang.org/issues/17827
221+
[Feature #18008]: https://bugs.ruby-lang.org/issues/18008
221222
[Feature #18015]: https://bugs.ruby-lang.org/issues/18015

array.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2668,9 +2668,7 @@ rb_ary_length(VALUE ary)
26682668
static VALUE
26692669
rb_ary_empty_p(VALUE ary)
26702670
{
2671-
if (RARRAY_LEN(ary) == 0)
2672-
return Qtrue;
2673-
return Qfalse;
2671+
return RBOOL(RARRAY_LEN(ary) == 0);
26742672
}
26752673

26762674
VALUE

ast.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ ast_s_of(rb_execution_context_t *ec, VALUE module, VALUE body, VALUE save_script
213213
else {
214214
iseq = rb_method_iseq(body);
215215
}
216+
if (rb_iseq_from_eval_p(iseq)) {
217+
rb_raise(rb_eArgError, "cannot get AST for method defined in eval");
218+
}
216219
path = rb_iseq_path(iseq);
217220
node_id = iseq->body->location.node_id;
218221
}

bignum.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,6 +1053,7 @@ integer_unpack_num_bdigits(size_t numwords, size_t wordsize, size_t nails, int *
10531053
size_t num_bdigits1 = integer_unpack_num_bdigits_generic(numwords, wordsize, nails, &nlp_bits1);
10541054
assert(num_bdigits == num_bdigits1);
10551055
assert(*nlp_bits_ret == nlp_bits1);
1056+
(void)num_bdigits1;
10561057
}
10571058
#endif
10581059
}
@@ -3401,6 +3402,7 @@ rb_absint_numwords(VALUE val, size_t word_numbits, size_t *nlz_bits_ret)
34013402
numwords0 = absint_numwords_generic(numbytes, nlz_bits_in_msbyte, word_numbits, &nlz_bits0);
34023403
assert(numwords0 == numwords);
34033404
assert(nlz_bits0 == nlz_bits);
3405+
(void)numwords0;
34043406
}
34053407
#endif
34063408
}

common.mk

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,35 +766,49 @@ $(arch)-fake.rb: $(srcdir)/template/fake.rb.in $(tooldir)/generic_erb.rb version
766766
btest: $(TEST_RUNNABLE)-btest
767767
no-btest: PHONY
768768
yes-btest: fake miniruby$(EXEEXT) PHONY
769+
$(ACTIONS_GROUP)
769770
$(Q)$(exec) $(BOOTSTRAPRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(BTESTRUBY) $(RUN_OPTS)" $(OPTS) $(TESTOPTS) $(BTESTS)
771+
$(ACTIONS_ENDGROUP)
770772

771773
btest-ruby: $(TEST_RUNNABLE)-btest-ruby
772774
no-btest-ruby: PHONY
773775
yes-btest-ruby: prog PHONY
776+
$(ACTIONS_GROUP)
774777
$(Q)$(exec) $(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM) -I$(srcdir)/lib $(RUN_OPTS)" -q $(OPTS) $(TESTOPTS) $(BTESTS)
778+
$(ACTIONS_ENDGROUP)
775779

776780
rtest: fake miniruby$(EXEEXT) PHONY
781+
$(ACTIONS_GROUP)
777782
$(Q)$(exec) $(BOOTSTRAPRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(BTESTRUBY) $(RUN_OPTS)" --sets=ractor -v
783+
$(ACTIONS_ENDGROUP)
778784

779785
test-basic: $(TEST_RUNNABLE)-test-basic
780786
no-test-basic: PHONY
781787
yes-test-basic: prog PHONY
788+
$(ACTIONS_GROUP)
782789
$(Q)$(exec) $(RUNRUBY) "$(srcdir)/basictest/runner.rb" --run-opt=$(RUN_OPTS) $(OPTS) $(TESTOPTS)
790+
$(ACTIONS_ENDGROUP)
783791

784792
test-knownbugs: test-knownbug
785793
test-knownbug: $(TEST_RUNNABLE)-test-knownbug
786794
no-test-knownbug: PHONY
787795
yes-test-knownbug: prog PHONY
796+
$(ACTIONS_GROUP)
788797
-$(exec) $(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM) $(RUN_OPTS)" $(OPTS) $(TESTOPTS) $(srcdir)/KNOWNBUGS.rb
798+
$(ACTIONS_ENDGROUP)
789799

790800
test-testframework: $(TEST_RUNNABLE)-test-testframework
791801
yes-test-testframework: prog PHONY
802+
$(ACTIONS_GROUP)
792803
$(gnumake_recursive)$(Q)$(exec) $(RUNRUBY) "$(TOOL_TESTSDIR)/runner.rb" --ruby="$(RUNRUBY)" $(TESTOPTS) testunit minitest
804+
$(ACTIONS_ENDGROUP)
793805
no-test-testframework: PHONY
794806

795807
test-tool: $(TEST_RUNNABLE)-test-tool
796808
yes-test-tool: prog PHONY
809+
$(ACTIONS_GROUP)
797810
$(gnumake_recursive)$(Q)$(exec) $(RUNRUBY) "$(TOOL_TESTSDIR)/runner.rb" --ruby="$(RUNRUBY)" $(TESTOPTS)
811+
$(ACTIONS_ENDGROUP)
798812
no-test-tool: PHONY
799813

800814
test-sample: test-basic # backward compatibility for mswin-build
@@ -805,7 +819,9 @@ test: test-short
805819
# for example, make test-all TESTOPTS="-j2 -v -n test-name -- test-file-name"
806820
test-all: $(TEST_RUNNABLE)-test-all
807821
yes-test-all: programs PHONY
822+
$(ACTIONS_GROUP)
808823
$(gnumake_recursive)$(Q)$(exec) $(RUNRUBY) "$(TESTSDIR)/runner.rb" --ruby="$(RUNRUBY)" $(TEST_EXCLUDES) $(TESTOPTS) $(TESTS)
824+
$(ACTIONS_ENDGROUP)
809825
TESTS_BUILD = mkmf
810826
no-test-all: PHONY
811827
$(gnumake_recursive)$(MINIRUBY) -I"$(srcdir)/lib" "$(TESTSDIR)/runner.rb" $(TESTOPTS) $(TESTS_BUILD)
@@ -845,8 +861,10 @@ test-spec-precheck: programs
845861

846862
test-spec: $(TEST_RUNNABLE)-test-spec
847863
yes-test-spec: test-spec-precheck
864+
$(ACTIONS_GROUP)
848865
$(gnumake_recursive)$(Q) \
849866
$(RUNRUBY) -r./$(arch)-fake $(srcdir)/spec/mspec/bin/mspec run -B $(srcdir)/spec/default.mspec -I$(srcdir)/tool/lib $(MSPECOPT) $(SPECOPTS)
867+
$(ACTIONS_ENDGROUP)
850868
no-test-spec:
851869

852870
RUNNABLE = $(LIBRUBY_RELATIVE:no=un)-runnable
@@ -1359,8 +1377,10 @@ test-bundled-gems-prepare: test-bundled-gems-precheck test-bundled-gems-fetch
13591377
test-bundled-gems-prepare: $(TEST_RUNNABLE)-test-bundled-gems-prepare
13601378
no-test-bundled-gems-prepare: no-test-bundled-gems-precheck
13611379
yes-test-bundled-gems-prepare: yes-test-bundled-gems-precheck
1380+
$(ACTIONS_GROUP)
13621381
$(XRUBY) -C "$(srcdir)" bin/gem install --no-document \
13631382
--install-dir .bundle --conservative "bundler" "minitest:~> 5" "test-unit" "rake" "hoe" "yard" "pry" "packnga" "rexml" "json-schema" "rbs"
1383+
$(ACTIONS_ENDGROUP)
13641384

13651385
PREPARE_BUNDLED_GEMS = test-bundled-gems-prepare
13661386
test-bundled-gems: $(TEST_RUNNABLE)-test-bundled-gems
@@ -1380,8 +1400,10 @@ yes-test-bundler-precheck: main
13801400

13811401
no-test-bundler-prepare: no-test-bundler-precheck
13821402
yes-test-bundler-prepare: yes-test-bundler-precheck
1403+
$(ACTIONS_GROUP)
13831404
$(XRUBY) -C "$(srcdir)" bin/gem install --no-document \
13841405
--install-dir .bundle --conservative "rspec:~> 3.8" "rake:~> 13.0" "parallel_tests:~> 2.29"
1406+
$(ACTIONS_ENDGROUP)
13851407

13861408
RSPECOPTS =
13871409
BUNDLER_SPECS =

0 commit comments

Comments
 (0)
0