Skip to content

Commit 4729133

Browse files
authored
Merge pull request #2457 from sparklemotion/flavorjones-libxml-2.9.13-v1.13.x
upgrade to libxml 2.9.13 and libxslt 1.1.35 (branch v1.13.x)
2 parents e18da00 + 379f757 commit 4729133

16 files changed

+4965
-3985
lines changed

.github/workflows/ci.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -244,12 +244,11 @@ jobs:
244244
- uses: actions/checkout@v2
245245
with:
246246
submodules: true
247-
- uses: MSP-Greg/setup-ruby-pkgs@win-ucrt-2
247+
- uses: MSP-Greg/setup-ruby-pkgs@v1
248248
with:
249249
ruby-version: "${{matrix.ruby}}"
250250
mingw: "libxml2 libxslt"
251251
bundler-cache: true
252-
setup-ruby-ref: MSP-Greg/ruby-setup-ruby/win-ucrt-1
253252
- uses: actions/cache@v2
254253
if: matrix.sys == 'disable'
255254
with:

.github/workflows/gem-install.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,10 @@ jobs:
113113
- uses: actions/checkout@v2
114114
with:
115115
submodules: true
116-
- uses: MSP-Greg/setup-ruby-pkgs@win-ucrt-2
116+
- uses: MSP-Greg/setup-ruby-pkgs@v1
117117
with:
118118
ruby-version: "3.1"
119119
mingw: "libxml2 libxslt"
120-
setup-ruby-ref: MSP-Greg/ruby-setup-ruby/win-ucrt-1
121120
- uses: actions/download-artifact@v2
122121
with:
123122
name: cruby-gem
@@ -289,10 +288,9 @@ jobs:
289288
ruby: ["3.1"]
290289
runs-on: windows-2022
291290
steps:
292-
- uses: MSP-Greg/setup-ruby-pkgs@win-ucrt-2
291+
- uses: MSP-Greg/setup-ruby-pkgs@v1
293292
with:
294293
ruby-version: "${{matrix.ruby}}"
295-
setup-ruby-ref: MSP-Greg/ruby-setup-ruby/win-ucrt-1
296294
- uses: actions/download-artifact@v2
297295
with:
298296
name: cruby-x64-mingw-ucrt-gem

.github/workflows/upstream.yml

+22-23
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,12 @@ jobs:
8383
- uses: actions/checkout@v2
8484
with:
8585
submodules: true
86-
- uses: MSP-Greg/setup-ruby-pkgs@ucrt
86+
- uses: MSP-Greg/setup-ruby-pkgs@v1
8787
with:
8888
ruby-version: "head"
8989
apt-get: "libxml2-dev libxslt1-dev pkg-config"
9090
mingw: "_upgrade_ libxml2 libxslt pkgconf"
9191
bundler-cache: true
92-
setup-ruby-ref: MSP-Greg/ruby-setup-ruby/00-win-ucrt
9392
- uses: actions/cache@v2
9493
if: matrix.sys == 'disable'
9594
with:
@@ -135,24 +134,24 @@ jobs:
135134
- run: bundle exec rake compile
136135
- run: bundle exec rake test
137136

