Skip to content

Commit

Permalink
Merge branch 'master' into mmtk
Browse files Browse the repository at this point in the history
  • Loading branch information
wks committed May 28, 2024
2 parents ae47e55 + 2114d0a commit dcd46bd
Show file tree
Hide file tree
Showing 204 changed files with 3,797 additions and 2,991 deletions.
6 changes: 5 additions & 1 deletion .github/actions/setup/macos/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ runs:
- name: Set ENV
shell: bash
run: |
for lib in openssl@1.1 gmp; do
for lib in gmp; do
ruby_configure_args="${ruby_configure_args:+$ruby_configure_args }--with-${lib%@*}-dir=$(brew --prefix $lib)"
done
for lib in openssl@1.1; do
CONFIGURE_ARGS="${CONFIGURE_ARGS:+$CONFIGURE_ARGS }--with-${lib%@*}-dir=$(brew --prefix $lib)"
done
echo ruby_configure_args="${ruby_configure_args}" >> $GITHUB_ENV
echo CONFIGURE_ARGS="${CONFIGURE_ARGS}" >> $GITHUB_ENV
2 changes: 1 addition & 1 deletion .github/workflows/annocheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
builddir: build
makeup: true

- uses: ruby/setup-ruby@cacc9f1c0b3f4eb8a16a6bb0ed10897b43b9de49 # v1.176.0
- uses: ruby/setup-ruby@943103cae7d3f1bb1e4951d5fcc7928b40e4b742 # v1.177.1
with:
ruby-version: '3.0'
bundler: none
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/baseruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- ruby-3.3

steps:
- uses: ruby/setup-ruby@cacc9f1c0b3f4eb8a16a6bb0ed10897b43b9de49 # v1.176.0
- uses: ruby/setup-ruby@943103cae7d3f1bb1e4951d5fcc7928b40e4b742 # v1.177.1
with:
ruby-version: ${{ matrix.ruby }}
bundler: none
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:

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

- uses: ruby/setup-ruby@cacc9f1c0b3f4eb8a16a6bb0ed10897b43b9de49 # v1.176.0
- uses: ruby/setup-ruby@943103cae7d3f1bb1e4951d5fcc7928b40e4b742 # v1.177.1
with:
ruby-version: '3.0'
bundler: none
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ jobs:
run: sudo rm /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb

- name: Initialize CodeQL
uses: github/codeql-action/init@b7cec7526559c32f1616476ff32d17ba4c59b2d6 # v3.25.5
uses: github/codeql-action/init@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@b7cec7526559c32f1616476ff32d17ba4c59b2d6 # v3.25.5
uses: github/codeql-action/autobuild@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@b7cec7526559c32f1616476ff32d17ba4c59b2d6 # v3.25.5
uses: github/codeql-action/analyze@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
with:
category: '/language:${{ matrix.language }}'
upload: False
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
continue-on-error: true

- name: Upload SARIF
uses: github/codeql-action/upload-sarif@b7cec7526559c32f1616476ff32d17ba4c59b2d6 # v3.25.5
uses: github/codeql-action/upload-sarif@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
with:
sarif_file: sarif-results/${{ matrix.language }}.sarif
continue-on-error: true
39 changes: 38 additions & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,14 @@ jobs:
# Set fetch-depth: 0 so that Launchable can receive commits information.
fetch-depth: 10

- name: make sure that kern.coredump=1
run: |
sysctl -n kern.coredump
sudo sysctl -w kern.coredump=1
sudo chmod -R +rwx /cores/
- name: Run configure
run: ../src/configure -C --disable-install-doc
run: ../src/configure -C --disable-install-doc ${ruby_configure_args}

- run: make prepare-gems
if: ${{ matrix.test_task == 'test-bundled-gems' }}
Expand Down Expand Up @@ -110,6 +116,7 @@ jobs:

- name: make skipped tests
run: |
ulimit -c unlimited
make -s test-all TESTS="${TESTS//-n!\//-n/}"
env:
GNUMAKEFLAGS: ''
Expand All @@ -124,6 +131,36 @@ jobs:
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
if: ${{ failure() }}

