rubys / nokogumbo

A Nokogiri interface to the Gumbo HTML5 parser.
Apache License 2.0
186 stars 114 forks source link

nokogumbo not installing #123

Closed Lee1984 closed 5 years ago

Lee1984 commented 5 years ago

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

current directory: /home/Lee/.rvm/gems/ruby-2.5.5/gems/nokogumbo-1.4.13/ext/nokogumboc
/home/Lee/.rvm/rubies/ruby-2.5.5/bin/ruby.exe -I /home/Lee/.rvm/rubies/ruby-2.5.5/lib/ruby/site_ruby/2.5.0 -r ./siteconf20190828-35793-1yqbuou.rb extconf.rb
checking for xmlNewDoc() in -lxml2... yes
checking for nokogiri.h in /home/Lee/.rvm/gems/ruby-2.5.5/gems/nokogiri-1.6.8.1/ext/nokogiri... yes
checking for nokogiri.h in /home/Lee/.rvm/gems/ruby-2.5.5/gems/nokogiri-1.6.8.1/ext/nokogiri... yes
checking for gumbo_parse() in -lgumbo... no
checking for GumboErrorType with error.h... not found
checking for GumboInsertionMode with insertion_mode.h... not found
checking for GumboParser with parser.h... not found
checking for GumboStringBuffer with string_buffer.h... not found
checking for GumboTokenType with token_type.h... not found
creating Makefile

current directory: /home/Lee/.rvm/gems/ruby-2.5.5/gems/nokogumbo-1.4.13/ext/nokogumboc
make "DESTDIR=" clean

