Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 96 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,107 @@
name: Start release workflow
name: Publish Ruby packages

on:
push:
tags:
- '*'
repository_dispatch:
types:
- release
workflow_dispatch:
inputs:
version:
description: 'Version of the Ruby package to release'
required: true
default: '3.3.4'

jobs:
notify:
release:
runs-on: ubuntu-latest
steps:
- name: Build release package
- uses: actions/checkout@v6.0.1

- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.4

- name: Store Ruby version
run: |
echo "RUBY_VERSION=${{ github.event.client_payload.version || github.event.inputs.version }}" >> $GITHUB_ENV

- name: Store ABI version
run: echo "ABI_VERSION=$(echo ${{ env.RUBY_VERSION }} | cut -d '.' -f 1-2)" >> $GITHUB_ENV

- name: Copy draft package `/tmp` to `/pub` directory
run: tool/release.sh ${{ env.RUBY_VERSION }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.FTP_R_L_O_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.FTP_R_L_O_AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-west-2

- name: Purge URLs of release package
run: |
curl -X POST \
-H "Fastly-Key: ${{ secrets.FASTLY_PURGE_TOKEN }}" \
https://api.fastly.com/purge/cache.ruby-lang.org/pub/ruby/${{ env.ABI_VERSION }}/ruby-${{ env.RUBY_VERSION }}.tar.gz
curl -X POST \
-H "Fastly-Key: ${{ secrets.FASTLY_PURGE_TOKEN }}" \
https://api.fastly.com/purge/cache.ruby-lang.org/pub/ruby/${{ env.ABI_VERSION }}/ruby-${{ env.RUBY_VERSION }}.tar.xz
curl -X POST \
-H "Fastly-Key: ${{ secrets.FASTLY_PURGE_TOKEN }}" \
https://api.fastly.com/purge/cache.ruby-lang.org/pub/ruby/${{ env.ABI_VERSION }}/ruby-${{ env.RUBY_VERSION }}.zip

- name: Create a release on GitHub
run: |
RELEASE_TAG=$(ruby tool/ruby-version.rb tag "${{ env.RUBY_VERSION }}")
echo $RELEASE_TAG
PREVIOUS_RELEASE_TAG=$(ruby tool/ruby-version.rb previous-tag "${{ env.RUBY_VERSION }}")
echo $PREVIOUS_RELEASE_TAG
tool/gen-github-release.rb $PREVIOUS_RELEASE_TAG $RELEASE_TAG --no-dry-run
env:
GITHUB_TOKEN: ${{ secrets.MATZBOT_AUTO_UPDATE_TOKEN }}

- name: Update versions index
run: |
curl -L -X POST \
-H "Authorization: Bearer ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}" \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/ruby/actions/dispatches \
-d '{"event_type": "${{ github.ref }}"}'
-d '{"event_type": "update_index"}'

- name: Build and push Docker images
run: |
curl -L -X POST \
-H "Authorization: Bearer ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}" \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/ruby/docker-images/actions/workflows/build.yml/dispatches \
-d '{"ref": "master", "inputs": {"ruby_version": "${{ env.RUBY_VERSION }}"}}'

- name: Build snapcraft packages
run: |
curl -L -X POST \
-H "Authorization: Bearer ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}" \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/ruby/snap.ruby/dispatches \
-d '{"event_type": "build", "client_payload": {"ruby_version": "${{ env.RUBY_VERSION }}"}}'

- name: Store the latest LTS version of OpenSSL
run: |
echo "OPENSSL_VERSION=`curl -s https://api.github.com/repos/openssl/openssl/releases | jq -r '.[].tag_name | select(startswith("openssl-3.0"))' | sort -Vr | head -n1 | cut -d'-' -f2`" >> $GITHUB_ENV

- name: Update ruby-build definition
run: |
curl -L -X POST \
-H "Authorization: Bearer ${{ secrets.RUBY_BUILD_WORKFLOW_TOKEN }}" \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/rbenv/ruby-build/dispatches \
-d '{"event_type": "update-ruby", "client_payload": {"ruby_version": "${{ env.RUBY_VERSION }}", "openssl_version": "${{ env.OPENSSL_VERSION }}"}}'

- name: Update all-ruby definition
run: |
curl -L -X POST \
-H "Authorization: Bearer ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}" \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/ruby/all-ruby/dispatches \
-d '{"event_type": "update"}'
103 changes: 7 additions & 96 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,107 +1,18 @@
name: Publish Ruby packages

name: Start release workflow
on:
repository_dispatch:
types:
- release
workflow_dispatch:
inputs:
version:
description: 'Version of the Ruby package to release'
required: true
default: '3.3.4'
push:
tags:
- '*'

jobs:
release:
notify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.1

- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.4

- name: Store Ruby version
run: |
echo "RUBY_VERSION=${{ github.event.client_payload.version || github.event.inputs.version }}" >> $GITHUB_ENV

- name: Store ABI version
run: echo "ABI_VERSION=$(echo ${{ env.RUBY_VERSION }} | cut -d '.' -f 1-2)" >> $GITHUB_ENV

- name: Copy draft package `/tmp` to `/pub` directory
run: tool/release.sh ${{ env.RUBY_VERSION }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.FTP_R_L_O_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.FTP_R_L_O_AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-west-2

- name: Purge URLs of release package
run: |
curl -X POST \
-H "Fastly-Key: ${{ secrets.FASTLY_PURGE_TOKEN }}" \
https://api.fastly.com/purge/cache.ruby-lang.org/pub/ruby/${{ env.ABI_VERSION }}/ruby-${{ env.RUBY_VERSION }}.tar.gz
curl -X POST \
-H "Fastly-Key: ${{ secrets.FASTLY_PURGE_TOKEN }}" \
https://api.fastly.com/purge/cache.ruby-lang.org/pub/ruby/${{ env.ABI_VERSION }}/ruby-${{ env.RUBY_VERSION }}.tar.xz
curl -X POST \
-H "Fastly-Key: ${{ secrets.FASTLY_PURGE_TOKEN }}" \
https://api.fastly.com/purge/cache.ruby-lang.org/pub/ruby/${{ env.ABI_VERSION }}/ruby-${{ env.RUBY_VERSION }}.zip

- name: Create a release on GitHub
run: |
RELEASE_TAG=$(ruby tool/ruby-version.rb tag "${{ env.RUBY_VERSION }}")
echo $RELEASE_TAG
PREVIOUS_RELEASE_TAG=$(ruby tool/ruby-version.rb previous-tag "${{ env.RUBY_VERSION }}")
echo $PREVIOUS_RELEASE_TAG
tool/gen-github-release.rb $PREVIOUS_RELEASE_TAG $RELEASE_TAG --no-dry-run
env:
GITHUB_TOKEN: ${{ secrets.MATZBOT_AUTO_UPDATE_TOKEN }}

- name: Update versions index
- name: Build release package
run: |
curl -L -X POST \
-H "Authorization: Bearer ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}" \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/ruby/actions/dispatches \
-d '{"event_type": "update_index"}'

- name: Build and push Docker images
run: |
curl -L -X POST \
-H "Authorization: Bearer ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}" \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/ruby/docker-images/actions/workflows/build.yml/dispatches \
-d '{"ref": "master", "inputs": {"ruby_version": "${{ env.RUBY_VERSION }}"}}'

- name: Build snapcraft packages
run: |
curl -L -X POST \
-H "Authorization: Bearer ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}" \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/ruby/snap.ruby/dispatches \
-d '{"event_type": "build", "client_payload": {"ruby_version": "${{ env.RUBY_VERSION }}"}}'

- name: Store the latest LTS version of OpenSSL
run: |
echo "OPENSSL_VERSION=`curl -s https://api.github.com/repos/openssl/openssl/releases | jq -r '.[].tag_name | select(startswith("openssl-3.0"))' | sort -Vr | head -n1 | cut -d'-' -f2`" >> $GITHUB_ENV

- name: Update ruby-build definition
run: |
curl -L -X POST \
-H "Authorization: Bearer ${{ secrets.RUBY_BUILD_WORKFLOW_TOKEN }}" \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/rbenv/ruby-build/dispatches \
-d '{"event_type": "update-ruby", "client_payload": {"ruby_version": "${{ env.RUBY_VERSION }}", "openssl_version": "${{ env.OPENSSL_VERSION }}"}}'

- name: Update all-ruby definition
run: |
curl -L -X POST \
-H "Authorization: Bearer ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}" \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/ruby/all-ruby/dispatches \
-d '{"event_type": "update"}'
-d '{"event_type": "${{ github.ref }}"}'
2 changes: 1 addition & 1 deletion defs/gmake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ fix-depends check-depends: all hello
# because the same named directory exists in the source tree.
$(RUBYSPEC_CAPIEXT)/%.$(DLEXT): $(srcdir)/$(RUBYSPEC_CAPIEXT)/%.c $(RUBYSPEC_CAPIEXT_DEPS) \
| build-ext
$(ECHO) building $@
$(no_silence:no=$(ECHO) building $@)
$(Q) $(MAKEDIRS) $(@D)
$(Q) $(DLDSHARED) -L. $(XDLDFLAGS) $(XLDFLAGS) $(LDFLAGS) $(INCFLAGS) $(CPPFLAGS) $(OUTFLAG)$@ $< $(LIBRUBYARG)
ifneq ($(POSTLINK),)
Expand Down
6 changes: 3 additions & 3 deletions io.c
Original file line number Diff line number Diff line change
Expand Up @@ -10758,9 +10758,9 @@ select_internal(VALUE read, VALUE write, VALUE except, struct timeval *tp, rb_fd
if (!pending && n == 0) return Qnil; /* returns nil on timeout */

res = rb_ary_new2(3);
rb_ary_push(res, rp?rb_ary_new():rb_ary_new2(0));
rb_ary_push(res, wp?rb_ary_new():rb_ary_new2(0));
rb_ary_push(res, ep?rb_ary_new():rb_ary_new2(0));
rb_ary_push(res, rp ? rb_ary_new_capa(RARRAY_LEN(read)) : rb_ary_new());
rb_ary_push(res, wp ? rb_ary_new_capa(RARRAY_LEN(write)) : rb_ary_new());
rb_ary_push(res, ep ? rb_ary_new_capa(RARRAY_LEN(except)) : rb_ary_new());

if (rp) {
list = RARRAY_AREF(res, 0);
Expand Down
3 changes: 1 addition & 2 deletions tool/sync_default_gems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@ def lib((upstream, branch), gemspec_in_subdir: false)
time: lib("ruby/time"),
timeout: lib("ruby/timeout"),
tmpdir: lib("ruby/tmpdir"),
tsort: lib("ruby/tsort"),
un: lib("ruby/un"),
uri: lib("ruby/uri", gemspec_in_subdir: true),
weakref: lib("ruby/weakref"),
Expand Down Expand Up @@ -440,7 +439,7 @@ def sync_default_gems(gem)
end

def check_prerelease_version(gem)
return if ["rubygems", "mmtk", "cgi", "pathname"].include?(gem)
return if ["rubygems", "mmtk", "cgi", "pathname", "Onigmo"].include?(gem)

require "net/https"
require "json"
Expand Down
24 changes: 24 additions & 0 deletions zjit/src/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3798,6 +3798,30 @@ impl Function {
_ => insn_id,
}
}
Insn::LoadField { recv, offset, return_type, .. } if return_type.is_subtype(types::CShape) &&
u32::try_from(offset).is_ok() => {
let offset = (offset as u32).to_usize();
let recv_type = self.type_of(recv);
match recv_type.ruby_object() {
Some(recv_obj) if recv_obj.is_frozen() => {
let recv_ptr = recv_obj.as_ptr() as *const u32;
let val = unsafe { recv_ptr.byte_add(offset).read() };
self.new_insn(Insn::Const { val: Const::CShape(ShapeId(val)) })
}
_ => insn_id,
}
}
Insn::GuardBitEquals { val, expected, .. } => {
match self.find(val) {
// TODO: Refactor this into a more general method like
// has_value(Const) that can check on the value specialization
// of the Type instead
Insn::Const { val: const_val } if const_val == expected => {
continue;
}
_ => insn_id
}
}
Insn::AnyToString { str, .. } if self.is_a(str, types::String) => {
self.make_equal_to(insn_id, str);
// Don't bother re-inferring the type of str; we already know it.
Expand Down
Loading