You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue exists simply to offload the details from the CHANGELOG. The issue description will be kept up-to-date as v1.11.0 nears release, and then closed. The CHANGELOG will link here to provide additional detail for anyone who's interested.
This release changes the metadata provided in Nokogiri::VersionInfo which also affects the output of nokogiri -v. Some related constants have also been changed. If you're using VersionInfo programmatically, or relying on constants related to underlying library versions, please read the detailed changes for Nokogiri::VersionInfo below and accept our apologies for the inconvenience.
See #1482 and #1974 for background. Also note that some of these changes were driven by long-running work to improve the compilation and installation process.
Nokogiri::VersionInfo emits different information for the key nokogiri. Previously the value was a string containing Nokogiri::VERSION, but now contains a hash:
nokogiri/version now contains Nokogiri::VERSION
nokogiri/cppflags now contains an array of C preprocessor flags useful to compile code against Nokogiri, libxml2, or libxslt.
Nokogiri::VersionInfo will no longer contain the following key:
Nokogiri::VersionInfo emits different information for libxml/libxml2_path (see #1482 and #1788). This value previously pointed at a non-existent directory, but now points to a directory with useful contents. This key only continues to exist for the purposes of backwards-compatible integration with Nokogumbo and is planned for removal by v1.12.0. Instead, if you intend to compile against Nokogiri or the packaged libxml2 or libxslt, you should use nokogiri/cppflags (see above).
Nokogiri::VersionInfo now contains native gem metadata for libxml:
libxml/precompiled (true if the gem installed was a native gem, otherwise false)
libxml/iconv_enabled (true if libxml2 was built with iconv support, otherwise false)
Nokogiri::VersionInfo now contains version metadata for libxslt:
libxslt/source (either "packaged" or "system", similar to libxml/source)
libxslt/precompiled (true if the gem installed was a native gem, otherwise false)
libxslt/compiled (the version of libxslt the gem was compiled against, similar to libxml/compiled)
libxslt/loaded (the version of libxslt loaded at runtime, similar to libxml/loaded)
libxslt/patches moved from libxml/libxslt_patches
Nokogiri::VersionInfo key libxml/libxml2_patches has been renamed to libxml/patches
These global variables are no longer be defined:
NOKOGIRI_LIBXML2_PATH
NOKOGIRI_LIBXSLT_PATH
These constants have been renamed:
Nokogiri::LIBXML_VERSION is now Nokogiri::LIBXML_COMPILED_VERSION
Nokogiri::LIBXML_PARSER_VERSION is now Nokogiri::LIBXML_LOADED_VERSION
Nokogiri::NOKOGIRI_LIBXML2_PATCHES is now Nokogiri::LIBXML2_PATCHES
Nokogiri::NOKOGIRI_LIBXSLT_PATCHES is now Nokogiri::LIBXSLT_PATCHES
Nokogiri::NOKOGIRI_USE_PACKAGED_LIBRARIES is now Nokogiri::PACKAGED_LIBRARIES
These methods have been renamed and the return type changed from String to Gem::Version:
VersionInfo#loaded_parser_version is now #loaded_libxml_version
VersionInfo#compiled_parser_version is now #compiled_libxml_version
The JRuby gem's information now nests these keys under other_libraries:
xerces
nekohtml
The CRuby gem now provides information about libraries other than libxml2 and libxslt under other_libraries. Possible key values at the time this issue was published include:
zlib
libiconv
Nokogiri.uses_libxml? now accepts an optional requirement string which is interpreted as a Gem::Requirement and tested against the loaded libxml2 version (the value in VersionInfo key libxml/loaded). This greatly simplifies much of the version-dependent branching logic in both the implementation and the tests.
To sum these changes up, the output from CRuby when using packaged libraries was something like:
…dencies
Clarify library dependencies in native gems
---
**What problem is this PR intended to solve?**
See #2127 for background. We want to be clear about which dependencies are distributed in which gem files, and provide readable license informatino.
**Have you included adequate test coverage?**
Yes, for the changes in how VERSION_INFO is being presented.
**Does this change affect the behavior of either the C or the Java implementations?**
No functional changes outside of VersionInfo, which are captured in #2139.
This issue exists simply to offload the details from the CHANGELOG. The issue description will be kept up-to-date as v1.11.0 nears release, and then closed. The CHANGELOG will link here to provide additional detail for anyone who's interested.
This release changes the metadata provided in
Nokogiri::VersionInfo
which also affects the output ofnokogiri -v
. Some related constants have also been changed. If you're usingVersionInfo
programmatically, or relying on constants related to underlying library versions, please read the detailed changes forNokogiri::VersionInfo
below and accept our apologies for the inconvenience.See #1482 and #1974 for background. Also note that some of these changes were driven by long-running work to improve the compilation and installation process.
Nokogiri::VersionInfo
emits different information for the keynokogiri
. Previously the value was a string containingNokogiri::VERSION
, but now contains a hash:nokogiri/version
now containsNokogiri::VERSION
nokogiri/cppflags
now contains an array of C preprocessor flags useful to compile code against Nokogiri, libxml2, or libxslt.Nokogiri::VersionInfo
will no longer contain the following key:libxml/libxslt_path
(see Installed gems using vendored libraries report inappropriate library paths innokogiri -v
#1482). Previously this was available only when packaged libraries were being used, and it pointed at a non-existent directory.Nokogiri::VersionInfo
emits different information forlibxml/libxml2_path
(see #1482 and #1788). This value previously pointed at a non-existent directory, but now points to a directory with useful contents. This key only continues to exist for the purposes of backwards-compatible integration with Nokogumbo and is planned for removal by v1.12.0. Instead, if you intend to compile against Nokogiri or the packaged libxml2 or libxslt, you should usenokogiri/cppflags
(see above).Nokogiri::VersionInfo
now contains native gem metadata for libxml:libxml/precompiled
(true
if the gem installed was a native gem, otherwisefalse
)libxml/iconv_enabled
(true
if libxml2 was built with iconv support, otherwisefalse
)Nokogiri::VersionInfo
now contains version metadata for libxslt:libxslt/source
(either "packaged" or "system", similar tolibxml/source
)libxslt/precompiled
(true
if the gem installed was a native gem, otherwisefalse
)libxslt/compiled
(the version of libxslt the gem was compiled against, similar tolibxml/compiled
)libxslt/loaded
(the version of libxslt loaded at runtime, similar tolibxml/loaded
)libxslt/patches
moved fromlibxml/libxslt_patches
Nokogiri::VersionInfo
keylibxml/libxml2_patches
has been renamed tolibxml/patches
These global variables are no longer be defined:
NOKOGIRI_LIBXML2_PATH
NOKOGIRI_LIBXSLT_PATH
These constants have been renamed:
Nokogiri::LIBXML_VERSION
is nowNokogiri::LIBXML_COMPILED_VERSION
Nokogiri::LIBXML_PARSER_VERSION
is nowNokogiri::LIBXML_LOADED_VERSION
Nokogiri::NOKOGIRI_LIBXML2_PATCHES
is nowNokogiri::LIBXML2_PATCHES
Nokogiri::NOKOGIRI_LIBXSLT_PATCHES
is nowNokogiri::LIBXSLT_PATCHES
Nokogiri::NOKOGIRI_USE_PACKAGED_LIBRARIES
is nowNokogiri::PACKAGED_LIBRARIES
These methods have been renamed and the return type changed from
String
toGem::Version
:VersionInfo#loaded_parser_version
is now#loaded_libxml_version
VersionInfo#compiled_parser_version
is now#compiled_libxml_version
The JRuby gem's information now nests these keys under
other_libraries
:xerces
nekohtml
The CRuby gem now provides information about libraries other than libxml2 and libxslt under
other_libraries
. Possible key values at the time this issue was published include:zlib
libiconv
Nokogiri.uses_libxml?
now accepts an optional requirement string which is interpreted as aGem::Requirement
and tested against the loaded libxml2 version (the value inVersionInfo
keylibxml/loaded
). This greatly simplifies much of the version-dependent branching logic in both the implementation and the tests.To sum these changes up, the output from CRuby when using packaged libraries was something like:
but when using a native gem (with precompiled libraries) now looks like:
and the output from using system libraries now looks like:
The text was updated successfully, but these errors were encountered: