Skip to content

Commit 322bc0d

Browse files
committed
Merge branch 'master' into rwstauner/send-nil-block-direct
2 parents e6c6e2f + 657ce7c commit 322bc0d

455 files changed

Lines changed: 12978 additions & 4410 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/workflows/check_sast.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ jobs:
7878
persist-credentials: false
7979

8080
- name: Initialize CodeQL
81-
uses: github/codeql-action/init@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3
81+
uses: github/codeql-action/init@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
8282
with:
8383
languages: ${{ matrix.language }}
8484
build-mode: none
8585
config-file: .github/codeql/codeql-config.yml
8686

8787
- name: Perform CodeQL Analysis
88-
uses: github/codeql-action/analyze@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3
88+
uses: github/codeql-action/analyze@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
8989
with:
9090
category: '/language:${{ matrix.language }}'
9191
upload: False
@@ -127,7 +127,7 @@ jobs:
127127
continue-on-error: true
128128

129129
- name: Upload SARIF
130-
uses: github/codeql-action/upload-sarif@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3
130+
uses: github/codeql-action/upload-sarif@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
131131
with:
132132
sarif_file: sarif-results/${{ matrix.language }}.sarif
133133
continue-on-error: true

.github/workflows/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ jobs:
1212
pull-requests: write
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/labeler@f27b608878404679385c85cfa523b85ccb86e213 # v6.1.0
15+
- uses: actions/labeler@b8dd2d9be0f68b860e7dae5dae7d772984eacd6d # v6.2.0

.github/workflows/mingw.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
|| contains(github.event.head_commit.message, '[DOC]')
8080
|| contains(github.event.pull_request.title, '[DOC]')
8181
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
82-
|| (github.event.pull_request.user.login == 'dependabot[bot]' && !startsWith(github.head_ref, 'dependabot/vcpkg'))
82+
|| (github.event.pull_request.user.login == 'dependabot[bot]')
8383
)}}
8484
8585
steps:

.github/workflows/scorecards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,6 @@ jobs:
7373
# Upload the results to GitHub's code scanning dashboard (optional).
7474
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
7575
- name: "Upload to code-scanning"
76-
uses: github/codeql-action/upload-sarif@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3
76+
uses: github/codeql-action/upload-sarif@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
7777
with:
7878
sarif_file: results.sarif

.github/workflows/tarball-test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ jobs:
9191
windows:
9292
needs: tarball
9393
if: ${{ ! needs.tarball.outputs.skip }}
94+
# For fork pull requests the GITHUB_TOKEN is capped to read-only, so
95+
# they can only download vcpkg packages; uploads happen on push.
96+
permissions:
97+
contents: read
98+
packages: write
9499
uses: ./.github/workflows/tarball-windows.yml
95100
with:
96101
archname: snapshot-${{ needs.tarball.outputs.branch }}

.github/workflows/tarball-windows.yml

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ on:
1818
SNAPSHOT_SLACK_WEBHOOK_URL:
1919
required: false
2020

21-
permissions:
22-
contents: read
21+
# GITHUB_TOKEN permissions are inherited from the caller job. Declaring
22+
# permissions here would be an elevation request and fail at startup when
23+
# the caller's token is capped to read-only (fork pull requests).
2324

