pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/textproc/ruby-nokogiri



Module Name:    pkgsrc
Committed By:   tsutsui
Date:           Mon Dec 30 10:54:46 UTC 2024

Modified Files:
        pkgsrc/textproc/ruby-nokogiri: Makefile PLIST distinfo

Log Message:
ruby-nokogiri: update to 1.18.1.

Upstream changes:
 https://github.com/sparklemotion/nokogiri/releases/tag/v1.18.1
 https://github.com/sparklemotion/nokogiri/releases/tag/v1.18.0
 https://github.com/sparklemotion/nokogiri/releases/tag/v1.17.2
 https://github.com/sparklemotion/nokogiri/releases/tag/v1.17.1
 https://github.com/sparklemotion/nokogiri/releases/tag/v1.17.0

v1.18.1 / 2024-12-29

Fixed

  * [CRuby] XML::SAX::ParserContext keeps a reference to the input to avoid a
    potential use-after-free issue that's existed since v1.4.0 (2009). (#3395)
    @flavorjones

v1.18.0 / 2024-12-25

Notable Changes

Ruby

This release introduces native gem support for Ruby 3.4.

This release ends support for Ruby 3.0, for which upstream support ended
2024-04-23.

This release ships separate precompiled GNU and Musl gems for all linux
platforms. Previously both GNU and Musl target systems could use and install
the same gem, e.g., the platform gem for x86_64-linux. Now, however, the
precompiled gem platforms would be x86_64-linux-gnu and x86_64-linux-musl. So
long as you're on bundler >= 2.5.6 this should be seamless other than perhaps
needing to update the platforms in your "Gemfile.lock".