current directory: /home/Lee/.rvm/gems/ruby-2.5.5/gems/nokogumbo-1.4.13/ext/nokogumboc
make "DESTDIR="
compiling attribute.c
compiling char_ref.c
char_ref.rl: In function ‘consume_numeric_ref’:
char_ref.rl:128:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   if (!error) {
   ^~~
char_ref.rl:137:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   for (int i = 0; kCharReplacements[i].from_char != -1; ++i) {
   ^~~
.....
.....
..... errors continue.......

mkmf.txt output is

have_library: checking for xmlNewDoc() in -lxml2... -------------------- yes

"gcc -o conftest.exe -I/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/x86_64-cygwin -I/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/ruby/backward -I/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0 -I. -D_XOPEN_SOURCE -D_GNU_SOURCE   -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wmisleading-indentation -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wimplicit-fallthrough=0 -Wduplicated-cond -Wrestrict -std=c99 conftest.c  -L. -L/home/Lee/.rvm/rubies/ruby-2.5.5/lib -L. -fstack-protector     -lruby250  -lpthread -ldl -lcrypt  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

"gcc -o conftest.exe -I/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/x86_64-cygwin -I/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/ruby/backward -I/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0 -I. -D_XOPEN_SOURCE -D_GNU_SOURCE   -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wmisleading-indentation -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wimplicit-fallthrough=0 -Wduplicated-cond -Wrestrict -std=c99 conftest.c  -L. -L/home/Lee/.rvm/rubies/ruby-2.5.5/lib -L. -fstack-protector     -lruby250 -lxml2  -lpthread -ldl -lcrypt  "
conftest.c: In function ‘t’:
conftest.c:13:57: error: ‘xmlNewDoc’ undeclared (first use in this function)
 int t(void) { void ((*volatile p)()); p = (void ((*)()))xmlNewDoc; return !p; }
                                                     ^~~~~~~~~
conftest.c:13:57: note: each undeclared identifier is reported only once for each function it appears in
conftest.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: /*top*/
 4: extern int t(void);
 5: int main(int argc, char **argv)
 6: {
 7:   if (argc > 1000000) {
 8:     printf("%p", &t);
 9:   }
10: 
11:   return 0;
12: }
13: int t(void) { void ((*volatile p)()); p = (void ((*)()))xmlNewDoc; return !p; }
/* end */

"gcc -o conftest.exe -I/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/x86_64-cygwin -I/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/ruby/backward -I/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0 -I. -D_XOPEN_SOURCE -D_GNU_SOURCE   -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wmisleading-indentation -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wimplicit-fallthrough=0 -Wduplicated-cond -Wrestrict -std=c99 conftest.c  -L. -L/home/Lee/.rvm/rubies/ruby-2.5.5/lib -L. -fstack-protector     -lruby250 -lxml2  -lpthread -ldl -lcrypt  "
checked program was:
 /* begin */
 1: #include "ruby.h"
 2: 
 3: /*top*/
 4: extern int t(void);
 5: int main(int argc, char **argv)
 6: {
 7:   if (argc > 1000000) {
 8:     printf("%p", &t);
 9:   }
10: 
11:   return 0;
12: }
13: extern void xmlNewDoc();
14: int t(void) { xmlNewDoc(); return 0; }
/* end */

--------------------

"pkg-config --exists libxml-2.0"
| pkg-config --libs libxml-2.0
=> "-lxml2 \n"
"gcc -o conftest.exe -I/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/x86_64-cygwin -I/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/ruby/backward -I/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0 -I. -D_XOPEN_SOURCE -D_GNU_SOURCE   -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wmisleading-indentation -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wimplicit-fallthrough=0 -Wduplicated-cond -Wrestrict -std=c99 conftest.c  -L. -L/home/Lee/.rvm/rubies/ruby-2.5.5/lib -L. -fstack-protector    -lxml2  -lruby250 -lxml2 -lpthread -ldl -lcrypt  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

| pkg-config --cflags-only-I libxml-2.0
=> "-I/usr/include/libxml2 \n"
| pkg-config --cflags-only-other libxml-2.0
=> "\n"
| pkg-config --libs-only-l libxml-2.0
=> "-lxml2 \n"
package configuration for libxml-2.0
cflags: 
ldflags: 
libs: -lxml2

find_header: checking for nokogiri.h in /home/Lee/.rvm/gems/ruby-2.5.5/gems/nokogiri-1.6.8.1/ext/nokogiri... -------------------- yes

"gcc -E -I/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/x86_64-cygwin -I/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/ruby/backward -I/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0 -I. -I/usr/include/libxml2 -D_XOPEN_SOURCE -D_GNU_SOURCE   -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wmisleading-indentation -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wimplicit-fallthrough=0 -Wduplicated-cond -Wrestrict -std=c99   conftest.c -o conftest.i"
conftest.c:3:10: fatal error: nokogiri.h: No such file or directory
 #include <nokogiri.h>
          ^~~~~~~~~~~~
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <nokogiri.h>
/* end */

"gcc -E -I/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/x86_64-cygwin -I/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/ruby/backward -I/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0 -I. -I/usr/include/libxml2 -D_XOPEN_SOURCE -D_GNU_SOURCE   -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wmisleading-indentation -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wimplicit-fallthrough=0 -Wduplicated-cond -Wrestrict -std=c99  -I/home/Lee/.rvm/gems/ruby-2.5.5/gems/nokogiri-1.6.8.1/ext/nokogiri conftest.c -o conftest.i"
In file included from conftest.c:3:0:
/home/Lee/.rvm/gems/ruby-2.5.5/gems/nokogiri-1.6.8.1/ext/nokogiri/nokogiri.h:13:0: warning: "_GNU_SOURCE" redefined
 #define _GNU_SOURCE

In file included from /home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/ruby/ruby.h:24:0,
                 from /home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/ruby.h:33,
                 from conftest.c:1:
/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/x86_64-cygwin/ruby/config.h:17:0: note: this is the location of the previous definition
 #define _GNU_SOURCE 1

 In file included from conftest.c:3:0:
/home/Lee/.rvm/gems/ruby-2.5.5/gems/nokogiri-1.6.8.1/ext/nokogiri/nokogiri.h:39:0: warning: "MAYBE_UNUSED" redefined
  #  define MAYBE_UNUSED(name) name __attribute__((unused))

In file included from /home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/ruby/ruby.h:24:0,
                 from /home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/ruby.h:33,
                 from conftest.c:1:
/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/x86_64-cygwin/ruby/config.h:134:0: note: this is the location of the previous definition
 #define MAYBE_UNUSED(x) __attribute__ ((__unused__)) x

cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <nokogiri.h>
/* end */

--------------------

find_header: checking for nokogiri.h in /home/Lee/.rvm/gems/ruby-2.5.5/gems/nokogiri-1.6.8.1/ext/nokogiri... -------------------- yes

"gcc -E -I/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/x86_64-cygwin -I/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/ruby/backward -I/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0 -I. -I/usr/include/libxml2 -I/home/Lee/.rvm/gems/ruby-2.5.5/gems/nokogiri-1.6.8.1/ext/nokogiri -D_XOPEN_SOURCE -D_GNU_SOURCE   -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wmisleading-indentation -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wimplicit-fallthrough=0 -Wduplicated-cond -Wrestrict -std=c99   conftest.c -o conftest.i"
In file included from conftest.c:3:0:
/home/Lee/.rvm/gems/ruby-2.5.5/gems/nokogiri-1.6.8.1/ext/nokogiri/nokogiri.h:13:0: warning: "_GNU_SOURCE" redefined
 #define _GNU_SOURCE

In file included from /home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/ruby/ruby.h:24:0,
                 from /home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/ruby.h:33,
                 from conftest.c:1:
/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/x86_64-cygwin/ruby/config.h:17:0: note: this is the location of the previous definition
 #define _GNU_SOURCE 1

In file included from conftest.c:3:0:
/home/Lee/.rvm/gems/ruby-2.5.5/gems/nokogiri-1.6.8.1/ext/nokogiri/nokogiri.h:39:0: warning: "MAYBE_UNUSED" redefined
 #  define MAYBE_UNUSED(name) name __attribute__((unused))

In file included from /home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/ruby/ruby.h:24:0,
                 from /home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/ruby.h:33,
                 from conftest.c:1:
/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/x86_64-cygwin/ruby/config.h:134:0: note: this is the location of the previous definition
 #define MAYBE_UNUSED(x) __attribute__ ((__unused__)) x

cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <nokogiri.h>
/* end */

--------------------

have_library: checking for gumbo_parse() in -lgumbo... -------------------- no

"gcc -o conftest.exe -I/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/x86_64-cygwin -I/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/ruby/backward -I/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0 -I. -I/usr/include/libxml2 -I/home/Lee/.rvm/gems/ruby-2.5.5/gems/nokogiri-1.6.8.1/ext/nokogiri -D_XOPEN_SOURCE -D_GNU_SOURCE   -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wmisleading-indentation -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wimplicit-fallthrough=0 -Wduplicated-cond -Wrestrict -std=c99  -DNGLIB conftest.c  -L. -L/home/Lee/.rvm/rubies/ruby-2.5.5/lib -L. -fstack-protector     -lxml2  -lxml2 -lruby250 -lgumbo -lxml2  -lxml2 -lpthread -ldl -lcrypt  "
conftest.c: In function ‘t’:
conftest.c:13:57: error: ‘gumbo_parse’ undeclared (first use in this function)
 int t(void) { void ((*volatile p)()); p = (void ((*)()))gumbo_parse; return !p; }
                                                     ^~~~~~~~~~~
conftest.c:13:57: note: each undeclared identifier is reported only once for each function it appears in
conftest.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
checked program was: 
/* begin */
1: #include "ruby.h"
 2: 
 3: /*top*/
 4: extern int t(void);
 5: int main(int argc, char **argv)
 6: {
 7:   if (argc > 1000000) {
 8:     printf("%p", &t);
 9:   }
10: 
11:   return 0;
12: }
13: int t(void) { void ((*volatile p)()); p = (void ((*)()))gumbo_parse; return !p; }
/* end */

"gcc -o conftest.exe -I/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/x86_64-cygwin -I/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0/ruby/backward -I/home/Lee/.rvm/rubies/ruby-2.5.5/include/ruby-2.5.0 -I. -I/usr/include/libxml2 -I/home/Lee/.rvm/gems/ruby-2.5.5/gems/nokogiri-1.6.8.1/ext/nokogiri -D_XOPEN_SOURCE -D_GNU_SOURCE   -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wmisleading-indentation -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wimplicit-fallthrough=0 -Wduplicated-cond -Wrestrict -std=c99  -DNGLIB conftest.c  -L. -L/home/Lee/.rvm/rubies/ruby-2.5.5/lib -L. -fstack-protector     -lxml2  -lxml2 -lruby250 -lgumbo -lxml2  -lxml2 -lpthread -ldl -lcrypt  "
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lgumbo
collect2: error: ld returned 1 exit status
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: /*top*/
 4: extern int t(void);
 5: int main(int argc, char **argv)
 6: {
 7:   if (argc > 1000000) {
 8:     printf("%p", &t);
 9:   }
10: 
11:   return 0;
12: }
13: extern void gumbo_parse();
14: int t(void) { gumbo_parse(); return 0; }
/* end */
--------------------
find_type: checking for GumboErrorType with error.h... -------------------- not found
--------------------
find_type: checking for GumboInsertionMode with insertion_mode.h... -------------------- not found
 --------------------
find_type: checking for GumboParser with parser.h... -------------------- not found
--------------------
find_type: checking for GumboStringBuffer with string_buffer.h... -------------------- not found
--------------------
find_type: checking for GumboTokenType with token_type.h... -------------------- not found
--------------------

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.

stevecheckoway commented 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.

Lee1984 commented 5 years ago

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.

stevecheckoway commented 5 years ago

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.

Lee1984 commented 5 years ago

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?

stevecheckoway commented 5 years ago

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.

Lee1984 commented 5 years ago

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.

stevecheckoway commented 5 years ago

Try gem install nokogumbo -- --without-libxml2.

Lee1984 commented 5 years ago

Yes it worked fine for version 2.0.1 but the same error for 1.4.13 checking for gumbo_parse() in -lgumbo... no

stevecheckoway commented 5 years ago

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

Lee1984 commented 5 years ago

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.