- name: Resolve job ID
id: job_id
uses: actions/github-script@main
env:
matrix: ${{ toJson(matrix) }}
with:
script: |
const { data: workflow_run } = await github.rest.actions.listJobsForWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.runId
});
const matrix = JSON.parse(process.env.matrix);
const job_name = `${context.job}${matrix ? ` (${Object.values(matrix).join(", ")})` : ""}`;
return workflow_run.jobs.find((job) => job.name === job_name).id;
- name: upload /cores
run: |
ls -l /cores
CORES_TAR_GZ="cores-${{ github.run_id }}-${{ steps.job_id.outputs.result }}.tar.gz"
echo "test: $CORES_TAR_GZ"
if [ -n "$(ls /cores)" ]; then
tar czf /cores "$CORES_TAR_GZ"
aws s3 cp "$CORES_TAR_GZ" "s3://ruby-core-files/$CORES_TAR_GZ"
fi
env:
AWS_ACCESS_KEY_ID: ${{ secrets.RUBY_CORE_FILES_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.RUBY_CORE_FILES_AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ap-northeast-1

result:
if: ${{ always() }}
name: ${{ github.workflow }} result
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
steps:
- name: Set up Ruby & MSYS2
uses: ruby/setup-ruby@cacc9f1c0b3f4eb8a16a6bb0ed10897b43b9de49 # v1.176.0
uses: ruby/setup-ruby@943103cae7d3f1bb1e4951d5fcc7928b40e4b742 # v1.177.1
with:
ruby-version: ${{ matrix.baseruby }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/prism.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ jobs:
RUBY_TESTOPTS: '-q --tty=no --excludes-dir="../src/test/.excludes-prism" --exclude="error_highlight/test_error_highlight.rb" --exclude="prism/encoding_test.rb"'
RUN_OPTS: ${{ matrix.run_opts }}

- name: make test-prism-spec
- name: make test-spec
run: |
$SETARCH make -s test-prism-spec SPECOPTS="$SPECOPTS"
$SETARCH make -s test-spec SPECOPTS="$SPECOPTS"
timeout-minutes: 10
env:
GNUMAKEFLAGS: ''
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rjit-bindgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
steps:
- name: Set up Ruby
uses: ruby/setup-ruby@cacc9f1c0b3f4eb8a16a6bb0ed10897b43b9de49 # v1.176.0
uses: ruby/setup-ruby@943103cae7d3f1bb1e4951d5fcc7928b40e4b742 # v1.177.1
with:
ruby-version: '3.1'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: 'Upload to code-scanning'
uses: github/codeql-action/upload-sarif@b7cec7526559c32f1616476ff32d17ba4c59b2d6 # v2.1.27
uses: github/codeql-action/upload-sarif@9fdb3e49720b44c48891d036bb502feb25684276 # v2.1.27
with:
sarif_file: results.sarif
2 changes: 1 addition & 1 deletion .github/workflows/spec_guards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6

- uses: ruby/setup-ruby@cacc9f1c0b3f4eb8a16a6bb0ed10897b43b9de49 # v1.176.0
- uses: ruby/setup-ruby@943103cae7d3f1bb1e4951d5fcc7928b40e4b742 # v1.177.1
with:
ruby-version: ${{ matrix.ruby }}
bundler: none
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
with:
arch: ${{ matrix.arch }}

- uses: ruby/setup-ruby@cacc9f1c0b3f4eb8a16a6bb0ed10897b43b9de49 # v1.176.0
- uses: ruby/setup-ruby@943103cae7d3f1bb1e4951d5fcc7928b40e4b742 # v1.177.1
with:
ruby-version: '3.0'
bundler: none
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
run: |
echo "WASI_SDK_PATH=/opt/wasi-sdk" >> $GITHUB_ENV
- uses: ruby/setup-ruby@cacc9f1c0b3f4eb8a16a6bb0ed10897b43b9de49 # v1.176.0
- uses: ruby/setup-ruby@943103cae7d3f1bb1e4951d5fcc7928b40e4b742 # v1.177.1
with:
ruby-version: '3.0'
bundler: none
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
${{ steps.find-tools.outputs.needs }}
if: ${{ steps.find-tools.outputs.needs != '' }}

- uses: ruby/setup-ruby@cacc9f1c0b3f4eb8a16a6bb0ed10897b43b9de49 # v1.176.0
- uses: ruby/setup-ruby@943103cae7d3f1bb1e4951d5fcc7928b40e4b742 # v1.177.1
with:
ruby-version: '3.0'
bundler: none
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/yjit-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ jobs:
if: ${{ matrix.rust_version }}
run: rustup install ${{ matrix.rust_version }} --profile minimal

- uses: ruby/setup-ruby@cacc9f1c0b3f4eb8a16a6bb0ed10897b43b9de49 # v1.176.0
- uses: ruby/setup-ruby@943103cae7d3f1bb1e4951d5fcc7928b40e4b742 # v1.177.1
with:
ruby-version: '3.0'
bundler: none
Expand Down
8 changes: 5 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,25 @@ The following default gems are updated.
* net-http 0.4.1
* optparse 0.5.0
* prism 0.29.0
* rdoc 6.6.3.1
* rdoc 6.7.0
* reline 0.5.7
* resolv 0.4.0
* stringio 3.1.1
* strscan 3.1.1

The following bundled gems are updated.

* minitest 5.22.3
* minitest 5.23.1
* rake 13.2.1
* test-unit 3.6.2
* rexml 3.2.8
* net-ftp 0.3.4
* net-imap 0.4.11
* net-smtp 0.5.0
* rbs 3.4.4
* typeprof 0.21.11
* debug 1.9.2
* racc 1.8.0

The following bundled gems are promoted from default gems.

Expand Down Expand Up @@ -122,7 +124,7 @@ See GitHub releases like [GitHub Releases of Logger](https://github.com/ruby/log
a warning on verbose mode (`-w`).
[[Feature #15554]]

* Redefining some core methods that are specially optimized by the interpeter
* Redefining some core methods that are specially optimized by the interpreter
and JIT like `String.freeze` or `Integer#+` now emits a performance class
warning (`-W:performance` or `Warning[:performance] = true`).
[[Feature #20429]]
Expand Down
13 changes: 13 additions & 0 deletions array.c
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,19 @@ rb_ary_free(VALUE ary)
}
}

VALUE
rb_setup_fake_ary(struct RArray *fake_ary, const VALUE *list, long len, bool freeze)
{
fake_ary->basic.flags = T_ARRAY;
VALUE ary = (VALUE)fake_ary;
RBASIC_CLEAR_CLASS(ary);
ARY_SET_PTR(ary, list);
ARY_SET_HEAP_LEN(ary, len);
ARY_SET_CAPA(ary, len);
if (freeze) OBJ_FREEZE(ary);
return ary;
}

size_t
rb_ary_memsize(VALUE ary)
{
Expand Down
15 changes: 4 additions & 11 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1020,15 +1020,6 @@ yes-test-spec: yes-test-spec-precheck
$(ACTIONS_ENDGROUP)
no-test-spec:

test-prism-spec: $(TEST_RUNNABLE)-test-prism-spec
yes-test-prism-spec: yes-test-spec-precheck
$(ACTIONS_GROUP)
$(gnumake_recursive)$(Q) \
$(RUNRUBY) -r./$(arch)-fake -r$(tooldir)/lib/_tmpdir \
$(srcdir)/spec/mspec/bin/mspec run -B $(srcdir)/spec/default.mspec -B $(srcdir)/spec/prism.mspec $(MSPECOPT) $(SPECOPTS)
$(ACTIONS_ENDGROUP)
no-test-prism-spec:

check: $(DOT_WAIT) test-spec

RUNNABLE = $(LIBRUBY_RELATIVE:no=un)-runnable
Expand Down Expand Up @@ -1602,16 +1593,18 @@ yes-test-bundled-gems-prepare: yes-test-bundled-gems-precheck
$(ACTIONS_ENDGROUP)

PREPARE_BUNDLED_GEMS = test-bundled-gems-prepare
test-bundled-gems: $(TEST_RUNNABLE)-test-bundled-gems $(TEST_RUNNABLE)-test-bundled-gems-spec
test-bundled-gems: $(TEST_RUNNABLE)-test-bundled-gems $(DOT_WAIT) $(TEST_RUNNABLE)-test-bundled-gems-spec
yes-test-bundled-gems: test-bundled-gems-run
no-test-bundled-gems:

# Override this to allow failure of specific gems on CI
# TEST_BUNDLED_GEMS_ALLOW_FAILURES =

BUNDLED_GEMS =
test-bundled-gems-run: $(PREPARE_BUNDLED_GEMS)
test-bundled-gems-run: $(TEST_RUNNABLE)-test-bundled-gems-run
yes-test-bundled-gems-run: $(PREPARE_BUNDLED_GEMS)
$(gnumake_recursive)$(Q) $(XRUBY) $(tooldir)/test-bundled-gems.rb $(BUNDLED_GEMS)
no-test-bundled-gems-run: $(PREPARE_BUNDLED_GEMS)

test-bundled-gems-spec: $(TEST_RUNNABLE)-test-bundled-gems-spec
yes-test-bundled-gems-spec: yes-test-spec-precheck $(PREPARE_BUNDLED_GEMS)
Expand Down
Loading

0 comments on commit dcd46bd

Please sign in to comment.