2425
jobs:
2526
windows:
@@ -41,8 +42,8 @@ jobs:
4142
GITPULLOPTIONS: --no-tags origin ${{github.ref}}
4243
PATCH: C:\msys64\usr\bin\patch.exe
4344
OS_VER: windows-${{ matrix.os }}
44-
# see https://github.com/ruby/ruby/commit/9ff4399decef0036897d3cfb9ac2c710dea913ca
45-
OPENSSL_MODULES: C:\vcpkg\installed\x64-windows\bin
45+
VCPKG_DEFAULT_TRIPLET: x64-windows
46+
FEED_URL: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
4647
steps:
4748
- run: md build
4849
working-directory:
@@ -63,17 +64,6 @@ jobs:
6364
shell: msys2 {0}
6465
run: echo PATCH=$(cygpath -wa $(command -v patch)) >> $GITHUB_ENV
6566
if: ${{ steps.setup-msys2.outcome == 'success' }}
66-
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
67-
with:
68-
path: C:\vcpkg\installed
69-
key: ${{ runner.os }}-vcpkg-installed-${{ env.OS_VER }}-${{ github.sha }}
70-
restore-keys: |
71-
${{ runner.os }}-vcpkg-installed-${{ env.OS_VER }}-
72-
${{ runner.os }}-vcpkg-installed-
73-
- name: Install libraries with vcpkg
74-
run: |
75-
vcpkg --triplet x64-windows install gmp libffi libyaml openssl zlib
76-
7767
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
7868
with:
7969
name: Packages
@@ -82,6 +72,29 @@ jobs:
8272
run: 7z x pkg/*.zip
8373
working-directory:
8474

75+
- name: Set up vcpkg binary cache
76+
shell: pwsh
77+
env:
78+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
FEED_OWNER: ${{ github.repository_owner }}
80+
# The github context of a reusable workflow belongs to the caller;
81+
# the GITHUB_TOKEN of pull_request events (forks, dependabot) is
82+
# read-only. Packages are uploaded on push, merge_group, and
83+
# workflow_dispatch.
84+
FEED_MODE: ${{ github.event_name != 'pull_request' && 'readwrite' || 'read' }}
85+
run: |
86+
$nuget = (vcpkg fetch nuget) | Select-Object -Last 1
87+
& $nuget sources add -Source $Env:FEED_URL -StorePasswordInClearText `
88+
-Name GitHubPackages -UserName $Env:FEED_OWNER -Password $Env:GH_TOKEN
89+
& $nuget setapikey $Env:GH_TOKEN -Source $Env:FEED_URL
90+
"VCPKG_BINARY_SOURCES=clear;nuget,$Env:FEED_URL,$Env:FEED_MODE" >> $Env:GITHUB_ENV
91+
92+
- name: Install libraries with vcpkg
93+
run: |
94+
git -C "%VCPKG_INSTALLATION_ROOT%" pull --quiet
95+
vcpkg install
96+
working-directory: ${{ inputs.archname }}
97+
8598
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
8699
with:
87100
path: snapshot-*/.downloaded-cache
@@ -90,6 +103,7 @@ jobs:
90103
- name: setup env
91104
# %TEMP% is inconsistent with %TMP% and test-all expects they are consistent.
92105
# https://github.com/actions/virtual-environments/issues/712#issuecomment-613004302
106+
# OPENSSL_MODULES: see https://github.com/ruby/ruby/commit/9ff4399decef0036897d3cfb9ac2c710dea913ca
93107
env:
94108
ARCHNAME: ${{ inputs.archname }}
95109
run: |
@@ -98,6 +112,8 @@ jobs:
98112
set TMP=%USERPROFILE%\AppData\Local\Temp
99113
set TEMP=%USERPROFILE%\AppData\Local\Temp
100114
set /a TEST_JOBS=(15 * %NUMBER_OF_PROCESSORS% / 10) > nul
115+
set RUBY_OPT_DIR=%GITHUB_WORKSPACE:\=/%/%ARCHNAME%/vcpkg_installed/%VCPKG_DEFAULT_TRIPLET%
116+
set OPENSSL_MODULES=%GITHUB_WORKSPACE%\%ARCHNAME%\vcpkg_installed\%VCPKG_DEFAULT_TRIPLET%\bin
101117
set > new.env
102118
103119
- name: update env
@@ -109,17 +125,13 @@ jobs:
109125
Where-Object { $_.SideIndicator -eq '=>' } |
110126
Select-Object -ExpandProperty InputObject |
111127
Add-Content -Path $env:GITHUB_ENV
112-
- name: link libraries
113-
run: |
114-
for %%I in (C:\vcpkg\installed\x64-windows\bin\*.dll) do (
115-
mklink %%~nxI %%I
116-
)
117128
- name: Configure
118129
env:
119130
ARCHNAME: ${{ inputs.archname }}
120131
run: >-
121132
../%ARCHNAME%/win32/configure.bat --disable-install-doc
122-
--with-opt-dir=C:/vcpkg/installed/x64-windows
133+
--with-opt-dir=%RUBY_OPT_DIR%
134+
- run: nmake prepare-vcpkg
123135
- run: nmake incs
124136
- run: nmake extract-extlibs
125137
- run: nmake

