Closed Lee1984 closed 5 years ago
I haven't tried cygwin. My first thought would be to try a newer version of nokogumbo.
At some point in time, we switched from using gumbo as an external library to including a cleaned up and fixed version. The checking for gumbo_parse() in -lgumbo... no
message is saying that it can't find the gumbo library. I don't recall precisely how that used to work but it's completely different now.
Note that the current version does at least build and pass the test suites on Windows.
Yes I did try the newest version of nokogumbo and even older version and upgraded nokogiri to 1.10.4 and tried that but still same error.
Do you know of any libraries nokogumbo depends on for that version I can install that may help the build, it's not giving that exact error but maybe it needs that to build? I installed libxml2, libxslt, libiconv and I just downloaded zlib which I saw was used to build nokogiri in your builds you posted. Maybe I will reinstall nokogiri using those libraries and also for the nokogumbo install.
The error actually changes when I use system libraries, it seems to find the library but then fails somewhere
current directory: /home/Lee/.rvm/gems/ruby-2.6.3/gems/nokogumbo-2.0.1/ext/nokogumbo
/home/Lee/.rvm/rubies/ruby-2.6.3/bin/ruby.exe -I /home/Lee/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0 -r ./siteconf20190829-38962-qsz4cz.rb extconf.rb --use-system-libraries --with-xml2-include\=C:/cygwin64/usr/include/libxml2 --with-xslt-include\=C:/cygwin64/usr/include/libxslt
checking for xmlNewDoc() in -lxml2... yes
checking for nokogiri.h in /home/Lee/.rvm/gems/ruby-2.6.3/gems/nokogiri-1.10.4/ext/nokogiri... yes
creating Makefile
current directory: /home/Lee/.rvm/gems/ruby-2.6.3/gems/nokogumbo-2.0.1/ext/nokogumbo
make "DESTDIR=" clean
current directory: /home/Lee/.rvm/gems/ruby-2.6.3/gems/nokogumbo-2.0.1/ext/nokogumbo
make "DESTDIR="
compiling nokogumbo.c
In file included from nokogumbo.c:52:0:
/home/Lee/.rvm/gems/ruby-2.6.3/gems/nokogiri-1.10.4/ext/nokogiri/nokogiri.h:13:0: warning: "_GNU_SOURCE" redefined
#define _GNU_SOURCE
In file included from /home/Lee/.rvm/rubies/ruby-2.6.3/include/ruby-2.6.0/ruby/ruby.h:24:0,
from /home/Lee/.rvm/rubies/ruby-2.6.3/include/ruby-2.6.0/ruby.h:33,
from nokogumbo.c:22:
/home/Lee/.rvm/rubies/ruby-2.6.3/include/ruby-2.6.0/x86_64-cygwin/ruby/config.h:16:0: note: this is the location of the previous definition
#define _GNU_SOURCE 1
compiling ./../../gumbo-parser/src/ascii.c
compiling ./../../gumbo-parser/src/attribute.c
compiling ./../../gumbo-parser/src/char_ref.c
compiling ./../../gumbo-parser/src/error.c
compiling ./../../gumbo-parser/src/foreign_attrs.c
compiling ./../../gumbo-parser/src/parser.c
compiling ./../../gumbo-parser/src/string_buffer.c
compiling ./../../gumbo-parser/src/string_piece.c
compiling ./../../gumbo-parser/src/svg_attrs.c
compiling ./../../gumbo-parser/src/svg_tags.c
compiling ./../../gumbo-parser/src/tag.c
compiling ./../../gumbo-parser/src/tag_lookup.c
compiling ./../../gumbo-parser/src/tokenizer.c
compiling ./../../gumbo-parser/src/token_buffer.c
compiling ./../../gumbo-parser/src/utf8.c
compiling ./../../gumbo-parser/src/util.c
compiling ./../../gumbo-parser/src/vector.c
linking shared-object nokogumbo/nokogumbo.so
nokogumbo.o: In function `parse_continue':
/home/Lee/.rvm/gems/ruby-2.6.3/gems/nokogumbo-2.0.1/ext/nokogumbo/nokogumbo.c:522: undefined reference to `Nokogiri_wrap_xml_document'
/home/Lee/.rvm/gems/ruby-2.6.3/gems/nokogumbo-2.0.1/ext/nokogumbo/nokogumbo.c:522:(.text+0x10b2): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `Nokogiri_wrap_xml_document'
nokogumbo.o:nokogumbo.c:(.rdata$.refptr.mNokogiri[.refptr.mNokogiri]+0x0): undefined reference to `mNokogiri'
nokogumbo.o:nokogumbo.c:(.rdata$.refptr.cNokogiriXmlSyntaxError[.refptr.cNokogiriXmlSyntaxError]+0x0): undefined reference to `cNokogiriXmlSyntaxError'
collect2: error: ld returned 1 exit status
make: *** [Makefile:261: nokogumbo.so] Error 1
make failed, exit code 2
I may be at a stalemate.
You can't be getting the same error about not finding gumbo_parse
if you're using the latest version as that isn't something that the build system checks for any more (because we include the gumbo source code directly).
I admit, I don't know why it's complaining about the undefined symbols. It's true they're not defined in nokogumbo.so
, but that's because they're expected to be found in nokogiri.so
. It's possible that the cygwin linker needs to know that they're defined externally. Unfortunately, I don't know much about linking on Windows.
Oh no, sorry the error is the same as above for nokogumbo 2.0.1, the same as when I use the system libraries for version 1.4.13 where I was getting the original error, eg
current directory: /home/Lee/.rvm/gems/ruby-2.6.3/gems/nokogumbo-2.0.1/ext/nokogumbo
/home/Lee/.rvm/rubies/ruby-2.6.3/bin/ruby.exe -I /home/Lee/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0 -r ./siteconf20190829-39142-1dvnvd9.rb extconf.rb
checking for xmlNewDoc() in -lxml2... yes
checking for nokogiri.h in /home/Lee/.rvm/gems/ruby-2.6.3/gems/nokogiri-1.10.4/ext/nokogiri... yes
creating Makefile
current directory: /home/Lee/.rvm/gems/ruby-2.6.3/gems/nokogumbo-2.0.1/ext/nokogumbo
make "DESTDIR=" clean
current directory: /home/Lee/.rvm/gems/ruby-2.6.3/gems/nokogumbo-2.0.1/ext/nokogumbo
make "DESTDIR="
compiling nokogumbo.c
...
Ah k, I understand you now. So by externally you mean outside of the nokogumbo gem installation? That should be taken care of shouldn't it by nokogumbo?
I mean that nokogumbo depends on nokogiri defining several function and data symbols, including Nokogiri_wrap_xml_document
, mNokogiri
, cNokogiriXmlSyntaxError
, and others. This works correctly on macOS, Linux, and Windows using mingw32
(which you can see here).
I don't know why that doesn't work with cygwin and I don't have an easy way to test.
That's what I mean but when it tries to find the nokogiri.so file it can't but I thought the installation of the gem would know this considering as you said they arn't defined there.
I must admit I don't know what's in control at this point in the installation I don't see why the gem would look in nokogumbo.so when it's not meant to.
Try gem install nokogumbo -- --without-libxml2
.
Yes it worked fine for version 2.0.1 but the same error for 1.4.13 checking for gumbo_parse() in -lgumbo... no
I don't think there's any reason to use 1.4.13 any longer. Is there something that it supports that v2 does not?
[Certainly gem install nokogumbo
(without --without-libxml2
) should just work and it's a bug that it doesn't on cygwin. But since (almost) the only difference is decreased performance, investigating the bug is not a high priority. Especially since gem install nokogumbo
works on Windows with mingw32.]
Yes Steve I realized that the version of ruby I upgraded to does not accept nokogiri 1.6.8.1. I forget how bundle install
missed this I really forget but I am pretty sure it installed nokogiri 1.6.8.1 with ruby version 2.5.5 set in gemfile. Now I look back I should have remembered why this was.
But I saw this and realized with the upgraded nokogiri I needed to upgrade rails as well. So I haven't looked into it yet, but, yeah I need to use nokogiri >= 1.8 for rails 5.2.0 and currently with this setup I using nokogiri 1.10.4
So likely I can use a newer version of nokogumbo but on my windows system (without cygwin) everything is installed correctly now.
Setup
Using cygwin on windows 10 with rvm.
Had trouble with nokogiri installing so had to Install libxml2 and libxslt libraries and headers and I think pkg-config then do
gem install nokogiri -- --use-system-libraries --with-xml2-include=C:/cygwin64/usr/include/libxml2 --with-xslt-include=C:/cygwin64/usr/include/libxslt
This installed great.
Problem
Run
gem install nokogumbo -v '1.4.13'
and get this error in C:\cygwin64\home\Lee.rvm\gems\ruby-2.5.5\extensions\x86_64-cygwin\2.5.0\nokogumbo-1.4.13\gem_make.outmkmf.txt output is
I think this may be similar to issue https://github.com/rubys/nokogumbo/issues/71 and this pull request here https://github.com/rubys/nokogumbo/pull/86 as this is a earlier version of nokogumbo but this is a little out of my comfort zone seeing as I just wanted to use rvm with different ruby versions..
Trying
gem install nokogumbo -v '1.4.13' --use-system-libraries --with-xml2-include=C:/cygwin64/usr/include/libxml2 --with-xslt-include=C:/cygwin64/usr/include/libxslt
did not fix my issue, although teh error was slightly different.EDIT Upgraded to nokogiri 1.10.4 with same result and it doesn't matter which version of nokogumbo I try it is always the same
checking for gumbo_parse() in -lgumbo... no
error.