138-
html5lib-tests:
139-
runs-on: ubuntu-latest
140-
container:
141-
image: ghcr.io/sparklemotion/nokogiri-test:mri-3.1
142-
steps:
143-
- uses: actions/checkout@v2
144-
with:
145-
submodules: true
146-
- uses: actions/cache@v2
147-
with:
148-
path: ports
149-
key: ports-ubuntu-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
150-
- name: Update html5lib-tests
151-
run: |
152-
cd test/html5lib-tests
153-
git remote update origin
154-
git checkout origin/master
155-
git log --pretty=oneline -n1
156-
- run: bundle install --local || bundle install
157-
- run: bundle exec rake compile -- --disable-system-libraries
158-
- run: bundle exec rake test
137+
# html5lib-tests:
138+
# runs-on: ubuntu-latest
139+
# container:
140+
# image: ghcr.io/sparklemotion/nokogiri-test:mri-3.1
141+
# steps:
142+
# - uses: actions/checkout@v2
143+
# with:
144+
# submodules: true
145+
# - uses: actions/cache@v2
146+
# with:
147+
# path: ports
148+
# key: ports-ubuntu-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
149+
# - name: Update html5lib-tests
150+
# run: |
151+
# cd test/html5lib-tests
152+
# git remote update origin
153+
# git checkout origin/master
154+
# git log --pretty=oneline -n1
155+
# - run: bundle install --local || bundle install
156+
# - run: bundle exec rake compile -- --disable-system-libraries
157+
# - run: bundle exec rake test

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ Nokogiri follows [Semantic Versioning](https://semver.org/), please see the [REA
44

55
---
66

7+
## 1.13.2 / unreleased
8+
9+
### Dependencies
10+
11+
* [CRuby] Vendored libxml2 is updated from 2.9.12 to 2.9.13. This update addresses [CVE-2022-23308](https://gitlab.gnome.org/GNOME/libxml2/-/commit/652dd12). Full changelog is available at https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.13.news
12+
* [CRuby] Vendored libxslt is updated from 1.1.34 to 1.1.35. This update addresses [CVE-2021-30560](https://nvd.nist.gov/vuln/detail/CVE-2021-30560). Full changelog is available at https://download.gnome.org/sources/libxslt/1.1/libxslt-1.1.35.news
13+
14+
715
## 1.13.1 / 2022-01-13
816

917
### Fixed

dependencies.yml

+6-56
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,12 @@
11
libxml2:
2-
version: "2.9.12"
3-
sha256: "c8d6681e38c56f172892c85ddc0852e1fd4b53b4209e7f4ebf17f7e2eae71d92"
4-
# manually verified checksum:
5-
#
6-
# $ gpg --verify libxml2-2.9.12.tar.gz.asc ports/archives/libxml2-2.9.12.tar.gz
7-
# gpg: Signature made Thu 13 May 2021 02:59:16 PM EDT
8-
# gpg: using RSA key DB46681BB91ADCEA170FA2D415588B26596BEA5D
9-
# gpg: Good signature from "Daniel Veillard (Red Hat work email) <veillard@redhat.com>" [unknown]
10-
# gpg: aka "Daniel Veillard <Daniel.Veillard@w3.org>" [unknown]
11-
# gpg: WARNING: This key is not certified with a trusted signature!
12-
# gpg: There is no indication that the signature belongs to the owner.
13-
# Primary key fingerprint: C744 15BA 7C9C 7F78 F02E 1DC3 4606 B8A5 DE95 BC1F
14-
# Subkey fingerprint: DB46 681B B91A DCEA 170F A2D4 1558 8B26 596B EA5D
15-
#
16-
# using this pgp signature:
17-
#
18-
# -----BEGIN PGP SIGNATURE-----
19-
#
20-
# iQEzBAABCAAdFiEE20ZoG7ka3OoXD6LUFViLJllr6l0FAmCddwQACgkQFViLJllr
21-
# 6l11LQgAioRTdfmcC+uK/7+6HPtF/3c5zkX6j8VGYuvFBwZ0jayqMRBAl++fcpjE
22-
# JUU/JKebSZ/KCYjzyeOWK/i3Gq77iqm3UbZFB85rqu4a5P3gmj/4STWVyAx0KU3z
23-
# G3jKqDhJOt7c0acXb5lh2DngfDa1dn/VGcQcIXsqplNxNr4ET7MnSJjZ3nlxYfW2
24-
# E5vWBdPCMUeXDBl6MjYvw9XnGGBLUAaEJWoFToG6jKmVf4GAd9nza20jj5dtbcJq
25-
# QEOaSDKDr+f9h2NS8haOhJ9vOpy52PdeGzaFlbRkXarGXuAr8kITgATVs8FAqcgv
26-
# MoVhmrO5r2hJf0dCM9fZoYqzpMfmNA==
27-
# =KfJ9
28-
# -----END PGP SIGNATURE-----
29-
#
2+
version: "2.9.13"
3+
sha256: "276130602d12fe484ecc03447ee5e759d0465558fbc9d6bd144e3745306ebf0e"
4+
# sha-256 hash provided in https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.13.sha256sum
305

316
libxslt:
32-
version: "1.1.34"
33-
sha256: "98b1bd46d6792925ad2dfe9a87452ea2adebf69dcb9919ffd55bf926a7f93f7f"
34-
# manually verified checksum:
35-
#
36-
# $ gpg --verify ~/Downloads/libxslt-1.1.34.tar.gz.asc ports/archives/libxslt-1.1.34.tar.gz
37-
# gpg: Signature made Wed 30 Oct 2019 04:02:48 PM EDT
38-
# gpg: using RSA key DB46681BB91ADCEA170FA2D415588B26596BEA5D
39-
# gpg: Good signature from "Daniel Veillard (Red Hat work email) <veillard@redhat.com>" [unknown]
40-
# gpg: aka "Daniel Veillard <Daniel.Veillard@w3.org>" [unknown]
41-
# gpg: WARNING: This key is not certified with a trusted signature!
42-
# gpg: There is no indication that the signature belongs to the owner.
43-
# Primary key fingerprint: C744 15BA 7C9C 7F78 F02E 1DC3 4606 B8A5 DE95 BC1F
44-
# Subkey fingerprint: DB46 681B B91A DCEA 170F A2D4 1558 8B26 596B EA5D
45-
#
46-
# using this pgp signature:
47-
#
48-
# -----BEGIN PGP SIGNATURE-----
49-
#
50-
# iQEzBAABCAAdFiEE20ZoG7ka3OoXD6LUFViLJllr6l0FAl257GgACgkQFViLJllr
51-
# 6l2vVggAjJEHmASiS56SxhPOsGqbfBihM66gQFoIymQfMu2430N1GSTkLsfbkJO8
52-
# 8yBX11NjzK/m9uxwshMW3rVCU7EpL3PUimN3reXdPiQj9hAOAWF1V3BZNevbQC2E
53-
# FCIraioukaidf8sjUG4/sGpK/gOcP/3hYoN0HUoBigCNJjDqhijxM3M3GJJtCASp
54-
# jL4CQbs2OmxW8ixOZbuWEESvFFHUgYRsdZjRVN+GRfSOvJjxypurmYwQ3RjO7JxL
55-
# 2FY8qKQ+xpeID8NV8F5OUEvWBjk1QS133VTqBZNlONdnEtV/og6jNu5k0O/Kvhup
56-
# caR+8TMErOcLr9OgDklO6DoYyAsf9Q==
57-
# =g4i4
58-
# -----END PGP SIGNATURE-----
59-
#
7+
version: "1.1.35"
8+
sha256: "8247f33e9a872c6ac859aa45018bc4c4d00b97e2feac9eebc10c93ce1f34dd79"
9+
# sha-256 hash provided in https://download.gnome.org/sources/libxslt/1.1/libxslt-1.1.35.sha256sum
6010

6111
zlib:
6212
version: "1.2.11"

ext/nokogiri/extconf.rb

+18-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
REQUIRED_LIBXML_VERSION = "2.6.21"
1616
RECOMMENDED_LIBXML_VERSION = "2.9.3"
1717

18-
REQUIRED_MINI_PORTILE_VERSION = "~> 2.7.0" # keep this version in sync with the one in the gemspec
18+
REQUIRED_MINI_PORTILE_VERSION = "~> 2.8.0" # keep this version in sync with the one in the gemspec
1919
REQUIRED_PKG_CONFIG_VERSION = "~> 1.1"
2020

2121
# Keep track of what versions of what libraries we build against
@@ -211,6 +211,18 @@ def local_have_library(lib, func = nil, headers = nil)
211211
have_library(lib, func, headers) || have_library("lib#{lib}", func, headers)
212212
end
213213

214+
def gnome_source
215+
# As of 2022-02-20, some mirrors have expired SSL certificates. I'm able to retrieve from my home,
216+
# but whatever host is resolved on the github actions workers see an expired cert.
217+
#
218+
# See https://github.com/sparklemotion/nokogiri/runs/5266206403?check_suite_focus=true
219+
if ENV["NOKOGIRI_USE_CANONICAL_GNOME_SOURCE"]
220+
"https://download.gnome.org"
221+
else
222+
"https://mirror.csclub.uwaterloo.ca/gnome" # old reliable
223+
end
224+
end
225+
214226
LOCAL_PACKAGE_RESPONSE = Object.new
215227
def LOCAL_PACKAGE_RESPONSE.%(package)
216228
package ? "yes: #{package}" : "no"
@@ -512,6 +524,7 @@ def recipe.port_path
512524
513525
EOM
514526

527+
pp(recipe.files)
515528
chdir_for_build { recipe.cook }
516529
FileUtils.touch(checkpoint)
517530
end
@@ -770,8 +783,9 @@ def compile
770783
if source_dir
771784
recipe.source_directory = source_dir
772785
else
786+
minor_version = Gem::Version.new(recipe.version).segments.take(2).join(".")
773787
recipe.files = [{
774-
url: "http://xmlsoft.org/sources/#{recipe.name}-#{recipe.version}.tar.gz",
788+
url: "#{gnome_source}/sources/libxml2/#{minor_version}/#{recipe.name}-#{recipe.version}.tar.xz",
775789
sha256: dependencies["libxml2"]["sha256"],
776790
}]
777791
recipe.patch_files = Dir[File.join(PACKAGE_ROOT_DIR, "patches", "libxml2", "*.patch")].sort
@@ -818,8 +832,9 @@ def compile
818832
if source_dir
819833
recipe.source_directory = source_dir
820834
else
835+
minor_version = Gem::Version.new(recipe.version).segments.take(2).join(".")
821836
recipe.files = [{
822-
url: "http://xmlsoft.org/sources/#{recipe.name}-#{recipe.version}.tar.gz",
837+
url: "#{gnome_source}/sources/libxslt/#{minor_version}/#{recipe.name}-#{recipe.version}.tar.xz",
823838
sha256: dependencies["libxslt"]["sha256"],
824839
}]
825840
recipe.patch_files = Dir[File.join(PACKAGE_ROOT_DIR, "patches", "libxslt", "*.patch")].sort

nokogiri.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ Gem::Specification.new do |spec|
318318
spec.extra_rdoc_files += Dir.glob("README.md")
319319
spec.rdoc_options = ["--main", "README.md"]
320320

321-
spec.add_runtime_dependency("mini_portile2", "~> 2.7.0") unless java_p # keep version in sync with extconf.rb
321+
spec.add_runtime_dependency("mini_portile2", "~> 2.8.0") unless java_p # keep version in sync with extconf.rb
322322
spec.add_runtime_dependency("racc", "~> 1.4")
323323

324324
spec.add_development_dependency("bundler", "~> 2.2")

patches/libxml2/0004-use-glibc-strlen.patch

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,18 @@ diff --git a/xmlstring.c b/xmlstring.c
3131
index e8a1e45d..df247dff 100644
3232
--- a/xmlstring.c
3333
+++ b/xmlstring.c
34-
@@ -423,14 +423,9 @@ xmlStrsub(const xmlChar *str, int start, int len) {
34+
@@ -423,12 +423,7 @@ xmlStrsub(const xmlChar *str, int start, int len) {
3535

3636
int
3737
xmlStrlen(const xmlChar *str) {
38-
- int len = 0;
38+
- size_t len = 0;
3939
-
4040
if (str == NULL) return(0);
4141
- while (*str != 0) { /* non input consuming */
4242
- str++;
4343
- len++;
4444
- }
45-
- return(len);
45+
- return(len > INT_MAX ? 0 : len);
4646
+
4747
+ return strlen((const char*)str);
4848
}

0 commit comments

Comments
 (0)