Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nokogiri complains about libxml version #172

Open
ccoupe opened this issue Dec 29, 2015 · 12 comments
Open

Nokogiri complains about libxml version #172

ccoupe opened this issue Dec 29, 2015 · 12 comments
Labels

Comments

@ccoupe
Copy link

ccoupe commented Dec 29, 2015

Shoes scripts that use the nokogiri gem will probably get a warning message in the Shoes console. I'm going to explain why this is unlikely to be fixed any time soon. Let start with the Simple case - a Loose shoes build (there aren't many of them). That build will use the whatever nokogiri was installed in the system ruby - And you'll get nokogiri complaint To fix it I'd have to upgrade my OS to a version that had libxml2-2.9.2 and that is 100% not good behaviour.

You might read http://www.nokogiri.org/tutorials/installing_nokogiri.html#using_nonstandard_libxml2___libxslt_installations and think they have accommodated this problem. Sort of, maybe not. It will link to system libraries (it often does by default if you have decent enough libxlml on linux or osx) but it complains when 'require nokogiri' is done in a Shoes script. That's the choice of the nokogiri developers - it's seriously funky inside.

They say the have their own libxml and xslt code in the gem - they do and they occasionally build it on gem install (takes forever) and they statically link it into their nokogiri.so (shared library) but that bloats Shoes downloads something awful. That is dead weight because Shoes users can't share their xml lib (static linked)

Shoes has other libs that require libxml2 (fontconfig, svg) be shipped with Shoes (Windows for one) While it is possible to update all Shoes distributions to use what nokogiri thinks is correct That could end up with you having to Upgrade your OS (and all the apps you use). That is unacceptable.

You can use Hrpicot for xml parsing if the nokogiri warnings annoy you. Or use Shoes 4,

@ccoupe ccoupe added the Low label Dec 29, 2015
@ccoupe ccoupe changed the title Nokogiri compains about libxml version Nokogiri complains about libxml version Dec 29, 2015
@IanTrudel
Copy link
Collaborator

Would it be possible to build Nokogiri with Shoes libxml? How about building it and disabling this particular warning? It may be an option available.

@ccoupe
Copy link
Author

ccoupe commented Dec 29, 2015

Twisty passages. Shoes xml is what the system has installed (linux, osx) or provided (windows). It's not problem on Windows unless you build your own and the prebuilt deps don't match. On osx it might not be a huge problem since we build shoes against precompiled deps. I'm unwilling to manually build 3 new sets of deps for Linux(64,32,arm32) and modify the rakefiles to link against those. Even that wouldn't fix Loose Shoes/nokogiri. Man weeks of work to fix a warning message and not getting the latest security fixes for those libs without doing the deps build again, and again.

Assuming it's a C warning, we can't fix it (comment it out) after nokogiri is built. It could be ruby code however which would be more amenable to monkey patching/meta-fu. I already know the tutorial doesn't really describe what's going on with the latest nokogiri code. If someone had the time and inclination they could dig into nokogiri'a code. Not me.

@IanTrudel
Copy link
Collaborator

Could you copy the warnings here for the record?

@ccoupe
Copy link
Author

ccoupe commented Dec 31, 2015

They look like 👎

Warn in <unknown> line 0 | 2015-12-30 21:09:25 -0700
WARNING: Nokogiri was built against LibXML version 2.9.2, but has dynamically loaded 2.9.1

although the dynamically load version number will vary.

@IanTrudel
Copy link
Collaborator

It's apparently not the first time happening to Nokogiri users. sparklemotion/nokogiri#829

@IanTrudel
Copy link
Collaborator

Is this still an issue?

@ccoupe
Copy link
Author

ccoupe commented Feb 17, 2017

It still occurs - OSX I think and some Linux.

@ccoupe
Copy link
Author

ccoupe commented Feb 17, 2017

we're not using homebrew on osx so those solutions don't work. I've seen them before and there are flags you can set with you build nokogiri that should fix but it but they don't.

@IanTrudel
Copy link
Collaborator

Actually, there are solutions for gem and bundle:

If you installed Nokogiri with gem install nokogiri, you can resolve this warning by running gem pristine nokogiri to recompile the gem's C extension.

If you installed Nokogiri with bundle install, you can resolve this warning by running bundle exec gem pristine nokogiri to recompile the C extension of the gem wherever Bundler installed it.

@ccoupe
Copy link
Author

ccoupe commented Feb 17, 2017

I've tried that before and many other suggestions. Nokogiri on OSX compiles against the libxml and then complain about it at runtime. -pristine has no effect other then compile again.

@IanTrudel
Copy link
Collaborator

Would it be possible that it's finding another LibXML2 library on your system than the one you intended to include? Sounds like something déjà vu...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants