Skip to content
This repository has been archived by the owner on Aug 26, 2023. It is now read-only.

Error installing on windows 10 with ruby installer #146

Closed
dsisnero opened this issue May 20, 2020 · 15 comments
Closed

Error installing on windows 10 with ruby installer #146

dsisnero opened this issue May 20, 2020 · 15 comments

Comments

@dsisnero
Copy link

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.

current directory: c:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/nokogumbo-2.0.2/ext/nokogumbo

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

current directory: c:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/nokogumbo-2.0.2/ext/nokogumbo
make "DESTDIR="
generating nokogumbo-x64-mingw32.def
compiling nokogumbo.c
In file included from nokogumbo.c:53:
c:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/nokogiri-1.10.9/ext/nokogiri/nokogiri.h:13: warning: "_GNU_SOURCE" redefined
13 | #define _GNU_SOURCE
|
In file included from C:/Ruby27-x64/include/ruby-2.7.0/ruby/ruby.h:24,
from C:/Ruby27-x64/include/ruby-2.7.0/ruby.h:33,
from nokogumbo.c:22:
c:/Ruby27-x64/include/ruby-2.7.0/x64-mingw32/ruby/config.h:17: note: this is the location of the previous definition
17 | #define _GNU_SOURCE 1
|
nokogumbo.c: In function 'parse':
nokogumbo.c:505:20: warning: passing argument 1 of 'rb_ensure' from incompatible pointer type [-Wincompatible-pointer-types]
505 | return rb_ensure(parse_continue, (VALUE)&args, parse_cleanup, (VALUE)&args);
| ^~~~~~~~~~~~~~
| |
| VALUE ()(ParseArgs ) {aka long long unsigned int ()(ParseArgs )}
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:17: 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);
| ^~~~~~~~~~~~~~~
nokogumbo.c:505:50: warning: passing argument 3 of 'rb_ensure' from incompatible pointer type [-Wincompatible-pointer-types]
505 | return rb_ensure(parse_continue, (VALUE)&args, parse_cleanup, (VALUE)&args);
| ^~~~~~~~~~~~~
| |
| VALUE ()(ParseArgs ) {aka long long unsigned int ()(ParseArgs )}
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);
| ^~~~~~~~~~~~~~~
nokogumbo.c: In function 'fragment':
nokogumbo.c:695:13: warning: passing argument 1 of 'rb_ensure' from incompatible pointer type [-Wincompatible-pointer-types]
695 | rb_ensure(fragment_continue, (VALUE)&args, parse_cleanup, (VALUE)&args);
| ^~~~~~~~~~~~~~~~~
| |
| VALUE ()(ParseArgs ) {aka long long unsigned int ()(ParseArgs )}
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:17: 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);
| ^~~~~~~~~~~~~~~
nokogumbo.c:695:46: warning: passing argument 3 of 'rb_ensure' from incompatible pointer type [-Wincompatible-pointer-types]
695 | rb_ensure(fragment_continue, (VALUE)&args, parse_cleanup, (VALUE)&args);
| ^~~~~~~~~~~~~
| |
| VALUE ()(ParseArgs ) {aka long long unsigned int ()(ParseArgs )}
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 to Nokogiri_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 1

make 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

@dsisnero
Copy link
Author

any information on how to fix this? Thanks

@dsisnero
Copy link
Author

Any fix for this or suggestions? Thanks

@stevecheckoway
Copy link
Collaborator

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.