.github/workflows/windows.yml

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,14 @@ jobs:
5050
5151
name: Windows ${{ matrix.os }} (${{ matrix.test_task }})
5252

53+
permissions:
54+
contents: read
55+
packages: write
56+
5357
env:
5458
GITPULLOPTIONS: --no-tags origin ${{ github.ref }}
5559
VCPKG_DEFAULT_TRIPLET: ${{ matrix.target || 'x64' }}-windows
60+
FEED_URL: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
5661

5762
steps:
5863
- run: md build
@@ -88,33 +93,26 @@ jobs:
8893
scoop install vcpkg
8994
shell: pwsh
9095

91-
- name: Restore vcpkg artifact
92-
id: restore-vcpkg
93-
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
94-
with:
95-
path: src\vcpkg_installed
96-
key: windows-${{ matrix.os }}-vcpkg-${{ hashFiles('src/vcpkg.json') }}
96+
- name: Set up vcpkg binary cache
97+
shell: pwsh
98+
env:
99+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
100+
FEED_OWNER: ${{ github.repository_owner }}
101+
# The GITHUB_TOKEN of pull_request events (forks, dependabot) is
102+
# read-only; packages are uploaded on push and merge_group only.
103+
FEED_MODE: ${{ github.event_name != 'pull_request' && 'readwrite' || 'read' }}
104+
run: |
105+
$nuget = (vcpkg fetch nuget) | Select-Object -Last 1
106+
& $nuget sources add -Source $Env:FEED_URL -StorePasswordInClearText `
107+
-Name GitHubPackages -UserName $Env:FEED_OWNER -Password $Env:GH_TOKEN
108+
& $nuget setapikey $Env:GH_TOKEN -Source $Env:FEED_URL
109+
"VCPKG_BINARY_SOURCES=clear;nuget,$Env:FEED_URL,$Env:FEED_MODE" >> $Env:GITHUB_ENV
97110
98111
- name: Install libraries with vcpkg
99-
id: build-vcpkg
100112
run: |
101113
git -C "%VCPKG_INSTALLATION_ROOT%" pull --quiet
102114
vcpkg install
103115
working-directory: src
104-
if: ${{ ! steps.restore-vcpkg.outputs.cache-hit }}
105-
106-
- name: Save vcpkg artifact
107-
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
108-
with:
109-
path: src\vcpkg_installed
110-
key: windows-${{ matrix.os }}-vcpkg-${{ hashFiles('src/vcpkg.json') }}
111-
if: >-
112-
steps.build-vcpkg.outcome == 'success' &&
113-
( github.ref_name == 'master'
114-
|| startsWith(github.ref_name, 'ruby_')
115-
|| ( github.event.pull_request.user.login == 'dependabot[bot]'
116-
&& startsWith(github.head_ref || github.ref_name, 'dependabot/vcpkg'))
117-
)
118116

119117
- name: setup env
120118
# Available Ruby versions: https://github.com/actions/runner-images/blob/main/images/windows/Windows2019-Readme.md#ruby
@@ -196,6 +194,29 @@ jobs:
196194
RUBY_TESTOPTS: -j${{ env.TEST_JOBS || 4 }}
197195
timeout-minutes: 70
198196

197+
- run: nmake binary-package
198+
if: ${{ matrix.test_task == 'check' }}
199+
timeout-minutes: 10
200+
201+
- name: Verify binary package
202+
shell: pwsh
203+
if: ${{ matrix.test_task == 'check' }}
204+
run: |
205+
$zip = Get-Item ruby-*-mswin*.zip
206+
$dest = Join-Path $env:RUNNER_TEMP "binpkg"
207+
if (Test-Path $dest) { Remove-Item -Recurse -Force $dest }
208+
New-Item -ItemType Directory $dest | Out-Null
209+
& "$env:SystemRoot\System32\tar.exe" -x -f $zip.FullName -C $dest
210+
if ((Get-ChildItem $dest).Count -ne 1) { throw "zip must contain a single root directory" }
211+
$root = (Get-ChildItem $dest)[0].FullName
212+
if (!(Test-Path "$root\bin\ruby.exe")) { throw "bin\ruby.exe not found" }
213+
if (Get-ChildItem "$root\bin" -Filter "vcruntime140*.dll") { throw "the VC runtime must not be bundled" }
214+
if (!(Get-ChildItem "$root\LICENSES" -ErrorAction SilentlyContinue)) { throw "LICENSES missing" }
215+
$env:PATH = "$env:SystemRoot\System32"
216+
& "$root\bin\ruby.exe" -v -ropenssl -rfiddle -rpsych -rzlib -e 'abort "configure_args has an absolute path: #{RbConfig::CONFIG[%q(configure_args)]}" if RbConfig::CONFIG[%q(configure_args)] =~ /\b[A-Za-z]:[\/\\]/; puts %q(binary package OK)'
217+
if ($LASTEXITCODE -ne 0) { throw "smoke test failed" }
218+
timeout-minutes: 5
219+
199220
- uses: ./.github/actions/slack
200221
with:
201222
label: Windows ${{ matrix.os }} / ${{ matrix.test_task || 'check' }}

.github/workflows/zjit-macos.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
specopts: '-T --zjit-disable-hir-opt -T --zjit-call-threshold=1'
4848
configure: '--enable-zjit=dev'
4949

50-
- test_task: 'zjit-check' # zjit-test + quick feedback of test_zjit.rb
50+
- test_task: 'zjit-check' # zjit-test + quick feedback of test_zjit_cli.rb
5151
configure: '--enable-yjit=dev --enable-zjit'
5252
rust_version: "1.85.0"
5353

@@ -98,7 +98,7 @@ jobs:
9898
rustup install ${{ matrix.rust_version }} --profile minimal
9999
rustup default ${{ matrix.rust_version }}
100100
101-
- uses: taiki-e/install-action@4684b8405694ae9dd42c9f39ba901a70ae83f4a3 # v2.82.9
101+
- uses: taiki-e/install-action@c7eb1735f09259a5035e8e5d44b1406b1cddc0fb # v2.83.0
102102
with:
103103
tool: nextest@0.9
104104
if: ${{ matrix.test_task == 'zjit-check' }}

.github/workflows/zjit-ubuntu.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
configure: '--enable-zjit=dev'
9696
run_opts: '--zjit-inline-threshold=0 --zjit-call-threshold=1'
9797

98-
- test_task: 'zjit-check' # zjit-test + quick feedback of test_zjit.rb
98+
- test_task: 'zjit-check' # zjit-test + quick feedback of test_zjit_cli.rb
9999
configure: '--enable-yjit --enable-zjit=dev'
100100
rust_version: '1.85.0'
101101

@@ -141,7 +141,7 @@ jobs:
141141
ruby-version: '3.1'
142142
bundler: none
143143

144-
- uses: taiki-e/install-action@4684b8405694ae9dd42c9f39ba901a70ae83f4a3 # v2.82.9
144+
- uses: taiki-e/install-action@c7eb1735f09259a5035e8e5d44b1406b1cddc0fb # v2.83.0
145145
with:
146146
tool: nextest@0.9
147147
if: ${{ matrix.test_task == 'zjit-check' }}

0 commit comments

Comments
 (0)