Skip to content

Commit

Permalink
remove nokogumbo integration testing and version info libxml2_path (#…
Browse files Browse the repository at this point in the history
…3042)

**What problem is this PR intended to solve?**

Nokogumbo has been EOL for two years, let's stop running the integration
testing, and remove the nokogumbo-specific VersionInfo key
`libxml/libxml2_path` (which has been superseded by `nokogiri/cppflags`
and `nokogiri/ldflags` values).


**Have you included adequate test coverage?**

Test coverage for nokogumbo integration scenarios was removed.


**Does this change affect the behavior of either the C or the Java
implementations?**

N/A
  • Loading branch information
flavorjones authored Nov 28, 2023
2 parents def3710 + 828047c commit 9d92bd3
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 102 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Documentation on what can be matched:
* Removed `Nokogiri::HTML5.get` which was deprecated in v1.12.0. [#2278] (@flavorjones)
* Removed the CSS-to-XPath utility modules `XPathVisitorAlwaysUseBuiltins` and `XPathVisitorOptimallyUseBuiltins`, which were deprecated in v1.13.0 in favor of `XPathVisitor` constructor args. [#2403] (@flavorjones)
* Removed `XML::Reader#attribute_nodes` which was deprecated in v1.13.8 in favor of `#attribute_hash`. [#2598, #2599] (@flavorjones)
* Removed the `libxml/libxml2_path` key from `VersionInfo`, used in the past for third-party library integration, in favor of the `nokogiri/cppflags` and `nokogiri/ldflags` keys. Please note that third-party library integration is not fully supported and may be deprecated soon, see #2746 for more context. [#2143] (@flavorjones)


## 1.15.5 / 2023-11-17
Expand Down
2 changes: 0 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,6 @@ See [Making a release](#making-a-release) below for the checklist.

`scripts/test-exported-symbols` checks the compiled `nokogiri.so` library for surprising exported symbols. This script likely only works on Linux, sorry.

`scripts/test-nokogumbo-compatibility` is used by CI to ensure that Nokogumbo installs correctly against the currently-installed version of Nokogiri. Nokogumbo receives this extra care because it compiles against Nokogiri's and libxml2's header files, and makes assumptions about what symbols are exported by Nokogiri's extension library.

`scripts/files-modified-by-open-prs` is a hack to see what files are being proposed to change in the set of open pull requests. This might be useful if you're thinking about radically changing a file, to be aware of what merge conflicts might result. This could probably be a rake task.

There's a `Vagrantfile` in the project root which I've used once or twice to try to reproduce problems non-Linux systems (like OpenBSD). It's not well-maintained so YMMV.
Expand Down
3 changes: 1 addition & 2 deletions ext/nokogiri/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -651,8 +651,7 @@ def needs_darwin_linker_hack
append_ldflags(ENV["LDFLAGS"].split) unless ENV["LDFLAGS"].nil?
$LIBS = concat_flags($LIBS, ENV["LIBS"])

# nokogumbo code uses C90/C99 features, let's make sure older compilers won't give
# errors/warnings. see #2302
# libgumbo uses C90/C99 features, see #2302
append_cflags(["-std=c99", "-Wno-declaration-after-statement"])

# gumbo html5 serialization is slower with O3, let's make sure we use O2
Expand Down
11 changes: 6 additions & 5 deletions lib/nokogiri/version/info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,14 @@ def to_hash
nokogiri["version"] = Nokogiri::VERSION

unless jruby?
# enable gems like nokogumbo to build with the following in their extconf.rb:
# enable gems to build against Nokogiri with the following in their extconf.rb:
#
# append_cflags(Nokogiri::VERSION_INFO["nokogiri"]["cppflags"])
# append_ldflags(Nokogiri::VERSION_INFO["nokogiri"]["ldflags"])
#
# though, this won't work on all platform and versions of Ruby, and won't be supported
# forever, see https://github.com/sparklemotion/nokogiri/discussions/2746 for context.
#
cppflags = ["-I#{header_directory.shellescape}"]
ldflags = []

Expand All @@ -108,7 +111,8 @@ def to_hash
end

if windows?
# on windows, nokogumbo needs to link against nokogiri.so to resolve symbols. see #2167
# on windows, third party libraries that wish to link against nokogiri
# should link against nokogiri.so to resolve symbols. see #2167
lib_directory = File.expand_path(File.join(File.dirname(__FILE__), "../#{ruby_minor}"))
unless File.exist?(lib_directory)
lib_directory = File.expand_path(File.join(File.dirname(__FILE__), ".."))
Expand Down Expand Up @@ -136,9 +140,6 @@ def to_hash
libxml["source"] = "packaged"
libxml["precompiled"] = libxml2_precompiled?
libxml["patches"] = Nokogiri::LIBXML2_PATCHES

# this is for nokogumbo and shouldn't be forever
libxml["libxml2_path"] = header_directory
else
libxml["source"] = "system"
end
Expand Down
5 changes: 0 additions & 5 deletions scripts/test-gem-install
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,3 @@ rm -rf lib ext # ensure we don't use the local files
rake test

./scripts/test-gem-installation

# delete the Gemfile because that's confusing to older versions of rubygems (e.g., bionic32)
rm -f Gemfile Gemfile.lock
./scripts/test-nokogumbo-compatibility 2.0.4
./scripts/test-nokogumbo-compatibility 2.0.5
11 changes: 1 addition & 10 deletions scripts/test-gem-installation
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,7 @@ describe gemspec.full_name do

describe "library" do
describe "packaged" do
describe "for nokogumbo" do
# this is for nokogumbo and shouldn't be forever
it "declares where headers are installed" do
assert_equal(
nokogiri_ext_dir,
Nokogiri::VERSION_INFO["libxml"]["libxml2_path"],
"expected Nokogiri::VERSION_INFO to point to #{nokogiri_ext_dir}",
)
end

describe "for third-party library linking" do
it "installs packaged libraries' headers" do
packaged_library_header_files.each do |header|
assert(
Expand Down
78 changes: 0 additions & 78 deletions scripts/test-nokogumbo-compatibility

This file was deleted.

0 comments on commit 9d92bd3

Please sign in to comment.