Skip to content

Commit

Permalink
dep: drop support for Ruby 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
flavorjones committed Dec 11, 2024
1 parent 2829617 commit 64da65b
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 186 deletions.
8 changes: 0 additions & 8 deletions .cross_rubies
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
3.0.0:aarch64-linux
3.0.0:arm-linux
3.0.0:arm64-darwin
3.0.0:x64-mingw32
3.0.0:x86-linux
3.0.0:x86-mingw32
3.0.0:x86_64-darwin
3.0.0:x86_64-linux
3.1.0:aarch64-linux
3.1.0:arm-linux
3.1.0:arm64-darwin
Expand Down
69 changes: 12 additions & 57 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
fail-fast: false
matrix:
sys: ["enable", "disable"]
ruby: ["3.0", "3.1", "3.2", "3.3"]
ruby: ["3.1", "3.2", "3.3"]
runs-on: ubuntu-latest
container:
image: ghcr.io/sparklemotion/nokogiri-test:mri-${{matrix.ruby}}
Expand All @@ -122,7 +122,7 @@ jobs:
fail-fast: false
matrix:
sys: ["enable", "disable"]
ruby: ["3.0", "3.1", "3.2", "3.3"]
ruby: ["3.1", "3.2", "3.3"]
mem: ["ruby"]
include:
- sys: "disable"
Expand Down Expand Up @@ -238,7 +238,7 @@ jobs:
fail-fast: false
matrix:
sys: ["enable", "disable"]
ruby: ["3.0", "3.1", "3.2", "3.3"]
ruby: ["3.1", "3.2", "3.3"]
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -293,7 +293,7 @@ jobs:
fail-fast: false
matrix:
sys: ["enable", "disable"]
ruby: ["3.0", "3.1", "3.2", "3.3"]
ruby: ["3.1", "3.2", "3.3"]
runs-on: windows-2022
steps:
- name: configure git crlf
Expand Down Expand Up @@ -487,7 +487,7 @@ jobs:
fail-fast: false
matrix:
sys: ["enable", "disable"]
ruby: ["3.0", "3.1", "3.2", "3.3"]
ruby: ["3.1", "3.2", "3.3"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -509,7 +509,7 @@ jobs:
fail-fast: false
matrix:
sys: ["enable", "disable"]
ruby: ["3.0", "3.1", "3.2", "3.3"]
ruby: ["3.1", "3.2", "3.3"]
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -525,29 +525,6 @@ jobs:
- run: ./scripts/test-gem-install gems --${{matrix.sys}}-system-libraries

generic-windows-install:
needs: ["generic-package"]
strategy:
fail-fast: false
matrix:
sys: ["enable", "disable"]
ruby: ["3.0"]
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ruby/setup-ruby-pkgs@v1
with:
ruby-version: "${{matrix.ruby}}"
mingw: "libxml2 libxslt"
- uses: actions/download-artifact@v4
with:
name: generic-gem
path: gems
- run: ./scripts/test-gem-install gems --${{matrix.sys}}-system-libraries
shell: bash

generic-windows-install-ucrt:
needs: ["generic-package"]
strategy:
fail-fast: false
Expand Down Expand Up @@ -581,7 +558,6 @@ jobs:
- "arm-linux"
- "arm64-darwin"
- "x64-mingw-ucrt"
- "x64-mingw32"
- "x86-linux"
- "x86-mingw32" # github actions does not support this runtime as of 2022-12, but let's build anyway
- "x86_64-darwin"
Expand Down Expand Up @@ -612,7 +588,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.0", "3.1", "3.2", "3.3"]
ruby: ["3.1", "3.2", "3.3"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -634,7 +610,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.0", "3.1", "3.2", "3.3"]
ruby: ["3.1", "3.2", "3.3"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -656,7 +632,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.0", "3.1", "3.2", "3.3"]
ruby: ["3.1", "3.2", "3.3"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -678,7 +654,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.0", "3.1", "3.2", "3.3"]
ruby: ["3.1", "3.2", "3.3"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -715,7 +691,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.0", "3.1", "3.2", "3.3"]
ruby: ["3.1", "3.2", "3.3"]
runs-on: macos-13
steps:
- uses: actions/checkout@v4
Expand All @@ -735,7 +711,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.0", "3.1", "3.2", "3.3"]
ruby: ["3.1", "3.2", "3.3"]
runs-on: macos-14
steps:
- uses: actions/checkout@v4
Expand All @@ -750,27 +726,6 @@ jobs:
path: gems
- run: ./scripts/test-gem-install gems

cruby-x64-mingw32-install:
needs: ["cruby-package"]
strategy:
fail-fast: false
matrix:
ruby: ["3.0"]
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{matrix.ruby}}"
- uses: actions/download-artifact@v4
with:
name: cruby-x64-mingw32-gem
path: gems
- run: ./scripts/test-gem-install gems
shell: bash

cruby-x64-mingw-ucrt-install:
needs: ["cruby-package"]
strategy:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate-ci-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
tag: ["alpine", "mri-3.0", "mri-3.1", "mri-3.2", "mri-3.3", "ubuntu", "upstream-libxml"]
tag: ["alpine", "mri-3.1", "mri-3.2", "mri-3.3", "ubuntu", "upstream-libxml"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ inherit_from:

AllCops:
SuggestExtensions: false
TargetRubyVersion: "3.0"
TargetRubyVersion: "3.1"

Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: consistent_comma
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ You can help sponsor the maintainers of this software through one of these organ

Requirements:

- Ruby >= 3.0
- Ruby >= 3.1
- JRuby >= 9.4.0.0

If you are compiling the native extension against a system version of libxml2:
Expand Down
10 changes: 1 addition & 9 deletions ext/nokogiri/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1117,14 +1117,7 @@ def compile
end
env["RANLIB"] = "#{host}-ranlib"
if windows?
# NOTE: that in any particular windows gem package, we only ever compile against either
# msvcrt (ruby <= 3.0) or ucrt (ruby > 3.0), so even though this gets evaluated only once
# per gem (and not per-version-of-ruby), it's OK.
env["CFLAGS"] = if RbConfig::CONFIG["RUBY_SO_NAME"].include?("msvcrt")
concat_flags(env["CFLAGS"], "-D_RUBY_MSVCRT")
else
concat_flags(env["CFLAGS"], "-D_RUBY_UCRT")
end
concat_flags(env["CFLAGS"], "-D_RUBY_UCRT")
end
end

Expand All @@ -1141,7 +1134,6 @@ def compile
have_func("xmlCtxtSetOptions") # introduced in libxml2 2.13.0
have_func("xmlCtxtGetOptions") # introduced in libxml2 2.14.0
have_func("xmlSwitchEncodingName") # introduced in libxml2 2.13.0
have_func("rb_category_warning") # introduced in Ruby 3.0

other_library_versions_string = OTHER_LIBRARY_VERSIONS.map { |k, v| [k, v].join(":") }.join(",")
append_cppflags(%[-DNOKOGIRI_OTHER_LIBRARY_VERSIONS="\\"#{other_library_versions_string}\\""])
Expand Down
6 changes: 1 addition & 5 deletions ext/nokogiri/nokogiri.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,7 @@ void noko_xml_sax_parser_context_set_encoding(xmlParserCtxtPtr c_context, VALUE
#define DISCARD_CONST_QUAL(t, v) ((t)(uintptr_t)(v))
#define DISCARD_CONST_QUAL_XMLCHAR(v) DISCARD_CONST_QUAL(xmlChar *, v)

#if HAVE_RB_CATEGORY_WARNING
# define NOKO_WARN_DEPRECATION(message...) rb_category_warning(RB_WARN_CATEGORY_DEPRECATED, message)
#else
# define NOKO_WARN_DEPRECATION(message...) rb_warning(message)
#endif
#define NOKO_WARN_DEPRECATION(message...) rb_category_warning(RB_WARN_CATEGORY_DEPRECATED, message)

void noko__structured_error_func_save(libxmlStructuredErrorHandlerState *handler_state);
void noko__structured_error_func_save_and_set(libxmlStructuredErrorHandlerState *handler_state, void *user_data,
Expand Down
2 changes: 1 addition & 1 deletion nokogiri.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Gem::Specification.new do |spec|

spec.license = "MIT"

spec.required_ruby_version = ">= 3.0.0"
spec.required_ruby_version = ">= 3.1.0"

spec.homepage = "https://nokogiri.org"
spec.metadata = {
Expand Down
40 changes: 0 additions & 40 deletions oci-images/nokogiri-test/mri-3.0.dockerfile

This file was deleted.

62 changes: 0 additions & 62 deletions suppressions/ruby-3.0.supp

This file was deleted.

1 change: 0 additions & 1 deletion test/test_compaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

describe "compaction" do
def skip_compaction_tests
# supported in CRuby >= 3.0
!GC.respond_to?(:verify_compaction_references)
end

Expand Down

0 comments on commit 64da65b

Please sign in to comment.