From 26c0f282104efacc2991ac879cb2c45d18edbda0 Mon Sep 17 00:00:00 2001 From: Paul Mucur Date: Fri, 27 Dec 2024 16:37:15 +0000 Subject: [PATCH] Restore Ruby 3.0 support 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 a0ec2d6cfaa6115a02eccdb3ccd02ed1938e0136. --- .github/workflows/tests.yml | 77 ++++++++++++++++++++++++++++++------- README.md | 4 +- Rakefile | 2 +- re2.gemspec | 2 +- 4 files changed, 68 insertions(+), 17 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dc8895d..cceb595 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 @@ -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: @@ -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: @@ -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: @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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" @@ -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 @@ -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 @@ -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: diff --git a/README.md b/README.md index f834fef..d698bf4 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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 diff --git a/Rakefile b/Rakefile index 9618d91..0584ccb 100644 --- a/Rakefile +++ b/Rakefile @@ -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 diff --git a/re2.gemspec b/re2.gemspec index 5d4572d..263431a 100644 --- a/re2.gemspec +++ b/re2.gemspec @@ -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",