This release drops precompiled native platform gems for x86-linux and
x86-mingw32. These platforms are still supported. Users on these platforms must
install the "ruby platform" gem which requires a compiler toolchain. See
Installing the ruby platform gem in the installation docs. (#3369, #3081)

Improved

  * [CRuby] CSS and XPath queries are faster now that Node#xpath, Node#css, and
    related functions are using a faster XPathContext initialization process.
    We benchmarked a 1.9x improvement for a 6kb file. Big thanks to @nwellnhof
    for helping with this one. (#3378, superseded by #3389) @flavorjones

v1.17.2 / 2024-12-12

Fixed

  * [JRuby] Fixed an issue where Node#dup when called with the new_parent_doc
    parameter was not decorating the node with the document's Node decorators.
    [#3372] @flavorjones

v1.17.1 / 2024-12-10

Fixed

  * Fixed a potential segfault when using Node#dup and DocumentFragment#dup. [#
    3359] @byroot @flavorjones
  * Node#dup and Node#clone now correctly decorate the new node with the
    document's Node decorators. [#3363] @flavorjones

v1.17.0 / 2024-12-08

Dependencies

  * [CRuby] Vendored libxml2 is updated to v2.13.5. @flavorjones
  * [CRuby] Vendored libxslt is updated to v1.1.42. @flavorjones
  * [CRuby] Minimum supported version of libxml2 raised to v2.9.2 (released
    2014-10-16) from v2.6.21. [#3232, #3287] @flavorjones
  * [JRuby] Minimum supported version of Java raised to 8 (released 2014-03-18)
    from 7. [#3134] @flavorjones
  * [CRuby] Update to rake-compiler-dock v1.5.1 for building precompiled native
    gems. [#3216] @flavorjones

Notable changes

SAX Parsers

The XML and HTML4 SAX parsers have received a lot of attention in this release,
and we've fixed multiple long-standing bugs with encoding and entity handling.
In addition, libxml2 v2.13 has also made some underlying fixes and improvements
to encoding and entity handling.

We're shipping these fixes in a minor release because we firmly believe the
resulting behavior is correct and standards-compliant, however applications
that have been depending on the buggy behavior may be impacted.

If your application relies on the SAX parsers, and in particular if you're
SAX-parsing documents with parsed entities or incorrect encoding declarations,
please read the changelog below carefully.

Fragment parsing

Document fragment parsing has been improved, particularly with respect to
handling malformed fragments or fragments with implicit namespace prefixes.
Namespace reconciliation still isn't where we want it to be, but it's an
improvement.

HTML5 fragment parsing now allows the context node to be specified as a
context: keyword argument to the HTML5::DocumentFragment.parse and .new
methods, which should allow for more flexible sanitization and future support
for the draft HTML Sanitizer API in downstream libraries.

Error handling

In scenarios where multiple errors could be reported by the underlying parser,
the errors will be aggregated into a single Nokogiri::XML::SyntaxError that is
raised. Previously only the final error reported by libxml2 was raised (which
was often misleading if it was only a warning and not the fatal error).

Schema validation

We've resolved many long-standing bugs in the various schema classes,
validation methods, and their error reporting. Behavior is now consistent
across schema types and input types, as well as parser backends (Xerces and
libxml2).

Keyword arguments

The following methods now accept keyword arguments in addition to positional
arguments, and use ... parameter forwarding when possible:
HTML4(), HTML4.fragment, HTML4.parse, HTML4::Document.parse,
HTML4::DocumentFragment#initialize, HTML4::DocumentFragment.parse, HTML5(),
HTML5.fragment, HTML5.parse, HTML5::Document.parse, HTML5::Document.read_io,
HTML5::Document.read_memory, HTML5::DocumentFragment#initialize,
HTML5::DocumentFragment.parse, XML(), XML.fragment, XML.parse,
XML::Document.parse, XML::DocumentFragment#initialize,
XML::DocumentFragment.parse, XML::Node#canonicalize, XML::Node.parse,
XML::Reader(), XML::RelaxNG(), XML::RelaxNG.new, XML::RelaxNG.read_memory,
XML::SAX::PushParser#initialize, XML::Schema(), XML::Schema.new,
XML::Schema.read_memory, and XSLT().

Special thanks to those contributors who participated in the RubyConf 2024 Hack
Day to work on #3323 to help modernize Nokogiri by adding keyword arguments and
using parameter forwarding in many methods, and expanding some of the
documentation! We intend to continue adding keyword argument support to more
methods. #3323 #3324 #3326 #3327 #3329 #3330 #3332 #3333 #3334 #3335 #3336 #
3342 #3355 #3356 @infews @matiasow @MattJones @mononoken @openbl @flavorjones

Added

  * Introduce support for a new SAX callback XML::SAX::Document#reference,
    which is called to report some parsed XML entities when
    XML::SAX::ParserContext#replace_entities is set to the default value false.
    This is necessary functionality for some applications that were previously
    relying on incorrect entity error reporting which has been fixed (see
    below). For more information, read the docs for
    Nokogiri::XML::SAX::Document. [#1926] @flavorjones
  * XML::SAX::Parser#parse_memory and #parse_file now accept an optional
    encoding argument. When not provided, the parser will fall back to the
    encoding passed to the initializer, and then fall back to autodetection. [#
    3288] @flavorjones
  * XML::SAX::ParserContext.memory now accepts an optional encoding argument.
    When not provided, the encoding will be autodetected. [#3288] @flavorjones
  * New readonly attributes XML::DocumentFragment#parse_options and
    HTML4::DocumentFragment#parse_options return the options used to parse the
    document fragment. @flavorjones
  * New method XML::Reader.new is the primary constructor to which XML::Reader
    () forwards. Both methods now take url:, encoding:, and options: kwargs in
    addition to the previous calling convention of passing positional
    parameters. #3326 @infews @flavorjones
  * [CRuby] The HTML5 parse methods accept a :parse_noscript_content_as_text
    keyword argument which will emulate the parsing behavior of a browser which
    has scripting enabled. [#3178, #3231] @stevecheckoway
  * [CRuby] HTML5::DocumentFragment.parse and .new accept a :context keyword
    argument that is the parse context node or element name. Previously this
    could only be passed in as a positional argument to .new and not at all to
    .parse. @flavorjones
  * [CRuby] Nokogiri::HTML5::Builder is similar to HTML4::Builder but returns
    an HTML5::Document. [#3119] @flavorjones
  * [CRuby] Attributes in an HTML5 document can be serialized individually,
    something that has always been supported by the HTML4 serializer. [#3125, #
    3127] @flavorjones
  * [CRuby] Introduce a compile-time option, --disable-xml2-legacy, to remove
    from libxml2 its dependencies on zlib and liblzma and disable implicit HTTP
    network requests. These all remain enabled by default, and are present in
    the precompiled native gems. This option is a precursor for removing these
    libraries in a future major release, but may be interesting for the
    security-minded who do not need features like automatic decompression and
    would like to remove these dependencies. You can read more and give
    feedback on these plans in #3168. [#3247] @flavorjones
  * [CRuby] If errors are returned from schema validation, a new attribute
    SyntaxError#path will contain the XPath path of the node that caused the
    validation failure. [#3316] @ryanong

Improved

  * Documentation has been improved for XML::RelaxNG, XML::Schema, XML::Reader,
    HTML5, HTML5::Document, HTML5::DocumentFragment, HTML4::Document,
    HTML4::DocumentFragment, XML, XML::Document, XML::DocumentFragment. #3355
    @flavorjones
  * Documentation has been improved for CSS.xpath_for. [#3224] @flavorjones
  * Documentation for the SAX parsing classes has been greatly improved,
    including encoding overrides and the complex entity-handling behavior. [#
    3265] @flavorjones
  * XML::Schema#read_memory and XML::RelaxNG#read_memory are now Ruby methods
    that call #from_document. Previously these were native functions, but they
    were buggy on both CRuby and JRuby (but worse on JRuby) and so this is now
    useful, comparable in performance, and simpler code that is easier to
    maintain. [#2113, #2115] @flavorjones
  * XML::SAX::ParserContext.io's encoding argument is now optional, and can now
    be an Encoding or an encoding name. When not provided will default to
    autodetecting the encoding. [#3288] @flavorjones
  * [CRuby] The update to libxml v2.13 improves "in context" fragment parsing
    recovery. We removed our hacky workaround for recovery that led to
    silently-degraded functionality when parsing fragments with parse errors.
    Specifically, malformed XML fragments that used implicit namespace prefixes
    will now "link up" to the namespaces in the parent document or node, where
    previously they did not. [#2092] @flavorjones
  * [CRuby] When multiple errors could be detected by the parser and there's no
    obvious document to save them in (for example, when parsing a document with
    the recovery parse option turned off), the libxml2 errors are aggregated
    into a single Nokogiri::XML::SyntaxError. Previously, only the last error
    recorded by libxml2 was raised, which might be misleading if it's merely a
    warning and not the fatal error preventing the operation. [#2562]
    @flavorjones
  * [CRuby] The SAX parser context and handler implementation has been
    simplified and now takes advantage of some of libxml2's default SAX
    handlers for entities and DTD management. [#3265] @flavorjones
  * [CRuby] When compiling packaged libraries from source, allow users' AR and
    LD environment variables to set the archiver and linker commands,
    respectively. This augments the existing CC environment variable to set the
    compiler command. [#3165] @ziggythehamster
  * [CRuby] When building from source on MacOS, environment variables AR and
    RANLIB are now respected when set instead of being overridden to /usr/bin/
    {ar,ranlib} (which is still the default). [#3338] @joshheinrichs-shopify

Fixed

  * Node#clone, NodeSet#clone, and *::Document#clone all properly copy the
    metaclass of the original as expected. Previously, #clone had been aliased
    to #dup for these classes (since v1.3.0 in 2009). [#316, #3117]
    @flavorjones
  * CSS queries for pseudo-selectors that cannot be translated into XPath
    expressions now raise a more descriptive Nokogiri::CSS::SyntaxError when
    they are parsed. Previously, an invalid XPath expression was evaluated and
    a hard-to-understand XPath error was raised by the query engine. [#3193]
    @flavorjones
  * Schema#validate returns errors on empty and malformed files. Previously, it
    would return errors on empty/malformed Documents, but not when reading from
    files. [#642] @flavorjones
  * XML::Builder is now consistent with how it sets block scope. Previously,
    missing methods with blocks on dynamically-created nodes were always
    handled by invoking instance_eval(&block) on the Builder, even when the
    Builder was yielding self for all other missing methods with blocks. [#1041
    ] @flavorjones
  * HTML4::DocumentFragment.parse accepts IO input. Previously, it required a
    string and would raise a TypeError when passed an IO. [#2069] @sharvy
  * [CRuby] libgumbo (the HTML5 parser) treats reaching max-depth as EOF. This
    addresses a class of issues when the parser is interrupted in this way. [#
    3121] @stevecheckoway
  * [CRuby] Update node GC lifecycle to avoid a potential memory leak with
    fragments in libxml 2.13.0 caused by changes in xmlAddChild. [#3156]
    @flavorjones
  * [CRuby] libgumbo correctly prints nonstandard element names in error
    messages. [#3219] @stevecheckoway
  * [CRuby] External entity references no long cause the SAX parser to register
    errors. [#1926] @flavorjones
  * [JRuby] Fixed entity reference serialization, which rendered both the
    reference and the replacement text. Incredibly nobody noticed this bug for
    over a decade. [#3272] @flavorjones
  * [JRuby] Fixed some bugs in how Node#attributes handles attributes with
    namespaces. [#2677, #2679] @flavorjones
  * [JRuby] Fix Schema#validate to only return the most recent Document's
    errors. Previously, if multiple documents were validated, this method
    returned the accumulated errors of all previous documents. [#1282]
    @flavorjones
  * [JRuby] Fix Schema#validate to not clobber the @errors instance variable. [
    #1282] @flavorjones
  * [JRuby] Empty documents fail schema validation as they should. [#783]
    @flavorjones
  * [JRuby] SAX parsing now respects the #replace_entities attribute, which
    defaults to false. Previously this flag defaulted to true and was
    completely ignored. [#614] @flavorjones
  * [JRuby] The SAX callback Document#start_element_namespace received a blank
    string for the URI when a namespace was not present. It now receives nil
    (as does the CRuby impl). [#3265] @flavorjones
  * [JRuby] Reader#outer_xml and #inner_xml encode entities properly. [#1523]
    @flavorjones

Changed

  * [CRuby] Nokogiri::XML::CData.new no longer accepts nil as the content
    argument, making CData behave like other character data classes (like
    Comment and Text). This change was necessitated by behavioral changes in
    libxml2 v2.13.0. If you wish to create an empty CDATA node, pass an empty
    string. [#3156] @flavorjones
  * Internals:
      + The internal CSS::XPathVisitor class now accepts the xpath prefix and
        the context namespaces as constructor arguments. The prefix: and ns:
        keyword arguments to CSS.xpath_for cannot be specified if the visitor:
        keyword argument is also used. CSS::XPathVisitor now exposes #builtins,
        #doctype, #prefix, and #namespaces attributes. [#3225] @flavorjones
      + The internal CSS selector cache has been extracted into a distinct
        class, CSS::SelectorCache. Previously it was part of the CSS::Parser
        class. [#3226] @flavorjones
      + The internal Gumbo.parse and Gumbo.fragment methods now take keyword
        arguments instead of positional arguments. [#3199] @flavorjones

Deprecated

  * The undocumented and unused method Nokogiri::CSS.parse is now deprecated
    and will generate a warning. The AST returned by this method is private and
    subject to change and removal in future versions of Nokogiri. This method
    will be removed in a future version of Nokogiri.
  * Passing an options hash to CSS.xpath_for is now deprecated and will
    generate a warning. Use keyword arguments instead. This will become an
    error in a future version of Nokogiri.
  * Passing libxml2 encoding IDs to SAX::ParserContext methods is now
    deprecated and will generate a warning. The use of SAX::Parser::ENCODINGS
    is also deprecated. Use Encoding objects or encoding names instead.


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 pkgsrc/textproc/ruby-nokogiri/Makefile
cvs rdiff -u -r1.40 -r1.41 pkgsrc/textproc/ruby-nokogiri/PLIST
cvs rdiff -u -r1.66 -r1.67 pkgsrc/textproc/ruby-nokogiri/distinfo

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/textproc/ruby-nokogiri/Makefile
diff -u pkgsrc/textproc/ruby-nokogiri/Makefile:1.96 pkgsrc/textproc/ruby-nokogiri/Makefile:1.97
--- pkgsrc/textproc/ruby-nokogiri/Makefile:1.96 Sat Dec  7 08:01:43 2024
+++ pkgsrc/textproc/ruby-nokogiri/Makefile      Mon Dec 30 10:54:46 2024
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.96 2024/12/07 08:01:43 tsutsui Exp $
+# $NetBSD: Makefile,v 1.97 2024/12/30 10:54:46 tsutsui Exp $
 
-DISTNAME=      nokogiri-1.16.8
+DISTNAME=      nokogiri-1.18.1
 CATEGORIES=    textproc
 
 MAINTAINER=    tsutsui%NetBSD.org@localhost
@@ -15,8 +15,8 @@ USE_TOOLS+=           pkg-config
 CPPFLAGS+=             -I${PREFIX}/include/libxml2
 MAKE_ENV+=             NOKOGIRI_USE_SYSTEM_LIBRARIES=yes
 RUBYGEM_OPTIONS+=      --format-executable
-OVERRIDE_GEMSPEC+=     :files ports/archives/libxml2-2.12.9.tar.gz= \
-                       ports/archives/libxslt-1.1.39.tar.gz=
+OVERRIDE_GEMSPEC+=     :files ports/archives/libxml2-2.13.5.tar.xz= \
+                       ports/archives/libxslt-1.1.42.tar.xz=
 
 BUILDLINK_TRANSFORM.Darwin+=   rm:-Wl,--no-as-needed
 

Index: pkgsrc/textproc/ruby-nokogiri/PLIST
diff -u pkgsrc/textproc/ruby-nokogiri/PLIST:1.40 pkgsrc/textproc/ruby-nokogiri/PLIST:1.41
--- pkgsrc/textproc/ruby-nokogiri/PLIST:1.40    Sun Aug  6 03:07:59 2023
+++ pkgsrc/textproc/ruby-nokogiri/PLIST Mon Dec 30 10:54:46 2024
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.40 2023/08/06 03:07:59 tsutsui Exp $
+@comment $NetBSD: PLIST,v 1.41 2024/12/30 10:54:46 tsutsui Exp $
 bin/nokogiri${RUBY_SUFFIX}
 ${GEM_HOME}/cache/${GEM_NAME}.gem
 ${GEM_EXTSDIR}/gem.build_complete
@@ -15,9 +15,10 @@ ${GEM_LIBDIR}/ext/nokogiri/gumbo.c
 ${GEM_LIBDIR}/ext/nokogiri/html4_document.c
 ${GEM_LIBDIR}/ext/nokogiri/html4_element_description.c
 ${GEM_LIBDIR}/ext/nokogiri/html4_entity_lookup.c
+${GEM_LIBDIR}/ext/nokogiri/html4_sax_parser.c
 ${GEM_LIBDIR}/ext/nokogiri/html4_sax_parser_context.c
 ${GEM_LIBDIR}/ext/nokogiri/html4_sax_push_parser.c
-${GEM_LIBDIR}/ext/nokogiri/libxml2_backwards_compat.c
+${GEM_LIBDIR}/ext/nokogiri/libxml2_polyfill.c
 ${GEM_LIBDIR}/ext/nokogiri/nokogiri.c
 ${GEM_LIBDIR}/ext/nokogiri/nokogiri.h
 ${GEM_LIBDIR}/ext/nokogiri/test_global_handlers.c
@@ -99,6 +100,7 @@ ${GEM_LIBDIR}/lib/nokogiri/css/node.rb
 ${GEM_LIBDIR}/lib/nokogiri/css/parser.rb
 ${GEM_LIBDIR}/lib/nokogiri/css/parser.y
 ${GEM_LIBDIR}/lib/nokogiri/css/parser_extras.rb
+${GEM_LIBDIR}/lib/nokogiri/css/selector_cache.rb
 ${GEM_LIBDIR}/lib/nokogiri/css/syntax_error.rb
 ${GEM_LIBDIR}/lib/nokogiri/css/tokenizer.rb
 ${GEM_LIBDIR}/lib/nokogiri/css/tokenizer.rex
@@ -120,6 +122,7 @@ ${GEM_LIBDIR}/lib/nokogiri/html4/sax/par
 ${GEM_LIBDIR}/lib/nokogiri/html4/sax/parser_context.rb
 ${GEM_LIBDIR}/lib/nokogiri/html4/sax/push_parser.rb
 ${GEM_LIBDIR}/lib/nokogiri/html5.rb
+${GEM_LIBDIR}/lib/nokogiri/html5/builder.rb
 ${GEM_LIBDIR}/lib/nokogiri/html5/document.rb
 ${GEM_LIBDIR}/lib/nokogiri/html5/document_fragment.rb
 ${GEM_LIBDIR}/lib/nokogiri/html5/node.rb
@@ -172,9 +175,9 @@ ${GEM_LIBDIR}/lib/nokogiri/xslt/styleshe
 ${GEM_LIBDIR}/lib/xsd/xmlparser/nokogiri.rb
 ${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/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/libxml2/0019-xpath-Use-separate-static-hash-table-for-standard-fu.patch
 ${GEM_LIBDIR}/patches/libxslt/0001-update-config.guess-and-config.sub-for-libxslt.patch
 ${GEM_HOME}/specifications/${GEM_NAME}.gemspec

Index: pkgsrc/textproc/ruby-nokogiri/distinfo
diff -u pkgsrc/textproc/ruby-nokogiri/distinfo:1.66 pkgsrc/textproc/ruby-nokogiri/distinfo:1.67
--- pkgsrc/textproc/ruby-nokogiri/distinfo:1.66 Sat Dec  7 08:01:43 2024
+++ pkgsrc/textproc/ruby-nokogiri/distinfo      Mon Dec 30 10:54:46 2024
@@ -1,5 +1,5 @@
-$NetBSD: distinfo,v 1.66 2024/12/07 08:01:43 tsutsui Exp $
+$NetBSD: distinfo,v 1.67 2024/12/30 10:54:46 tsutsui Exp $
 
-BLAKE2s (nokogiri-1.16.8.gem) = 7c60b528985e9e3ecc95e8e875c2e79dd37f58a197a2863988cf0370d017a5db
-SHA512 (nokogiri-1.16.8.gem) = 5dfcdc303dc1a6955f9e3831ca15ea76dad385e10df7d18b2d0b363498206f5fd1b7c24b2849a0199b311e174b8b77c18059b503e6c33e6cae43fffc4d9b0382
-Size (nokogiri-1.16.8.gem) = 4626944 bytes
+BLAKE2s (nokogiri-1.18.1.gem) = 7cecc3525c1479844a77dac4c4c1ca09fab38f5d57fa13d1d4f9336e377a4893
+SHA512 (nokogiri-1.18.1.gem) = 1767b70813504ae02a3cbad47897804ee1ba7596cf53979b890745165ea7b1016b62c67f0ed2b3bdef142062178cf7c0cae917b51391c006287e6157bdc047cf
+Size (nokogiri-1.18.1.gem) = 4582400 bytes



Home | Main Index | Thread Index | Old Index