[bug] v1.11.0 native Windows gem causes nokogumbo installation to fail #2167
Please describe the bug
Nokogumbo cannot build against the Nokogiri v1.11.0 native Windows gem.
It is able to build against
Help us reproduce what you're seeing
See the Nokogumbo test suite's failing windows jobs when built against v1.11.0:
And the same suite's passing status when built against v1.10.10.
Nokogumbo should be able to build identically against v1.11.0 as it does against v1.10.10.
Note that Linux and Darwin native gems aren't a problem.
The text was updated successfully, but these errors were encountered:
@larskanis I think I need help with this. I can easily reproduce on a Windows dev environment running:
Output matches what's seen at https://github.com/rubys/nokogumbo/pull/163/checks?check_run_id=1990881540
I've tried adding (in nokogumbo's extconf.rb) ldflags of:
Anything else you can think of to try?
OK, I think I've got this figured out. It's a combination of:
The first can be solved by passing
The second needs some more work to figure out, but for now the combination of
to allow downstream gems like nokogumbo to build correctly simply by requiring nokogiri in the extconf and running: append_cflags(Nokogiri::VERSION_INFO["nokogiri"]["cppflags"]) append_ldflags(Nokogiri::VERSION_INFO["nokogiri"]["ldflags"]) this is needed because unresolved symbols aren't allowed on windows. Related to #2167
…g-on-windows fix nokogumbo linking on windows --- **What problem is this PR intended to solve?** Closes #2167 which relates to an issue building Nokogumbo on Windows against the precompiled libraries. This PR does the following: - ensures that libxml2 symbols are exported when built on windows - ensures that nokogiri symbols are exported when built on windows - includes `LDFLAGS` in `Nokogiri::VERSION_INFO` to allow the windows linker to resolve all symbols **Have you included adequate test coverage?** There's pretty good test coverage of this test case in the Nokogumbo CI suite; and I've added some light tests here in `scripts/test-gem-installation` though I'll note that we're not testing gem installation on Windows in the Nokogiri CI suite at the moment (though, see #2153). **Does this change affect the behavior of either the C or the Java implementations?** This should only impact downstream gems like Nokogumbo who are trying to link against the precompiled Nokogiri libraries.