TL;DR: I had a chat with Aaron last night, and we came to the conclusion that we'd like to try *not* vendoring libxml2 in the next minor release of Nokogiri.
Historically, we began vendoring libxml2 (and libxslt) when two things happened simultaneously:
- libxml 2.9.0 contained a bug[1] that broke much of Nokogiri's CSS parsing
- homebrew started installing libxml 2.9.0 by default
which led to all kinds of crazy.
As a response, we started shipping Nokogiri with a version of libxml2 that was known to work.
Since then, we've had mixed results. On the one hand, we've greatly improved the install experience for many people, we've been able to deliver modern libxml2 to many people on older or ill-maintained systems, and we've been able to focus on keeping Nokogiri support to a single version of libxml2 (rather than maintaining complex kludges to work around bugs in specific versions of the library).
On the other hand, we're redistributing something that should really be on people's systems, and thus taking on the responsibility of keeping Nokogiri's libxml2 up-to-date with patches.
I'd like to propose that we reverse the default value for NOKOGIRI_USE_SYSTEM_LIBRARIES, so that by default we'd use it, and only if it was set to a falsey value (i.e., "0", "f", "F", "false", "FALSE", etc.) would we try to compile and use the vendored version of Nokogiri.
I'd love to hear everyone's thoughts, as I think this is simpler and perhaps also just better than the proposal[2] I made last year for Nokogiri to auto-detect whether its vendored version is better than the installed system version.
If there are no major objections, I'll widen this conversation up to the Internet At Large and make it a Github Issue RFC.
Cheers,
-m