Skip to content

Commit

Permalink
ruby-nokogiri: update to 1.15.3.
Browse files Browse the repository at this point in the history
Upstream changes:
 https://github.com/sparklemotion/nokogiri/releases/tag/v1.15.3
 https://github.com/sparklemotion/nokogiri/releases/tag/v1.15.2
 https://github.com/sparklemotion/nokogiri/releases/tag/v1.15.1
 https://github.com/sparklemotion/nokogiri/releases/tag/v1.15.0

1.15.3 / 2023-07-05

Fixed

 * Passing an object that is not a kind of XML::Node as the first parameter to
   CDATA.new now raises a TypeError. Previously this would result in either a
   segfault (CRuby) or a Java exception (JRuby). [#2920]
 * Passing an object that is not a kind of XML::Node as the first parameter to
   Schema.from_document now raises a TypeError. Previously this would result
   in either a segfault (CRuby) or a Java exception (JRuby). [#2920]
 * [CRuby] Passing an object that is not a kind of XML::Node as the second
   parameter to Text.new now raises a TypeError. Previously this would result
   in a segfault. [#2920]
 * [CRuby] Replacing a node's children via methods like Node#inner_html=, #
   children=, and #replace no longer defensively dups the node's next sibling
   if it is a Text node. This behavior was originally adopted to work around
   libxml2's memory management (see #283 and #595) but should not have
   included operations involving xmlAddChild(). [#2916]
 * [JRuby] Fixed NPE when serializing an unparented HTML node. [#2559, #2895]
   (Thanks, @cbasguti!)

1.15.2 / 2023-05-24

Dependencies

 * [JRuby] Vendored org.nokogiri:nekodtd is updated to v0.1.11.noko2. This is
   functionally equivalent to v0.1.11.noko1 but restores support for Java 8.

Fixed

 * [JRuby] Java 8 support is restored, fixing a regression present in
   v1.14.0..v1.14.4 and v1.15.0..v1.15.1. [#2887]

1.15.1 / 2023-05-19

Dependencies

 * [CRuby] Vendored libxml2 is updated to v2.11.4 from v2.11.3. For details
   please see https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.11.4

Fixed

 * [CRuby] The libxml2 update fixes an encoding regression when push-parsing
   UTF-8 sequences. [#2882, upstream issue and commit]

1.15.0 / 2023-05-15

Notes

Ability to opt into system malloc and free

Since 2009, Nokogiri has configured libxml2 to use ruby_xmalloc et al for
memory management. This has provided benefits for memory management, but comes
with a performance penalty.

Users can now opt into using system malloc for libxml2 memory management by
setting an environment variable:

# "default" here means "libxml2's default" which is system malloc
NOKOGIRI_LIBXML_MEMORY_MANAGEMENT=default

Benchmarks show that this setting will significantly improve performance, but
be aware that the tradeoff may involve poorer memory management including
bloated heap sizes and/or OOM conditions.

You can read more about this in the decision record at adr/
2023-04-libxml-memory-management.md.

Dependencies

 * [CRuby] Vendored libxml2 is updated to v2.11.3 from v2.10.4. For details
   please see:
    + https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.11.0
    + https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.11.1
    + https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.11.2
    + https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.11.3
 * [CRuby] Vendored libxslt is updated to v1.1.38 from v1.1.37. For details
   please see:
    + https://gitlab.gnome.org/GNOME/libxslt/-/releases/v1.1.38

Added

 * Encoding objects may now be passed to serialization methods like #to_xml, #
   to_html, #serialize, and #write_to to specify the output encoding.
   Previously only encoding names (strings) were accepted. [#2774, #2798]
   (Thanks, @ellaklara!)
 * [CRuby] Users may opt into using system malloc for libxml2 memory
   management. For more detail, see note above or adr/
   2023-04-libxml-memory-management.md.

Changed

 * [CRuby] Schema.from_document now makes a defensive copy of the document if
   it has blank text nodes with Ruby objects instantiated for them. This
   prevents unsafe behavior in libxml2 from causing a segfault. There is a
   small performance cost, but we think this has the virtue of being "what the
   user meant" since modifying the original is surprising behavior for most
   users. Previously this was addressed in v1.10.9 by raising an exception.

Fixed

 * [CRuby] XSLT.transform now makes a defensive copy of the document if it has
   blank text nodes with Ruby objects instantiated for them and the template
   uses xsl:strip-spaces. This prevents unsafe behavior in libxslt from
   causing a segfault. There is a small performance cost, but we think this
   has the virtue of being "what the user meant" since modifying the original
   is surprising behavior for most users. Previously this would allow unsafe
   memory access and potentially segfault. [#2800]

Improved

 * Nokogiri::XML::Node::SaveOptions#inspect now shows the names of the options
   set in the bitmask, similar to ParseOptions. [#2767]
 * #inspect and pretty-printing are improved for AttributeDecl,
   ElementContent, ElementDecl, and EntityDecl.
 * [CRuby] The C extension now uses Ruby's TypedData API for managing all the
   libxml2 structs. Write barriers may improve GC performance in some extreme
   cases. [#2808] (Thanks, @etiennebarrie and @byroot!)
 * [CRuby] ObjectSpace.memsize_of reports a pretty good guess of memory usage
   when called on Nokogiri::XML::Document objects. [#2807] (Thanks,
   @etiennebarrie and @byroot!)
 * [CRuby] Users installing the "ruby" platform gem and compiling libxml2 and
   libxslt from source will now be using a modern config.guess and config.sub
   that supports new architectures like loongarch64. [#2831] (Thanks,
   @zhangwenlong8911!)
 * [CRuby] HTML5 parser:
    + adjusts the specified attributes, adding xlink:arcrole and removing
      xml:base [#2841, #2842]
    + allows <hr> in <select> [whatwg/html#3410, whatwg/html#9124]
 * [JRuby] Node#first_element_child now returns nil if there are only
   non-element children. Previously a null pointer exception was raised. [#
   2808, #2844]
 * Documentation for Nokogiri::XSLT now has usage examples including custom
   function handlers.

Deprecated

 * Passing a Nokogiri::XML::Node as the first parameter to CDATA.new is
   deprecated and will generate a warning. This parameter should be a kind of
   Nokogiri::XML::Document. This will become an error in a future version of
   Nokogiri.
 * Passing a Nokogiri::XML::Node as the first parameter to
   Schema.from_document is deprecated and will generate a warning. This
   parameter should be a kind of Nokogiri::XML::Document. This will become an
   error in a future version of Nokogiri.
 * Passing a Nokogiri::XML::Node as the second parameter to Text.new is
   deprecated and will generate a warning. This parameter should be a kind of
   Nokogiri::XML::Document. This will become an error in a future version of
   Nokogiri.
 * [CRuby] Calling a custom XPath function without the nokogiri namespace is
   deprecated and will generate a warning. Support for non-namespaced
   functions will be removed in a future version of Nokogiri. (Note that JRuby
   has never supported non-namespaced custom XPath functions.)
  • Loading branch information
tsutsui committed Aug 6, 2023
1 parent 1a93913 commit e9a43f2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
8 changes: 4 additions & 4 deletions textproc/ruby-nokogiri/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# $NetBSD: Makefile,v 1.80 2023/05/13 18:13:43 tsutsui Exp $
# $NetBSD: Makefile,v 1.81 2023/08/06 03:07:59 tsutsui Exp $

DISTNAME= nokogiri-1.14.4
DISTNAME= nokogiri-1.15.3
CATEGORIES= textproc

MAINTAINER= [email protected]
Expand All @@ -14,8 +14,8 @@ USE_GCC_RUNTIME= yes
USE_TOOLS+= pkg-config
MAKE_ENV+= NOKOGIRI_USE_SYSTEM_LIBRARIES=yes
RUBYGEM_OPTIONS+= --format-executable
OVERRIDE_GEMSPEC+= :files ports/archives/libxml2-2.10.4.tar.gz= \
ports/archives/libxslt-1.1.37.tar.gz=
OVERRIDE_GEMSPEC+= :files ports/archives/libxml2-2.11.4.tar.gz= \
ports/archives/libxslt-1.1.38.tar.gz=

# XXX: work around bug in bootstrap-mk-files, remove when fixed
MAKE_ENV.SunOS+= ARFLAGS=rcv
Expand Down
6 changes: 4 additions & 2 deletions textproc/ruby-nokogiri/PLIST
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@comment $NetBSD: PLIST,v 1.39 2023/02/04 02:07:05 tsutsui Exp $
@comment $NetBSD: PLIST,v 1.40 2023/08/06 03:07:59 tsutsui Exp $
bin/nokogiri${RUBY_SUFFIX}
${GEM_HOME}/cache/${GEM_NAME}.gem
${GEM_EXTSDIR}/gem.build_complete
Expand Down Expand Up @@ -174,5 +174,7 @@ ${GEM_LIBDIR}/patches/libxml2/0001-Remove-script-macro-support.patch
${GEM_LIBDIR}/patches/libxml2/0002-Update-entities-to-remove-handling-of-ssi.patch
${GEM_LIBDIR}/patches/libxml2/0003-libxml2.la-is-in-top_builddir.patch
${GEM_LIBDIR}/patches/libxml2/0009-allow-wildcard-namespaces.patch
${GEM_LIBDIR}/patches/libxslt/0001-update-automake-files-for-arm64.patch
${GEM_LIBDIR}/patches/libxml2/0010-update-config.guess-and-config.sub-for-libxml2.patch
${GEM_LIBDIR}/patches/libxml2/0011-rip-out-libxml2-s-libc_single_threaded-support.patch
${GEM_LIBDIR}/patches/libxslt/0001-update-config.guess-and-config.sub-for-libxslt.patch
${GEM_HOME}/specifications/${GEM_NAME}.gemspec
8 changes: 4 additions & 4 deletions textproc/ruby-nokogiri/distinfo
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$NetBSD: distinfo,v 1.57 2023/05/13 18:13:43 tsutsui Exp $
$NetBSD: distinfo,v 1.58 2023/08/06 03:07:59 tsutsui Exp $

BLAKE2s (nokogiri-1.14.4.gem) = 469a6b03060e31dd5ce2923a4bb3e47a1202b6b6d0bfba8db1ed0f9ce86fa674
SHA512 (nokogiri-1.14.4.gem) = 875c5dcacf8c3c383686d1cba07dadaf9631096ebd46c09c7c890d21fa802191d9c3d1895960f7cda7f928cda64342b14f21813d5e9f1feb40c7cb0f72792144
Size (nokogiri-1.14.4.gem) = 4646912 bytes
BLAKE2s (nokogiri-1.15.3.gem) = 4ff21c3b67dea5faff4a9942be78cb19f09e16afb6e2349b8d56eb7182eafe14
SHA512 (nokogiri-1.15.3.gem) = d5159f0ce8eb43e5dd65138cb17519bd15caec36889fde3fcef53e64261172e69d3676c0119c5ab247e19d5f8e8f03c3bbde2285cd8d0974cbf8a4be5e30c58d
Size (nokogiri-1.15.3.gem) = 4609024 bytes

0 comments on commit e9a43f2

Please sign in to comment.