Skip to content

Commit 4d7e5e5

Browse files
committed
Merge branch 'master' into mmtk
2 parents 310837d + 61af722 commit 4d7e5e5

File tree

219 files changed

+5082
-3550
lines changed

Some content is hidden

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

219 files changed

+5082
-3550
lines changed

.github/actions/slack/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ runs:
2424
using: composite
2525

2626
steps:
27-
- uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
27+
- uses: ruby/action-slack@54175162371f1f7c8eb94d7c8644ee2479fcd375 # v3.2.2
2828
with:
2929
payload: |
3030
{

.github/workflows/annocheck.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
builddir: build
7575
makeup: true
7676

77-
- uses: ruby/setup-ruby@943103cae7d3f1bb1e4951d5fcc7928b40e4b742 # v1.177.1
77+
- uses: ruby/setup-ruby@0cde4689ba33c09f1b890c1725572ad96751a3fc # v1.178.0
7878
with:
7979
ruby-version: '3.0'
8080
bundler: none

.github/workflows/baseruby.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- ruby-3.3
5252

5353
steps:
54-
- uses: ruby/setup-ruby@943103cae7d3f1bb1e4951d5fcc7928b40e4b742 # v1.177.1
54+
- uses: ruby/setup-ruby@0cde4689ba33c09f1b890c1725572ad96751a3fc # v1.178.0
5555
with:
5656
ruby-version: ${{ matrix.ruby }}
5757
bundler: none

.github/workflows/check_dependencies.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555

5656
- uses: ./.github/actions/setup/directories
5757

58-
- uses: ruby/setup-ruby@943103cae7d3f1bb1e4951d5fcc7928b40e4b742 # v1.177.1
58+
- uses: ruby/setup-ruby@0cde4689ba33c09f1b890c1725572ad96751a3fc # v1.178.0
5959
with:
6060
ruby-version: '3.0'
6161
bundler: none

.github/workflows/codeql-analysis.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ jobs:
8080
run: sudo rm /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb
8181

8282
- name: Initialize CodeQL
83-
uses: github/codeql-action/init@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
83+
uses: github/codeql-action/init@f079b8493333aace61c81488f8bd40919487bd9f # v3.25.7
8484
with:
8585
languages: ${{ matrix.language }}
8686

8787
- name: Autobuild
88-
uses: github/codeql-action/autobuild@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
88+
uses: github/codeql-action/autobuild@f079b8493333aace61c81488f8bd40919487bd9f # v3.25.7
8989

9090
- name: Perform CodeQL Analysis
91-
uses: github/codeql-action/analyze@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
91+
uses: github/codeql-action/analyze@f079b8493333aace61c81488f8bd40919487bd9f # v3.25.7
9292
with:
9393
category: '/language:${{ matrix.language }}'
9494
upload: False
@@ -118,7 +118,7 @@ jobs:
118118
continue-on-error: true
119119

120120
- name: Upload SARIF
121-
uses: github/codeql-action/upload-sarif@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
121+
uses: github/codeql-action/upload-sarif@f079b8493333aace61c81488f8bd40919487bd9f # v3.25.7
122122
with:
123123
sarif_file: sarif-results/${{ matrix.language }}.sarif
124124
continue-on-error: true

.github/workflows/compilers.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Some tests depending on this name 'Compilations' via $GITHUB_WORKFLOW. Make sure to update such tests when renaming this workflow.
12
name: Compilations
23

34
on:
@@ -136,7 +137,7 @@ jobs:
136137
- { name: '-O0', env: { optflags: '-O0 -march=x86-64 -mtune=generic' } }
137138
# - { name: '-O3', env: { optflags: '-O3 -march=x86-64 -mtune=generic' }, check: true }
138139

139-
- { name: gmp, env: { append_configure: '--with-gmp' } }
140+
- { name: gmp, env: { append_configure: '--with-gmp' }, check: true }
140141
- { name: jemalloc, env: { append_configure: '--with-jemalloc' } }
141142
- { name: valgrind, env: { append_configure: '--with-valgrind' } }
142143
- { name: 'coroutine=ucontext', env: { append_configure: '--with-coroutine=ucontext' } }

.github/workflows/mingw.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
6767
steps:
6868
- name: Set up Ruby & MSYS2
69-
uses: ruby/setup-ruby@943103cae7d3f1bb1e4951d5fcc7928b40e4b742 # v1.177.1
69+
uses: ruby/setup-ruby@0cde4689ba33c09f1b890c1725572ad96751a3fc # v1.178.0
7070
with:
7171
ruby-version: ${{ matrix.baseruby }}
7272

.github/workflows/prism.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
timeout-minutes: 40
9393
env:
9494
GNUMAKEFLAGS: ''
95-
RUBY_TESTOPTS: '-q --tty=no --excludes-dir="../src/test/.excludes-prism" --exclude="error_highlight/test_error_highlight.rb" --exclude="prism/encoding_test.rb"'
95+
RUBY_TESTOPTS: '-q --tty=no --excludes-dir="../src/test/.excludes-prism" --exclude="error_highlight/test_error_highlight.rb"'
9696
RUN_OPTS: ${{ matrix.run_opts }}
9797

9898
- name: make test-spec

.github/workflows/rjit-bindgen.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
4848
steps:
4949
- name: Set up Ruby
50-
uses: ruby/setup-ruby@943103cae7d3f1bb1e4951d5fcc7928b40e4b742 # v1.177.1
50+
uses: ruby/setup-ruby@0cde4689ba33c09f1b890c1725572ad96751a3fc # v1.178.0
5151
with:
5252
ruby-version: '3.1'
5353

.github/workflows/rjit.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
timeout-minutes: 30
8484
env:
8585
GNUMAKEFLAGS: ''
86-
RUBY_TESTOPTS: '-v --tty=no'
86+
RUBY_TESTOPTS: '--tty=no'
8787
RUN_OPTS: ${{ matrix.run_opts }}
8888

8989
- name: make test-all

.github/workflows/scorecards.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ jobs:
6767

6868
# Upload the results to GitHub's code scanning dashboard.
6969
- name: 'Upload to code-scanning'
70-
uses: github/codeql-action/upload-sarif@9fdb3e49720b44c48891d036bb502feb25684276 # v2.1.27
70+
uses: github/codeql-action/upload-sarif@f079b8493333aace61c81488f8bd40919487bd9f # v2.1.27
7171
with:
7272
sarif_file: results.sarif

.github/workflows/spec_guards.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
steps:
4848
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
4949

50-
- uses: ruby/setup-ruby@943103cae7d3f1bb1e4951d5fcc7928b40e4b742 # v1.177.1
50+
- uses: ruby/setup-ruby@0cde4689ba33c09f1b890c1725572ad96751a3fc # v1.178.0
5151
with:
5252
ruby-version: ${{ matrix.ruby }}
5353
bundler: none

.github/workflows/ubuntu.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
with:
6868
arch: ${{ matrix.arch }}
6969

70-
- uses: ruby/setup-ruby@943103cae7d3f1bb1e4951d5fcc7928b40e4b742 # v1.177.1
70+
- uses: ruby/setup-ruby@0cde4689ba33c09f1b890c1725572ad96751a3fc # v1.178.0
7171
with:
7272
ruby-version: '3.0'
7373
bundler: none

.github/workflows/wasm.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
run: |
101101
echo "WASI_SDK_PATH=/opt/wasi-sdk" >> $GITHUB_ENV
102102
103-
- uses: ruby/setup-ruby@943103cae7d3f1bb1e4951d5fcc7928b40e4b742 # v1.177.1
103+
- uses: ruby/setup-ruby@0cde4689ba33c09f1b890c1725572ad96751a3fc # v1.178.0
104104
with:
105105
ruby-version: '3.0'
106106
bundler: none

.github/workflows/windows.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
${{ steps.find-tools.outputs.needs }}
9292
if: ${{ steps.find-tools.outputs.needs != '' }}
9393

94-
- uses: ruby/setup-ruby@943103cae7d3f1bb1e4951d5fcc7928b40e4b742 # v1.177.1
94+
- uses: ruby/setup-ruby@0cde4689ba33c09f1b890c1725572ad96751a3fc # v1.178.0
9595
with:
9696
ruby-version: '3.0'
9797
bundler: none

.github/workflows/yjit-macos.yml

+1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ jobs:
135135
env:
136136
RUBY_TESTOPTS: '-q --tty=no'
137137
TEST_BUNDLED_GEMS_ALLOW_FAILURES: ''
138+
SYNTAX_SUGGEST_TIMEOUT: '5'
138139
PRECHECK_BUNDLED_GEMS: 'no'
139140
continue-on-error: ${{ matrix.continue-on-test_task || false }}
140141

.github/workflows/yjit-ubuntu.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ jobs:
134134

135135
- uses: ./.github/actions/setup/ubuntu
136136

137+
- uses: ruby/setup-ruby@0cde4689ba33c09f1b890c1725572ad96751a3fc # v1.178.0
138+
with:
139+
ruby-version: '3.0'
140+
bundler: none
141+
137142
- uses: ./.github/actions/setup/directories
138143
with:
139144
srcdir: src
@@ -147,11 +152,6 @@ jobs:
147152
if: ${{ matrix.rust_version }}
148153
run: rustup install ${{ matrix.rust_version }} --profile minimal
149154

150-
- uses: ruby/setup-ruby@943103cae7d3f1bb1e4951d5fcc7928b40e4b742 # v1.177.1
151-
with:
152-
ruby-version: '3.0'
153-
bundler: none
154-
155155
- name: Run configure
156156
run: ../src/configure -C --disable-install-doc --prefix=$(pwd)/install ${{ matrix.configure }}
157157

NEWS.md

+16-7
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Note that each entry is kept to a minimum, see links for details.
77

88
## Language changes
99

10-
* String literals in files without a `frozen_string_literal` comment now behave
11-
as if they were frozen. If they are mutated a deprecation warning is emitted.
10+
* String literals in files without a `frozen_string_literal` comment now emit a deprecation warning
11+
when they are mutated.
1212
These warnings can be enabled with `-W:deprecated` or by setting `Warning[:deprecated] = true`.
1313
To disable this change, you can run Ruby with the `--disable-frozen-string-literal`
1414
command line argument. [[Feature #20205]]
@@ -19,9 +19,11 @@ Note that each entry is kept to a minimum, see links for details.
1919
`**nil` is treated similarly to `**{}`, passing no keywords,
2020
and not calling any conversion methods. [[Bug #20064]]
2121

22-
* Block passing is no longer allowed in index. [[Bug #19918]]
22+
* Block passing is no longer allowed in index assignment
23+
(e.g. `a[0, &b] = 1`). [[Bug #19918]]
2324

24-
* Keyword arguments are no longer allowed in index. [[Bug #20218]]
25+
* Keyword arguments are no longer allowed in index assignment
26+
(e.g. `a[0, kw: 1] = 2`). [[Bug #20218]]
2527

2628
## Core classes updates
2729

@@ -38,6 +40,13 @@ Note: We're only listing outstanding class updates.
3840

3941
## Stdlib updates
4042

43+
* Tempfile
44+
45+
* The keyword argument `anonymous: true` is implemented for `Tempfile.create`.
46+
`Tempfile.create(anonymous: true)` removes the created temporary file immediately.
47+
So applications don't need to remove the file.
48+
[[Feature #20497]]
49+
4150
The following default gems are updated.
4251

4352
* RubyGems 3.6.0.dev
@@ -51,7 +60,7 @@ The following default gems are updated.
5160
* optparse 0.5.0
5261
* prism 0.29.0
5362
* rdoc 6.7.0
54-
* reline 0.5.7
63+
* reline 0.5.8
5564
* resolv 0.4.0
5665
* stringio 3.1.1
5766
* strscan 3.1.1
@@ -62,8 +71,8 @@ The following bundled gems are updated.
6271
* rake 13.2.1
6372
* test-unit 3.6.2
6473
* rexml 3.2.8
65-
* net-ftp 0.3.4
66-
* net-imap 0.4.11
74+
* net-ftp 0.3.5
75+
* net-imap 0.4.12
6776
* net-smtp 0.5.0
6877
* rbs 3.4.4
6978
* typeprof 0.21.11

array.c

+11-5
Original file line numberDiff line numberDiff line change
@@ -6825,6 +6825,14 @@ rb_ary_shuffle(rb_execution_context_t *ec, VALUE ary, VALUE randgen)
68256825
return ary;
68266826
}
68276827

6828+
static const rb_data_type_t ary_sample_memo_type = {
6829+
.wrap_struct_name = "ary_sample_memo",
6830+
.function = {
6831+
.dfree = (RUBY_DATA_FUNC)st_free_table,
6832+
},
6833+
.flags = RUBY_TYPED_WB_PROTECTED | RUBY_TYPED_FREE_IMMEDIATELY
6834+
};
6835+
68286836
static VALUE
68296837
ary_sample(rb_execution_context_t *ec, VALUE ary, VALUE randgen, VALUE nv, VALUE to_array)
68306838
{
@@ -6906,11 +6914,9 @@ ary_sample(rb_execution_context_t *ec, VALUE ary, VALUE randgen, VALUE nv, VALUE
69066914
}
69076915
else if (n <= memo_threshold / 2) {
69086916
long max_idx = 0;
6909-
#undef RUBY_UNTYPED_DATA_WARNING
6910-
#define RUBY_UNTYPED_DATA_WARNING 0
6911-
VALUE vmemo = Data_Wrap_Struct(0, 0, st_free_table, 0);
6917+
VALUE vmemo = TypedData_Wrap_Struct(0, &ary_sample_memo_type, 0);
69126918
st_table *memo = st_init_numtable_with_size(n);
6913-
DATA_PTR(vmemo) = memo;
6919+
RTYPEDDATA_DATA(vmemo) = memo;
69146920
result = rb_ary_new_capa(n);
69156921
RARRAY_PTR_USE(result, ptr_result, {
69166922
for (i=0; i<n; i++) {
@@ -6933,7 +6939,7 @@ ary_sample(rb_execution_context_t *ec, VALUE ary, VALUE randgen, VALUE nv, VALUE
69336939
}
69346940
});
69356941
});
6936-
DATA_PTR(vmemo) = 0;
6942+
RTYPEDDATA_DATA(vmemo) = 0;
69376943
st_free_table(memo);
69386944
RB_GC_GUARD(vmemo);
69396945
}

benchmark/hash_aref_str_lit.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
prelude: |
2+
# frozen_string_literal: true
3+
hash = 10.times.to_h do |i|
4+
[i, i]
5+
end
6+
dyn_sym = "dynamic_symbol".to_sym
7+
binary = RubyVM::InstructionSequence.compile("# frozen_string_literal: true\n'iseq_load'").to_binary
8+
iseq_literal_string = RubyVM::InstructionSequence.load_from_binary(binary).eval
9+
10+
hash[:some_symbol] = 1
11+
hash[dyn_sym] = 2
12+
hash["small"] = 3
13+
hash["frozen_string_literal"] = 4
14+
hash[iseq_literal_string] = 5
15+
benchmark:
16+
symbol: hash[:some_symbol]
17+
dyn_symbol: hash[dyn_sym]
18+
small_lit: hash["small"]
19+
frozen_lit: hash["frozen_string_literal"]
20+
iseq_lit: hash[iseq_literal_string]

bootstraptest/test_yjit.rb

+12
Original file line numberDiff line numberDiff line change
@@ -4982,3 +4982,15 @@ class NilClass
49824982
49834983
events
49844984
}
4985+
4986+
# regression test for splatting empty array
4987+
assert_equal '1', %q{
4988+
def callee(foo) = foo
4989+
4990+
def test_body(args) = callee(1, *args)
4991+
4992+
test_body([])
4993+
array = Array.new(100)
4994+
array.clear
4995+
test_body(array)
4996+
}

common.mk

+19
Original file line numberDiff line numberDiff line change
@@ -1889,6 +1889,22 @@ ChangeLog:
18891889
-e 'VCS.detect(ARGV[0]).export_changelog(path: ARGV[1])' \
18901890
"$(srcdir)" $@
18911891

1892+
# CAUTION: If using GNU make 3 which does not support `.WAIT`, this
1893+
# recipe with multiple jobs makes build and `git reset` run
1894+
# simultaneously, and will cause inconsistent results. Run with `-j1`
1895+
# or update GNU make.
1896+
nightly: yesterday $(DOT_WAIT) install
1897+
$(NULLCMD)
1898+
1899+
# Rewind to the last commit "yesterday". "Yesterday" means here the
1900+
# period where `RUBY_RELEASE_DATE` is the day before the date to be
1901+
# generated now. In short, the yesterday in JST-9 time zone.
1902+
yesterday: rewindable
1903+
1904+
rewindable:
1905+
$(GIT) -C $(srcdir) status --porcelain
1906+
$(GIT) -C $(srcdir) diff --quiet
1907+
18921908
HELP_EXTRA_TASKS = ""
18931909

18941910
help: PHONY
@@ -19113,8 +19129,11 @@ transcode.$(OBJEXT): {$(VPATH)}subst.h
1911319129
transcode.$(OBJEXT): {$(VPATH)}transcode.c
1911419130
transcode.$(OBJEXT): {$(VPATH)}transcode_data.h
1911519131
util.$(OBJEXT): $(hdrdir)/ruby/ruby.h
19132+
util.$(OBJEXT): $(top_srcdir)/internal/array.h
1911619133
util.$(OBJEXT): $(top_srcdir)/internal/compilers.h
19134+
util.$(OBJEXT): $(top_srcdir)/internal/imemo.h
1911719135
util.$(OBJEXT): $(top_srcdir)/internal/sanitizers.h
19136+
util.$(OBJEXT): $(top_srcdir)/internal/static_assert.h
1911819137
util.$(OBJEXT): $(top_srcdir)/internal/util.h
1911919138
util.$(OBJEXT): $(top_srcdir)/internal/warnings.h
1912019139
util.$(OBJEXT): {$(VPATH)}assert.h

0 commit comments

Comments
 (0)