@dsisnero
Copy link
Author

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:

  • RUBYGEMS VERSION: 3.1.4
  • RUBY VERSION: 2.7.1 (2020-03-31 patchlevel 83) [x64-mingw32]
  • INSTALLATION DIRECTORY: F:/windows/scoop/persist/ruby/gems
  • USER INSTALLATION DIRECTORY: c:/Users/Dominic E Sisneros/.gem/ruby/2.7.0
  • RUBY EXECUTABLE: F:/windows/scoop/apps/ruby/2.7.1-1/bin/ruby.exe
  • GIT EXECUTABLE: C:\Users\Dominic E Sisneros\AppData\Local\Programs\Git\cmd/git.EXE
  • EXECUTABLE DIRECTORY: F:/windows/scoop/persist/ruby/gems/bin
  • SPEC CACHE DIRECTORY: c:/Users/Dominic E Sisneros/.gem/specs
  • SYSTEM CONFIGURATION DIRECTORY: C:/ProgramData
  • RUBYGEMS PLATFORMS:
    • ruby
    • x64-mingw32
  • GEM PATHS:
    • F:/windows/scoop/persist/ruby/gems
  • GEM CONFIGURATION:
    • :update_sources => true
    • :verbose => true
    • :backtrace => false
    • :bulk_threshold => 1000
    • :sources => ["https://rubygems.org/"]
    • :concurrent_downloads => 8
    • "gem" => "--document=yri"
  • REMOTE SOURCES:
  • SHELL PATH:
    • C:\Python27\
    • C:\Python27\Scripts
    • C:\app\client\dsisnero\product\12.2.0\client_1\bin
    • C:\oracle\product\12.2.0\client_1\bin
    • C:\Ruby26-x64\bin
    • C:\Program Files (x86)\Common Files\Oracle\Java\javapath
    • C:\windows\system32
    • C:\windows
    • C:\windows\System32\Wbem
    • C:\windows\System32\WindowsPowerShell\v1.0\
    • C:\Program Files (x86)\HID Global\ActivClient\
    • C:\Program Files\HID Global\ActivClient\
    • C:\Program Files\Tumbleweed\Desktop Validator\
    • C:\Program Files\Tumbleweed\Desktop Validator\x86
    • C:\Program Files\dotnet\
    • C:\Program Files\Microsoft SQL Server\130\Tools\Binn\
    • C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\
    • e:\windows\chocoportable\bin
    • C:\Program Files (x86)\ivi foundation\visa\WinNT\Bin\
    • C:\Program Files\IVI Foundation\VISA\Win64\Bin\
    • C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin
    • C:\Users\Dominic E Sisneros\AppData\Local\Programs\Git\cmd
    • F:\windows\scoop\apps\yarn\current\Yarn\bin
    • F:\windows\scoop\apps\yarn\current\global\node_modules.bin
    • F:\windows\scoop\apps\nu\current\Plugins
    • C:\Users\Dominic E Sisneros\go\bin
    • F:\windows\scoop\apps\nodejs\current\bin
    • F:\windows\scoop\apps\nodejs\current
    • F:\windows\scoop\apps\python\current
    • F:\windows\scoop\apps\python\current\Scripts
    • F:\windows\scoop\apps\ruby\current\gems\bin
    • F:\windows\scoop\apps\ruby\current\bin
    • F:\windows\scoop\shims
    • C:\Users\Dominic E Sisneros\AppData\Local\Microsoft\WindowsApps
    • C:\Users\Dominic E Sisneros\AppData\Local\Programs\Microsoft VS Code\bin
    • C:\Users\Dominic E Sisneros\AppData\Local\GitHubDesktop\bin
    • C:\Users\Dominic E Sisneros\AppData\Local\Programs\Git\cmd
    • F:\windows\tools\bolt\bin
    • F:\windows\tools\puppet_labs\pdk\bin
    • F:\windows\tools\bin
    • F:\windows\tools\GnuWin32\bin
    • F:\windows\tools\rust.cargo\bin
    • F:\windows\tools\java\jdk-11.0.2\bin
    • F:\windows\tools\bin
    • F:\windows\tools\GnuWin32\bin
    • F:\windows\tools\rust.cargo\bin
    • F:\windows\tools\java\jdk-11.0.2\bin
    • F:\windows\tools\dgraph
    • C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64
    • C:\Users\Dominic E Sisneros.virtualenvs\bin
    • C:\Users\Dominic E Sisneros\bin
    • C:\Program Files\MySQL\MySQL Server 8.0\bin
    • F:\windows\scoop\apps\msys2\current\mingw64\bin

@dsisnero
Copy link
Author

dsisnero commented Oct 7, 2020

Still have an error on 10/07/2020

gem_make.out https://gist.github.com/dsisnero/04b8421fd3056163a9d8e3730c0c6628

@stevecheckoway
Copy link
Collaborator

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.

@dsisnero
Copy link
Author

I don't know. Here's the latest test 11/30/2020
https://gist.github.com/dsisnero/e6873452ad4db221ebf98ab8d9327e3e

@stevecheckoway
Copy link
Collaborator

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?

@stevecheckoway
Copy link
Collaborator

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).

@dsisnero
Copy link
Author

dsisnero commented Nov 30, 2020 via email

@flavorjones
Copy link
Collaborator

@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.

@flavorjones
Copy link
Collaborator

I've got a Windows dev environment up and running now, will take a look tonight.

@flavorjones
Copy link
Collaborator

So #163 should resolve this issue; but it has its own issues (see the conversation there and at sparklemotion/nokogiri#2167). Still working on it.

@flavorjones
Copy link
Collaborator

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.

@dsisnero
Copy link
Author

dsisnero commented Mar 23, 2021 via email

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

No branches or pull requests

3 participants