From a9722f080b3556fec1c482233e1fe8e1acd0fac3 Mon Sep 17 00:00:00 2001 From: Wbert Castro Date: Fri, 22 Mar 2024 09:57:10 -0500 Subject: [PATCH 1/9] Update libxml2 from 2.10.4 to 2.12.6 --- dependencies.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dependencies.yml b/dependencies.yml index f830dee0278..39f3461c240 100644 --- a/dependencies.yml +++ b/dependencies.yml @@ -1,7 +1,7 @@ libxml2: - version: "2.10.4" - sha256: "ed0c91c5845008f1936739e4eee2035531c1c94742c6541f44ee66d885948d45" - # sha-256 hash provided in https://download.gnome.org/sources/libxml2/2.10/libxml2-2.10.4.sha256sum + version: "2.12.6" + sha256: "889c593a881a3db5fdd96cc9318c87df34eb648edfc458272ad46fd607353fbb" + # sha-256 hash provided in https://download.gnome.org/sources/libxml2/2.12/libxml2-2.12.6.sha256sum libxslt: version: "1.1.37" From aeb8b8a09408321e0a6242f7c1b43595139a8599 Mon Sep 17 00:00:00 2001 From: Wbert Castro Date: Mon, 25 Mar 2024 11:23:00 -0500 Subject: [PATCH 2/9] Remove useless validations --- .github/workflows/ci.yml | 33 -------------------------------- .github/workflows/downstream.yml | 3 --- 2 files changed, 36 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 50b05b092ea..b79258b1f35 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,17 +18,6 @@ on: - '*' jobs: - rubocop: - runs-on: ubuntu-latest - container: - image: ghcr.io/sparklemotion/nokogiri-test:mri-3.1 - steps: - - uses: actions/checkout@v2 - with: - submodules: true - - run: bundle install --local || bundle install - - run: bundle exec rake rubocop - gumbo: needs: ["rubocop"] strategy: @@ -296,25 +285,3 @@ jobs: bundle install --local || bundle install bundle exec rake compile -- --${{matrix.sys}}-system-libraries bundle exec rake test - - memcheck: - strategy: - fail-fast: false - matrix: - sys: ["disable"] - ruby: ["3.1"] - runs-on: ubuntu-latest - container: - image: ghcr.io/sparklemotion/nokogiri-test:mri-${{matrix.ruby}} - steps: - - uses: actions/checkout@v2 - with: - submodules: true - - uses: actions/cache@v2 - if: matrix.sys == 'disable' - with: - path: ports - key: ports-ubuntu-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}} - - run: bundle install --local || bundle install - - run: bundle exec rake compile -- --${{matrix.sys}}-system-libraries - - run: bundle exec rake test:memcheck diff --git a/.github/workflows/downstream.yml b/.github/workflows/downstream.yml index 7278f3f5462..efe063ba546 100644 --- a/.github/workflows/downstream.yml +++ b/.github/workflows/downstream.yml @@ -27,9 +27,6 @@ jobs: - url: https://github.com/flavorjones/loofah name: loofah command: "bundle exec rake test" - - url: https://github.com/rails/rails-html-sanitizer - name: rails-html-sanitizer - command: "bundle exec rake test" - url: https://github.com/rgrove/sanitize name: sanitize command: "bundle exec rake test" From c5980edd82340a06d0fe5b314573a60752ec264e Mon Sep 17 00:00:00 2001 From: Wbert Castro Date: Mon, 25 Mar 2024 11:26:40 -0500 Subject: [PATCH 3/9] Remove xmlmini from the tests --- .github/workflows/downstream.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/downstream.yml b/.github/workflows/downstream.yml index efe063ba546..31ba37b1294 100644 --- a/.github/workflows/downstream.yml +++ b/.github/workflows/downstream.yml @@ -36,9 +36,6 @@ jobs: - url: https://github.com/WinRb/Viewpoint name: viewpoint command: "bundle exec rspec spec" - - url: https://github.com/rails/rails - name: xmlmini - command: "cd activesupport && bundle exec rake test TESTOPTS=-n/XmlMini/" - url: https://github.com/pythonicrubyist/creek name: creek command: "bundle exec rake spec" From 25dee19229910510e157b677bdfd7a2e1c38bd28 Mon Sep 17 00:00:00 2001 From: Wbert Castro Date: Mon, 25 Mar 2024 11:55:33 -0500 Subject: [PATCH 4/9] Changes required for the new version works --- ext/nokogiri/xml_reader.c | 3 +++ scripts/test-gem-install | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ext/nokogiri/xml_reader.c b/ext/nokogiri/xml_reader.c index 0895ea6a72b..7a4f2665f95 100644 --- a/ext/nokogiri/xml_reader.c +++ b/ext/nokogiri/xml_reader.c @@ -723,6 +723,9 @@ rb_xml_reader_encoding(VALUE rb_reader) constructor_encoding = rb_iv_get(rb_reader, "@encoding"); if (RTEST(constructor_encoding)) { return constructor_encoding; + } else { + rb_iv_set(self, "@encoding", NOKOGIRI_STR_NEW2("UTF-8")); + c_document->encoding = xmlStrdup(BAD_CAST "UTF-8"); } Data_Get_Struct(rb_reader, xmlTextReader, c_reader); diff --git a/scripts/test-gem-install b/scripts/test-gem-install index cce7717d0cc..f94edaed3bc 100755 --- a/scripts/test-gem-install +++ b/scripts/test-gem-install @@ -29,7 +29,7 @@ if [ -n "${BUNDLE_APP_CONFIG:-}" ] ; then export BUNDLE_CACHE_PATH="${BUNDLE_APP_CONFIG}/cache" fi -gem install bundler -v "~> 2.2" +gem install bundler -v "2.4.22" # should work fine on ruby 2.7 and above bundle install --local || bundle install rm -rf lib ext # ensure we don't use the local files From 06763cf761993f9a3589f300f78464f5043a1c2e Mon Sep 17 00:00:00 2001 From: Wbert Castro Date: Mon, 25 Mar 2024 11:59:44 -0500 Subject: [PATCH 5/9] Remove changes --- scripts/test-gem-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/test-gem-install b/scripts/test-gem-install index f94edaed3bc..cce7717d0cc 100755 --- a/scripts/test-gem-install +++ b/scripts/test-gem-install @@ -29,7 +29,7 @@ if [ -n "${BUNDLE_APP_CONFIG:-}" ] ; then export BUNDLE_CACHE_PATH="${BUNDLE_APP_CONFIG}/cache" fi -gem install bundler -v "2.4.22" # should work fine on ruby 2.7 and above +gem install bundler -v "~> 2.2" bundle install --local || bundle install rm -rf lib ext # ensure we don't use the local files From f6dd7c995b65c74a9c62c9058179ef850d35109c Mon Sep 17 00:00:00 2001 From: Wbert Castro Date: Mon, 25 Mar 2024 12:20:52 -0500 Subject: [PATCH 6/9] Remove changes --- .github/workflows/ci.yml | 33 ++++++++++++++++++++++++++++++++ .github/workflows/downstream.yml | 6 ++++++ 2 files changed, 39 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b79258b1f35..50b05b092ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,17 @@ on: - '*' jobs: + rubocop: + runs-on: ubuntu-latest + container: + image: ghcr.io/sparklemotion/nokogiri-test:mri-3.1 + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - run: bundle install --local || bundle install + - run: bundle exec rake rubocop + gumbo: needs: ["rubocop"] strategy: @@ -285,3 +296,25 @@ jobs: bundle install --local || bundle install bundle exec rake compile -- --${{matrix.sys}}-system-libraries bundle exec rake test + + memcheck: + strategy: + fail-fast: false + matrix: + sys: ["disable"] + ruby: ["3.1"] + runs-on: ubuntu-latest + container: + image: ghcr.io/sparklemotion/nokogiri-test:mri-${{matrix.ruby}} + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - uses: actions/cache@v2 + if: matrix.sys == 'disable' + with: + path: ports + key: ports-ubuntu-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}} + - run: bundle install --local || bundle install + - run: bundle exec rake compile -- --${{matrix.sys}}-system-libraries + - run: bundle exec rake test:memcheck diff --git a/.github/workflows/downstream.yml b/.github/workflows/downstream.yml index 31ba37b1294..7278f3f5462 100644 --- a/.github/workflows/downstream.yml +++ b/.github/workflows/downstream.yml @@ -27,6 +27,9 @@ jobs: - url: https://github.com/flavorjones/loofah name: loofah command: "bundle exec rake test" + - url: https://github.com/rails/rails-html-sanitizer + name: rails-html-sanitizer + command: "bundle exec rake test" - url: https://github.com/rgrove/sanitize name: sanitize command: "bundle exec rake test" @@ -36,6 +39,9 @@ jobs: - url: https://github.com/WinRb/Viewpoint name: viewpoint command: "bundle exec rspec spec" + - url: https://github.com/rails/rails + name: xmlmini + command: "cd activesupport && bundle exec rake test TESTOPTS=-n/XmlMini/" - url: https://github.com/pythonicrubyist/creek name: creek command: "bundle exec rake spec" From a980593c7d0f6f222aca8760b0b61c78b096ce93 Mon Sep 17 00:00:00 2001 From: Wbert Castro Date: Mon, 25 Mar 2024 12:24:39 -0500 Subject: [PATCH 7/9] Apply the only needed change --- ext/nokogiri/xml_reader.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ext/nokogiri/xml_reader.c b/ext/nokogiri/xml_reader.c index 7a4f2665f95..93d9fa73241 100644 --- a/ext/nokogiri/xml_reader.c +++ b/ext/nokogiri/xml_reader.c @@ -725,7 +725,6 @@ rb_xml_reader_encoding(VALUE rb_reader) return constructor_encoding; } else { rb_iv_set(self, "@encoding", NOKOGIRI_STR_NEW2("UTF-8")); - c_document->encoding = xmlStrdup(BAD_CAST "UTF-8"); } Data_Get_Struct(rb_reader, xmlTextReader, c_reader); From dcce70d193db3e2f5c9d4de71c13349bfe024405 Mon Sep 17 00:00:00 2001 From: Wbert Castro Date: Mon, 25 Mar 2024 16:53:09 -0500 Subject: [PATCH 8/9] remove unnecessary change --- ext/nokogiri/xml_reader.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/ext/nokogiri/xml_reader.c b/ext/nokogiri/xml_reader.c index 93d9fa73241..0895ea6a72b 100644 --- a/ext/nokogiri/xml_reader.c +++ b/ext/nokogiri/xml_reader.c @@ -723,8 +723,6 @@ rb_xml_reader_encoding(VALUE rb_reader) constructor_encoding = rb_iv_get(rb_reader, "@encoding"); if (RTEST(constructor_encoding)) { return constructor_encoding; - } else { - rb_iv_set(self, "@encoding", NOKOGIRI_STR_NEW2("UTF-8")); } Data_Get_Struct(rb_reader, xmlTextReader, c_reader); From ccc7f0d8d0004e9a669928db35483e0871eec884 Mon Sep 17 00:00:00 2001 From: Wbert Castro Date: Tue, 2 Apr 2024 10:13:01 -0500 Subject: [PATCH 9/9] Update VERSION to v1.13.11 --- lib/nokogiri/version/constant.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nokogiri/version/constant.rb b/lib/nokogiri/version/constant.rb index 7280b062fc8..36f46deeb16 100644 --- a/lib/nokogiri/version/constant.rb +++ b/lib/nokogiri/version/constant.rb @@ -2,5 +2,5 @@ module Nokogiri # The version of Nokogiri you are using - VERSION = "1.13.10" + VERSION = "1.13.11" end