Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dep: update libxml2 to 2.13.0 and libxslt to 1.1.40 #3230

Merged
merged 6 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ Nokogiri follows [Semantic Versioning](https://semver.org/), please see the [REA

## v1.next / unreleased

### Dependencies

* [CRuby] Vendored libxml2 is updated to [v2.13.0](https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.13.0). @flavorjones
* [CRuby] Vendored libxslt is updated to [v1.1.40](https://gitlab.gnome.org/GNOME/libxslt/-/releases/v1.1.40). @flavorjones


### Added

* [CRuby] `Nokogiri::HTML5::Builder` is similar to `HTML4::Builder` but returns an `HTML5::Document`. @flavorjones
Expand Down
12 changes: 6 additions & 6 deletions dependencies.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
libxml2:
version: "2.12.8"
sha256: "43ad877b018bc63deb2468d71f95219c2fac196876ef36d1bee51d226173ec93"
# sha-256 hash provided in https://download.gnome.org/sources/libxml2/2.12/libxml2-2.12.8.sha256sum
version: "2.13.0"
sha256: "d5a2f36bea96e1fb8297c6046fb02016c152d81ed58e65f3d20477de85291bc9"
# sha-256 hash provided in https://download.gnome.org/sources/libxml2/2.13/libxml2-2.13.0.sha256sum

libxslt:
version: "1.1.39"
sha256: "2a20ad621148339b0759c4d4e96719362dee64c9a096dbba625ba053846349f0"
# sha-256 hash provided in https://download.gnome.org/sources/libxslt/1.1/libxslt-1.1.39.sha256sum
version: "1.1.40"
sha256: "194715db023035f65fb566402f2ad2b5eab4c29d541f511305c40b29b1f48d13"
# sha-256 hash provided in https://download.gnome.org/sources/libxslt/1.1/libxslt-1.1.40.sha256sum

zlib:
version: "1.3.1"
Expand Down
25 changes: 0 additions & 25 deletions patches/libxml2/0003-libxml2.la-is-in-top_builddir.patch

This file was deleted.

28 changes: 15 additions & 13 deletions rakelib/extensions.rake
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,18 @@ CrossRuby = Struct.new(:version, :platform) do
case platform
when MINGW32_PLATFORM_REGEX
[
"advapi32.dll",
"bcrypt.dll",
"kernel32.dll",
"msvcrt.dll",
"ws2_32.dll",
"user32.dll",
"advapi32.dll",
"ws2_32.dll",
libruby_dll,
]
when MINGWUCRT_PLATFORM_REGEX
[
"kernel32.dll",
"ws2_32.dll",
"advapi32.dll",
"bcrypt.dll",
"api-ms-win-crt-convert-l1-1-0.dll",
"api-ms-win-crt-environment-l1-1-0.dll",
"api-ms-win-crt-filesystem-l1-1-0.dll",
Expand All @@ -160,22 +160,24 @@ CrossRuby = Struct.new(:version, :platform) do
"api-ms-win-crt-string-l1-1-0.dll",
"api-ms-win-crt-time-l1-1-0.dll",
"api-ms-win-crt-utility-l1-1-0.dll",
"kernel32.dll",
"ws2_32.dll",
libruby_dll,
]
when X86_LINUX_PLATFORM_REGEX
[
"libm.so.6",
"libc.so.6",
"libdl.so.2", # on old dists only - now in libc
"libm.so.6",
].tap do |dlls|
dlls << "libpthread.so.0" if ver >= "3.2.0"
end
when AARCH_LINUX_PLATFORM_REGEX
[
"libm.so.6",
"ld-linux-aarch64.so.1",
"libc.so.6",
"libdl.so.2", # on old dists only - now in libc
"ld-linux-aarch64.so.1",
"libm.so.6",
].tap do |dlls|
dlls << "libpthread.so.0" if ver >= "3.2.0"
end
Expand All @@ -187,10 +189,10 @@ CrossRuby = Struct.new(:version, :platform) do
]
when ARM_LINUX_PLATFORM_REGEX
[
"libm.so.6",
"libdl.so.2",
"libc.so.6",
"ld-linux-armhf.so.3",
"libc.so.6",
"libdl.so.2",
"libm.so.6",
].tap do |dlls|
dlls << "libpthread.so.0" if ver >= "3.2.0"
end
Expand Down Expand Up @@ -255,7 +257,7 @@ def verify_dll(dll, cross_ruby)
raise "export function Init_nokogiri not in dll #{dll}" unless /Table.*\sInit_nokogiri\s/mi.match?(dump)

# Verify that the DLL dependencies are all allowed.
actual_imports = dump.scan(/DLL Name: (.*)$/).map { |name| name.first.downcase }.uniq
actual_imports = dump.scan(/DLL Name: (.*)$/).map { |name| name.first.downcase }.uniq.sort
unless (actual_imports - allowed_imports).empty?
raise "unallowed so imports #{actual_imports.inspect} in #{dll} (allowed #{allowed_imports.inspect})"
end
Expand All @@ -268,7 +270,7 @@ def verify_dll(dll, cross_ruby)
raise "export function Init_nokogiri not in dll #{dll}" unless nm.include?(" T Init_nokogiri")

# Verify that the DLL dependencies are all allowed.
actual_imports = dump.scan(/NEEDED\s+(.*)/).map(&:first).uniq
actual_imports = dump.scan(/NEEDED\s+(.*)/).map(&:first).uniq.sort
unless (actual_imports - allowed_imports).empty?
raise "unallowed so imports #{actual_imports.inspect} in #{dll} (allowed #{allowed_imports.inspect})"
end
Expand Down Expand Up @@ -306,7 +308,7 @@ def verify_dll(dll, cross_ruby)
end

# Verify that the DLL dependencies are all allowed.
actual_imports = ldd.scan(/^\t([^ ]+) /).map(&:first).uniq
actual_imports = ldd.scan(/^\t([^ ]+) /).map(&:first).uniq.sort
unless (actual_imports - allowed_imports).empty?
raise "unallowed so imports #{actual_imports.inspect} in #{dll} (allowed #{allowed_imports.inspect})"
end
Expand Down
15 changes: 15 additions & 0 deletions test/xml/test_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,21 @@ def test_create_internal_subset
assert_equal("staff.dtd", ss.system_id)
end

def test_replacing_internal_subset
# see https://github.com/rgrove/sanitize/pull/238
skip_unless_libxml2("JRuby impl does not support unlinking the internal subset, it probably should")

document = Nokogiri::HTML5::Document.parse("<!DOCTYPE foo><html><div>hello</div></html>")

assert_equal("foo", document.internal_subset.name)

document.internal_subset.unlink
document.create_internal_subset("bar", nil, nil)

assert_equal("bar", document.internal_subset.name)
assert_operator(document.to_html, :start_with?, "<!DOCTYPE bar>")
end

def test_external_subset
assert_nil(xml.external_subset)
xml = Dir.chdir(ASSETS_DIR) do
Expand Down