Skip to content

Commit

Permalink
Restore Ruby 3.0 support
Browse files Browse the repository at this point in the history
Attempt to restore Ruby 3.0 support by using the latest version of 3.0
(3.0.7) which fixed an issue with compiling native C++ gems with Musl.

See https://bugs.ruby-lang.org/issues/17788

This reverts commit a0ec2d6.
  • Loading branch information
mudge committed Dec 27, 2024
1 parent d1a6abe commit 26c0f28
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 17 deletions.
77 changes: 64 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,22 @@ jobs:
with:
platform: x64-mingw-ucrt

precompile-x64-mingw32:
uses: ./.github/workflows/precompile-gem.yml
with:
platform: x64-mingw32

precompile-x86-mingw32:
uses: ./.github/workflows/precompile-gem.yml
with:
platform: x86-mingw32

test-re2-abi:
needs: "build-cruby-gem"
runs-on: ubuntu-22.04
strategy:
matrix:
ruby: ["3.4.0-rc1", "3.1"] # oldest and newest
ruby: ["3.4.0-rc1", "3.0"] # oldest and newest
libre2:
- version: "20150501"
soname: 0
Expand Down Expand Up @@ -138,7 +148,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3", "3.4.0-rc1"]
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4.0-rc1"]
sys: ["enable", "disable"]
runs-on: "ubuntu-latest"
steps:
Expand All @@ -161,7 +171,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3", "3.4.0-rc1"]
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4.0-rc1"]
sys: ["enable", "disable"]
runs-on: "macos-13"
steps:
Expand All @@ -179,6 +189,29 @@ jobs:
env:
BUNDLE_PATH: ${{ github.workspace }}/vendor/bundle

test-windows-2019:
needs: "build-cruby-gem"
strategy:
fail-fast: false
matrix:
sys: ["enable", "disable"]
runs-on: "windows-2019"
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby-pkgs@v1
with:
ruby-version: "3.0"
mingw: re2
bundler-cache: true
- uses: actions/download-artifact@v4
with:
name: cruby-gem
path: pkg
- run: ./scripts/test-gem-install --${{ matrix.sys }}-system-libraries
shell: bash
env:
BUNDLE_PATH: ${{ github.workspace }}/vendor/bundle

test-windows-2022:
needs: "build-cruby-gem"
strategy:
Expand Down Expand Up @@ -250,7 +283,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3", "3.4.0-rc1"]
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4.0-rc1"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -271,7 +304,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3", "3.4.0-rc1"]
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4.0-rc1"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -292,7 +325,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3", "3.4.0-rc1"]
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4.0-rc1"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -313,7 +346,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3", "3.4.0-rc1"]
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4.0-rc1"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -334,7 +367,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3", "3.4.0-rc1"]
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4.0-rc1"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -355,7 +388,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3", "3.4.0-rc1"]
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4.0-rc1"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -376,7 +409,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3", "3.4.0-rc1"]
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4.0-rc1"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -397,7 +430,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3", "3.4.0-rc1"]
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4.0-rc1"]
runs-on: ubuntu-latest
container:
image: "ruby:${{ matrix.ruby }}-alpine"
Expand All @@ -414,7 +447,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3", "3.4.0-rc1"]
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4.0-rc1"]
runs-on: macos-14
steps:
- uses: actions/checkout@v4
Expand All @@ -435,7 +468,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3", "3.4.0-rc1"]
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4.0-rc1"]
runs-on: macos-13
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -473,6 +506,24 @@ jobs:
env:
BUNDLE_PATH: ${{ github.workspace }}/vendor/bundle

test-precompiled-x64-mingw32:
needs: "precompile-x64-mingw32"
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0"
bundler-cache: true
- uses: actions/download-artifact@v4
with:
name: cruby-x64-mingw32-gem
path: pkg
- run: ./scripts/test-gem-install
shell: bash
env:
BUNDLE_PATH: ${{ github.workspace }}/vendor/bundle

ruby-memcheck:
runs-on: "ubuntu-latest"
env:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ RE2(non_latin1_pattern.encode("ISO-8859-1"), utf8: false).match(non_latin1_text.

This gem requires the following to run:

* [Ruby](https://www.ruby-lang.org/en/) 3.1 to 3.4.0-rc1
* [Ruby](https://www.ruby-lang.org/en/) 3.0 to 3.4.0-rc1

It supports the following RE2 ABI versions:

Expand All @@ -271,7 +271,7 @@ Where possible, a pre-compiled native gem will be provided for the following pla
* `aarch64-linux`, `arm-linux`, `x86-linux` and `x86_64-linux` (requires [glibc](https://www.gnu.org/software/libc/) 2.29+, RubyGems 3.3.22+ and Bundler 2.3.21+)
* [musl](https://musl.libc.org/)-based systems such as [Alpine](https://alpinelinux.org) are supported with Bundler 2.5.6+
* macOS `x86_64-darwin` and `arm64-darwin`
* Windows `x64-mingw-ucrt`
* Windows `x64-mingw32` and `x64-mingw-ucrt`

### Verifying the gems

Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ cross_platforms = %w[
x86_64-linux-musl
].freeze

ENV['RUBY_CC_VERSION'] = %w[3.4.0 3.3.5 3.2.0 3.1.0].join(':')
ENV['RUBY_CC_VERSION'] = %w[3.4.0 3.3.5 3.2.0 3.1.0 3.0.7].join(':')

Gem::PackageTask.new(re2_gemspec).define

Expand Down
2 changes: 1 addition & 1 deletion re2.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Gem::Specification.new do |s|
s.homepage = "https://github.com/mudge/re2"
s.extensions = ["ext/re2/extconf.rb"]
s.license = "BSD-3-Clause"
s.required_ruby_version = ">= 3.1.0"
s.required_ruby_version = ">= 3.0.0"
s.files = [
"dependencies.yml",
"ext/re2/extconf.rb",
Expand Down

0 comments on commit 26c0f28

Please sign in to comment.