diff --git a/.cross_rubies b/.cross_rubies index fa47675a4fe..1aecb42cf4d 100644 --- a/.cross_rubies +++ b/.cross_rubies @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d71bca53f5..bd15be67fd7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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}} @@ -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" @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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" @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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: diff --git a/.github/workflows/generate-ci-images.yml b/.github/workflows/generate-ci-images.yml index 88dbc497fe3..70bc8f83763 100644 --- a/.github/workflows/generate-ci-images.yml +++ b/.github/workflows/generate-ci-images.yml @@ -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 diff --git a/.rubocop.yml b/.rubocop.yml index 37d96a2e158..def815012cc 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -22,7 +22,7 @@ inherit_from: AllCops: SuggestExtensions: false - TargetRubyVersion: "3.0" + TargetRubyVersion: "3.1" Style/TrailingCommaInArrayLiteral: EnforcedStyleForMultiline: consistent_comma diff --git a/README.md b/README.md index 6b523336ce1..dc324b11163 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/ext/nokogiri/extconf.rb b/ext/nokogiri/extconf.rb index f247fe718b4..00dab5e94a3 100644 --- a/ext/nokogiri/extconf.rb +++ b/ext/nokogiri/extconf.rb @@ -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 @@ -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}\\""]) diff --git a/ext/nokogiri/nokogiri.h b/ext/nokogiri/nokogiri.h index b75ebc47fa9..ba17b806ac2 100644 --- a/ext/nokogiri/nokogiri.h +++ b/ext/nokogiri/nokogiri.h @@ -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, diff --git a/nokogiri.gemspec b/nokogiri.gemspec index faa875ecaa1..e5c8b0effa4 100644 --- a/nokogiri.gemspec +++ b/nokogiri.gemspec @@ -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 = { diff --git a/oci-images/nokogiri-test/mri-3.0.dockerfile b/oci-images/nokogiri-test/mri-3.0.dockerfile deleted file mode 100644 index 3d08b47aaea..00000000000 --- a/oci-images/nokogiri-test/mri-3.0.dockerfile +++ /dev/null @@ -1,40 +0,0 @@ -FROM ruby:3.0 - -# include_file debian-prelude.step -# -*- dockerfile -*- - -ARG DEBIAN_FRONTEND=noninteractive -RUN apt-get update -RUN apt-get upgrade -y -RUN apt-get install -y apt-utils - - -# include_file debian-valgrind.step -# -*- dockerfile -*- - -RUN apt-get install -y valgrind - - -# include_file debian-libxml-et-al.step -# -*- dockerfile -*- - -RUN apt-get install -y libxslt-dev libxml2-dev zlib1g-dev pkg-config -RUN apt-get install -y libyaml-dev # for psych 5 - - -# include_file update-bundler.step -# -*- dockerfile -*- - -RUN gem install bundler - - -# include_file bundle-install.step -# -*- dockerfile -*- - -COPY Gemfile nokogiri/ -COPY Gemfile.lock nokogiri/ -COPY nokogiri.gemspec nokogiri/ - -RUN gem install bundler -v "$(grep -A 1 "BUNDLED WITH" nokogiri/Gemfile.lock | tail -n 1)" -RUN cd nokogiri && bundle install - diff --git a/suppressions/ruby-3.0.supp b/suppressions/ruby-3.0.supp deleted file mode 100644 index b776436cb78..00000000000 --- a/suppressions/ruby-3.0.supp +++ /dev/null @@ -1,62 +0,0 @@ -{ - ruby 3.0 startup - Memcheck:Addr4 - fun:iseq_peephole_optimize - fun:iseq_optimize* - fun:iseq_setup_insn - fun:iseq_setup_insn - fun:rb_iseq_compile_node - fun:rb_iseq_new_with_opt - fun:new_child_iseq - ... - # fun:iseq_compile_each0 - # fun:iseq_compile_each0 - # fun:rb_iseq_compile_node - # fun:rb_iseq_new_with_opt - # fun:new_child_iseq - # fun:iseq_compile_each0 - # fun:iseq_compile_each0 - # fun:rb_iseq_compile_node - # fun:rb_iseq_new_with_opt - # fun:rb_iseq_new_top - # fun:load_iseq_eval - # fun:require_internal - # fun:rb_require_string - # fun:vm_call_cfunc_with_frame - # fun:vm_sendish.constprop.531 - # fun:vm_exec_core - # fun:rb_vm_exec - # fun:load_iseq_eval - # fun:require_internal - # fun:rb_require_string - # fun:vm_call_cfunc_with_frame - # fun:vm_call_method_each_type - # fun:vm_call_alias - # fun:vm_sendish.constprop.531 - # fun:vm_exec_core - # fun:rb_vm_exec - # fun:load_iseq_eval - # fun:require_internal - # fun:rb_require_string - # fun:vm_call_cfunc_with_frame - # fun:vm_call_method_each_type - # fun:vm_call_alias - # fun:vm_sendish.constprop.531 - # fun:vm_exec_core - # fun:rb_vm_exec - # fun:load_iseq_eval - # fun:require_internal - # fun:rb_require_string - # fun:vm_call_cfunc_with_frame - # fun:vm_call_method_each_type - # fun:vm_call_alias - # fun:vm_sendish.constprop.531 - # fun:vm_exec_core - # fun:rb_vm_exec - # fun:load_iseq_eval - # fun:require_internal - # fun:rb_require_string - # fun:vm_call_cfunc_with_frame - # fun:vm_call_method_each_type - # fun:vm_call_alias -} diff --git a/test/test_compaction.rb b/test/test_compaction.rb index 68ac5c2f948..da4ea70a960 100644 --- a/test/test_compaction.rb +++ b/test/test_compaction.rb @@ -4,7 +4,6 @@ describe "compaction" do def skip_compaction_tests - # supported in CRuby >= 3.0 !GC.respond_to?(:verify_compaction_references) end