Closed dsisnero closed 3 years ago
any information on how to fix this? Thanks
Any fix for this or suggestions? Thanks
I'm sorry I don't know much about building on Windows. I notice that your log shows Ruby26-x64 and Ruby27-x64. That's surprising to me. I'd expect the files to be linked by the same toolchain that compiled them.
gem_make.out
https://gist.github.com/dsisnero/26943d1b5ad0dbd489128b09b2a39e0c
Ok- this is from C:\Users\Dominic E Sisneros>ruby --version ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x64-mingw32]
C:\Users\Dominic E Sisneros>gem environment RubyGems Environment:
Still have an error on 10/07/2020
gem_make.out https://gist.github.com/dsisnero/04b8421fd3056163a9d8e3730c0c6628
It looks like it's failing to create the shared object (dll on Windows) because it can't find symbols from Nokogiri. I'm not sure why that would be the case.
I don't know. Here's the latest test 11/30/2020 https://gist.github.com/dsisnero/e6873452ad4db221ebf98ab8d9327e3e
This is a little odd. The CI build does not find the nokogiri.h
header.
checking for libxml/tree.h in ports/x86_64-w64-mingw32/libxml2/2.9.10/include/libxml2... yes
checking for nokogiri.h in D:/a/nokogumbo/nokogumbo/vendor/bundle/ruby/2.7.0/gems/nokogiri-1.10.10-x64-mingw32/ext/nokogiri... no
so presumably, it's using the slow path where building the tree goes through Ruby.
In your log, it is finding nokogiri.h
checking for libxml/tree.h in ports/x86_64-w64-mingw32/libxml2/2.9.10/include/libxml2... yes
checking for nokogiri.h in F:/windows/scoop/persist/ruby/gems/gems/nokogiri-1.10.10-x64-mingw32/ext/nokogiri... yes
In both cases, the libxml2 headers are found.
What happens if you try gem install nokogumbo -- --without-libxml2
?
@flavorjones Any idea why nokogiri.h
isn't being found by the CI build?
Hmm. I wonder if Windows can even work the same way macOS and Linux do here without exporting the Nokogiri and libxml2 symbols by adding __declspec(dllexport)
to them or making a .def
file (which extconf.rb
does to export the initialization function).
If it turns out this is the issue, I can change extconf.rb
to not try to link against nokogiri.so
on Windows which should solve this problem (but leave Windows with the slow path).
Sorry, I don't know enough to help. Here's what I found https://www.transmissionzero.co.uk/computing/building-dlls-with-mingw/ and https://www.transmissionzero.co.uk/computing/advanced-mingw-dll-topics/
On Mon, Nov 30, 2020 at 9:57 AM Stephen Checkoway notifications@github.com wrote:
Hmm. I wonder if Windows can even work the same way macOS and Linux do here without exporting the Nokogiri and libxml2 symbols https://docs.microsoft.com/en-us/cpp/build/exporting-from-a-dll?view=msvc-160 by adding __declspec(dllexport) to them or making a .def file (which extconf.rb does to export the initialization function).
If it turns out this is the issue, I can change extconf.rb to not try to link against nokogiri.so on Windows which should solve this problem (but leave Windows with the slow path).
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rubys/nokogumbo/issues/146#issuecomment-735910485, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAABQRJBYFVTOVNCNNCHOWTSSPFGVANCNFSM4NGHF3TA .
@flavorjones Any idea why nokogiri.h isn't being found by the CI build?
Sorry, I was hoping to find time over the weekend to look at this, and I fell woefully short of that expectation. I can't think of any good reasons why we shouldn't be able to make this work on Windows, I just need to understand what's going on. I may be able to spend time on it later this week.
I've got a Windows dev environment up and running now, will take a look tonight.
So #163 should resolve this issue; but it has its own issues (see the conversation there and at https://github.com/sparklemotion/nokogiri/issues/2167). Still working on it.
This should be fixed in v2.0.5 which just shipped. Closing, but please feel free to comment if you're still seeing this issue with the latest version.
thank you!
On Fri, Mar 19, 2021 at 6:06 AM Mike Dalessio @.***> wrote:
Closed #146 https://github.com/rubys/nokogumbo/issues/146.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rubys/nokogumbo/issues/146#event-4481831560, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAABQRJN54GYUMJPJV3M3KLTEM44HANCNFSM4NGHF3TA .
C:\Users\Dominic E Sisneros\source\repos\git\dsisnero\numo-narray>gem install nokogumbo --platform=ruby Temporarily enhancing PATH for MSYS/MINGW... Building native extensions. This could take a while... ERROR: Error installing nokogumbo: ERROR: Failed to build gem native extension.
c:/Ruby27-x64/bin/ruby.exe -I c:/Ruby27-x64/lib/ruby/2.7.0 -r ./siteconf20200520-17996-2d18h9.rb extconf.rb checking for xmlNewDoc() in -lxml2... yes checking for nokogiri.h in c:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/nokogiri-1.10.9/ext/nokogiri... yes creating Makefile
current directory: c:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/nokogumbo-2.0.2/ext/nokogumbo make "DESTDIR=" clean
~~~~~~~~~~~ nokogumbo.c:505:50: warning: passing argument 3 of 'rb_ensure' from incompatible pointer type [-Wincompatible-pointer-types] 505~~~~~~~~~~ nokogumbo.c: In function 'fragment': nokogumbo.c:695:13: warning: passing argument 1 of 'rb_ensure' from incompatible pointer type [-Wincompatible-pointer-types] 695~~~~~~~~~~ nokogumbo.c:695:46: warning: passing argument 3 of 'rb_ensure' from incompatible pointer type [-Wincompatible-pointer-types] 695~~~~In file included from C:/Ruby27-x64/include/ruby-2.7.0/ruby.h:33, from nokogumbo.c:22: C:/Ruby27-x64/include/ruby-2.7.0/ruby/ruby.h:1990:39: note: expected 'VALUE ()(VALUE)' {aka 'long long unsigned int ()(long long unsigned int)'} but argument is of type 'VALUE ()(ParseArgs )' {aka 'long long unsigned int ()(ParseArgs )'} 1990 | VALUE rb_ensure(VALUE()(VALUE),VALUE,VALUE()(VALUE),VALUE); | ^
~~~~~~ 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 C:/Ruby26-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: nokogumbo.o:nokogumbo.c:(.text+0x1366): undefined reference toNokogiri_wrap_xml_document' C:/Ruby26-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: nokogumbo.o:nokogumbo.c:(.rdata$.refptr.mNokogiri[.refptr.mNokogiri]+0x0): undefined reference to
mNokogiri' C:/Ruby26-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: nokogumbo.o:nokogumbo.c:(.rdata$.refptr.cNokogiriXmlSyntaxError[.refptr.cNokogiriXmlSyntaxError]+0x0): undefined reference to `cNokogiriXmlSyntaxError' collect2.exe: error: ld returned 1 exit status make: *** [Makefile:261: nokogumbo.so] Error 1make failed, exit code 2
Gem files will remain installed in c:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/nokogumbo-2.0.2 for inspection. Results logged to c:/Ruby27-x64/lib/ruby/gems/2.7.0/extensions/x64-mingw32/2.7.0/nokogumbo-2.0.2/gem_make.out