sparklemotion / nokogiri

Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby.
https://nokogiri.org/
MIT License
6.15k stars 898 forks source link

upstream html5lib-tests failure #2567

Closed flavorjones closed 2 years ago

flavorjones commented 2 years ago

This commit upstream:

https://github.com/html5lib/html5lib-tests/issues/143

is failing with this message:

Failure:
TestHtml5TreeConstructionTests20#test_39 [/home/flavorjones/code/oss/nokogiri/test/html5/test_tree_construction.rb:96]
Minitest::Assertion: Wrong number of errors for <!doctype html><button><p></button>x.
Expected: 3
  Actual: 0

This failure can be seen in the relevant "upstream" CI job, e.g. https://github.com/sparklemotion/nokogiri/runs/6722287019?check_suite_focus=true#step:8:4197

I'm not sure how to fix this and need help. @stevecheckoway I'd be happy to pair with you on it so you can start transferring some of the expertise you've got on the gumbo parser.

stevecheckoway commented 2 years ago

I was trying to dig into this and I'm afraid I'm running into a series of problems, only some of which are likely to be related to Nokogiri.

First problem: When I try to compile the C extension by running bundle exec rake, it fails. Here's the relevant section of mkmf.log.

DYLD_FALLBACK_LIBRARY_PATH=.:/nix/store/i7k4f3mw9nnnwvnznrmm38iy847i7yxc-ruby-3.1.2/lib "clang -o conftest -I/nix/store/i7k4f3mw9nnnwvnznrmm38iy847i7yxc-ruby-3.1.2/include/ruby-3.1.0/x86_64-darwin17 -I/nix/store/i7k4f3mw9nnnwvnznrmm38iy847i7yxc-ruby-3.1.2/include/ruby-3.1.0/ruby/backward -I/nix/store/i7k4f3mw9nnnwvnznrmm38iy847i7yxc-ruby-3.1.2/include/ruby-3.1.0 -I../../../../ext/nokogiri -I/Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/include/libxml2 -I/Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxslt/1.1.35/include -I/Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/include/libxml2 -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -DNOKOGIRI_PACKAGED_LIBRARIES -DNOKOGIRI_LIBXML2_PATCHES="\"0001-Remove-script-macro-support.patch 0002-Update-entities-to-remove-handling-of-ssi.patch 0003-libxml2.la-is-in-top_builddir.patch 0004-use-glibc-strlen.patch 0006-update-automake-files-for-arm64.patch 0008-htmlParseComment-handle-abruptly-closed-comments.patch 0009-allow-wildcard-namespaces.patch\"" -DNOKOGIRI_LIBXSLT_PATCHES="\"0001-update-automake-files-for-arm64.patch\"" -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef  -fno-common -pipe -std=c99 -Wno-declaration-after-statement -g -Winline -Wmissing-noreturn conftest.c  -L. -L/nix/store/i7k4f3mw9nnnwvnznrmm38iy847i7yxc-ruby-3.1.2/lib -L/Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/lib -L/Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxslt/1.1.35/lib -L. -fstack-protector-strong -L/nix/store/kn3sb477vkh5rqh9ss8b7xfkwfnl1lb9-gettext-0.21/lib -L/nix/store/r1hk06mv95z1n6lf6d6gx2x64s0ysq2c-file-5.41/lib -L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-ruby-2.7.6/lib -L/nix/store/03g1w9ssw6w2ay9jgzn0ankx162ddcdd-libffi-3.4.2-dev/lib -L/nix/store/8bvsa5cdnhygy6fzsciq40ir9x8fl3is-ncurses-6.3-dev/lib -L/nix/store/w05k1yl7rqp0r5kkv0gd7hwq0848disd-zlib-1.2.12-dev/lib -L/nix/store/wkl4ambiw6hx5h27fdi8jyah3rk9balk-openssl-1.1.1o-dev/lib -L/nix/store/9gcqdisglw28k37q12fkliqraziiy1db-gdbm-1.23/lib -L/nix/store/qndd43fqa9ygcban7q7sbp7z2xyyc0ba-libyaml-0.2.5/lib -L/nix/store/46i7p12y0xhbrwmky9c0zkbqj2ylbhv6-libiconv-50/lib -L/nix/store/y0cz4m93wg611dfj0pym65v41hwwav68-objc4-709.1/lib -L/nix/store/p9phdd7xbzixriss330dlndbnmsfn12q-libunwind-35.3/lib -L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-clang-wrapper-11.1.0/resource-root/lib -L/nix/store/4df4jhlj71vblmxhrr7dkkqpak8a42c8-Libsystem-1238.60.2/lib    /Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxslt/1.1.35/lib/libexslt.a -lm -liconv -lpthread -lz /Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/lib/libxml2.a /Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxslt/1.1.35/lib/libxslt.a -lm -liconv -lpthread -lz /Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/lib/libxml2.a -llzma -lruby-3.1.2 /Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxslt/1.1.35/lib/libexslt.a -lm -liconv -lpthread -lz /Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/lib/libxml2.a /Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxslt/1.1.35/lib/libxslt.a -lm -liconv -lpthread -lz /Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/lib/libxml2.a -llzma  "
conftest.c:16:13: error: conflicting types for 'xmlParseDoc'
extern void xmlParseDoc();
            ^
/Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/include/libxml2/libxml/parser.h:844:3: note: previous declaration is here
                xmlParseDoc             (const xmlChar *cur);
                ^
conftest.c:17:27: error: too few arguments to function call, single argument 'cur' was not specified
int t(void) { xmlParseDoc(); return 0; }
              ~~~~~~~~~~~ ^
/Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/include/libxml2/libxml/parser.h:844:3: note: 'xmlParseDoc' declared here
                xmlParseDoc             (const xmlChar *cur);
                ^
2 errors generated.

I'm not sure why the conftest.c includes both the header for xmlParseDoc and its own declaration. For link tests, I'd expect it to not include the header.

I tested this with Ruby 3.1.2 and Ruby 2.7.6.

Second problem, when I look at that output, I'm seeing -L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-ruby-2.7.6/lib and I have absolutely no idea why it's trying to do anything with Ruby 2.7.6 and I don't know what that all e hash is supposed to be. Unsurprisingly, that directory does not exist. The correct path is /nix/store/srkrmhv3512xyakgfcnd9ma1nrh6hszg-ruby-2.7.6/. This has got to be an issue with Nix, but I'm not sure where exactly the issue is.

Somewhat amusingly, Nokogiri is the example the Nix documentation shows for installing a gem. And indeed, I can install it.

% nix-shell -p "ruby_3_1.withPackages (ps: [ ps.nokogiri ])" --run 'nokogiri --version'
# Nokogiri (1.13.3)
    ---
    warnings: []
    nokogiri:
      version: 1.13.3
      cppflags:
      - "-I/nix/store/c9xl32mbvwcyb9jq23wxs3cajk0rcbgh-ruby3.1.2-nokogiri-1.13.3/lib/ruby/gems/3.1.0/gems/nokogiri-1.13.3/ext/nokogiri"
      ldflags: []
    ruby:
      version: 3.1.2
      platform: x86_64-darwin17
      gem_platform: x86_64-darwin-17
      description: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin17]
      engine: ruby
    libxml:
      source: system
      memory_management: ruby
      iconv_enabled: true
      compiled: 2.9.14
      loaded: 2.9.14
    libxslt:
      source: system
      datetime_enabled: true
      compiled: 1.1.35
      loaded: 1.1.35
    other_libraries:
      libgumbo: 1.0.0-nokogiri

A third issue I encountered although I'm not sure exactly how I managed to get to this point since I cannot replicate it is running rake modified several source files, removing the frozen strings magic comment which caused a subsequent run of rake to complain about.

And I'm kinda running out of steam on this right now. Any idea how to fix the conflicting types for 'xmlParseDoc' error?

flavorjones commented 2 years ago

Hey @stevecheckoway sorry you're having problems.

Make sure you're running bundle exec rake compile which should do everything for you. I've tried to give context on how to develop Nokogiri in the CONTRIBUTING.md file.

If that doesn't help, can you describe your system? Looks like you're doing something that's nix-based and :shrug: I don't know much about nix but I can try.

flavorjones commented 2 years ago

I'm happy to make time to pair with you on getting your env set up, just let me know.

stevecheckoway commented 2 years ago

bundle exec rake compile has the same error. (Full output below.)

xmlParseDoc is missing. Please locate mkmf.log to investigate how it is failing.
-----
*** ../../../../ext/nokogiri/extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

And the reason it's failing is the conflicting types for xmlParseDoc in the conftest.

I'm running macOS 11.6.2 on this machine and I have Ruby installed via Nix, having replaced MacPorts with Nix as my package manager quite recently. So I also don't know much about Nix.

bundle exec rake compile test -- --enable-system-libraries does let me compile the extension, so I'll try to return this issue tomorrow and see if I can figure out why I can't build with the packaged libraries.


Output

% bundle exec rake compile
mkdir -p tmp/x86_64-darwin17/nokogiri/3.1.2
cd tmp/x86_64-darwin17/nokogiri/3.1.2
/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/bin/ruby -I. -r.rake-compiler-siteconf.rb ../../../../ext/nokogiri/extconf.rb
checking for whether -std=c99 is accepted as CFLAGS... yes
checking for whether -Wno-declaration-after-statement is accepted as CFLAGS... yes
checking for whether -g is accepted as CFLAGS... yes
checking for whether -Winline is accepted as CFLAGS... yes
checking for whether -Wmissing-noreturn is accepted as CFLAGS... yes
checking for whether -Wno-error=unused-command-line-argument-hard-error-in-future is accepted as CFLAGS... no
Building nokogiri using packaged libraries.
Static linking is enabled.
Cross build is disabled.
checking for iconv.h... yes
Using mini_portile version 2.8.0
checking for iconv... yes
Building Nokogiri with a packaged version of libxml2-2.9.14.
Activating libxml2 2.9.14 (from /Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14)...
Using mini_portile version 2.8.0
Building Nokogiri with a packaged version of libxslt-1.1.35.
Activating libxslt 1.1.35 (from /Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxslt/1.1.35)...
checking for whether -DNOKOGIRI_PACKAGED_LIBRARIES is accepted as CPPFLAGS... yes
checking for whether -DNOKOGIRI_LIBXML2_PATCHES="\"0001-Remove-script-macro-support.patch 0002-Update-entities-to-remove-handling-of-ssi.patch 0003-libxml2.la-is-in-top_builddir.patch 0004-use-glibc-strlen.patch 0006-update-automake-files-for-arm64.patch 0008-htmlParseComment-handle-abruptly-closed-comments.patch 0009-allow-wildcard-namespaces.patch\"" is accepted as CPPFLAGS... yes
checking for -llzma... yes
checking for whether -DNOKOGIRI_LIBXSLT_PATCHES="\"0001-update-automake-files-for-arm64.patch\"" is accepted as CPPFLAGS... yes
checking for xmlParseDoc() in libxml/parser.h... no
-----
../../../../ext/nokogiri/extconf.rb:289:in `ensure_func'
../../../../ext/nokogiri/extconf.rb:914:in `<main>'
xmlParseDoc is missing. Please locate mkmf.log to investigate how it is failing.
-----
*** ../../../../ext/nokogiri/extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=../../../../ext/nokogiri
    --curdir
    --ruby=/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/bin/$(RUBY_BASE_NAME)
    --help
    --clean
    --prevent-strip
    --enable-system-libraries
    --disable-system-libraries
    --use-system-libraries
    --enable-system-libraries
    --disable-system-libraries
    --use-system-libraries
    --enable-static
    --disable-static
    --enable-cross-build
    --disable-cross-build
    --with-zlib-dir
    --without-zlib-dir
    --with-zlib-include
    --without-zlib-include=${zlib-dir}/include
    --with-zlib-lib
    --without-zlib-lib=${zlib-dir}/lib
    --with-iconv-dir
    --without-iconv-dir
    --with-iconv-include
    --without-iconv-include=${iconv-dir}/include
    --with-iconv-lib
    --without-iconv-lib=${iconv-dir}/lib
    --with-xml2-source-dir
    --with-xslt-source-dir
rake aborted!
Command failed with status (1): [/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fq...]
/Users/steve/programming/nokogiri/vendor/bundle/ruby/3.1.0/gems/rake-compiler-1.2.0/lib/rake/extensiontask.rb:220:in `block (2 levels) in define_compile_tasks'
/Users/steve/programming/nokogiri/vendor/bundle/ruby/3.1.0/gems/rake-compiler-1.2.0/lib/rake/extensiontask.rb:217:in `block in define_compile_tasks'
/Users/steve/programming/nokogiri/vendor/bundle/ruby/3.1.0/gems/rake-13.0.3/exe/rake:27:in `<top (required)>'
/Users/steve/.nix-profile/bin/bundle:23:in `load'
/Users/steve/.nix-profile/bin/bundle:23:in `<main>'
Tasks: TOP => compile => compile:x86_64-darwin17 => compile:nokogiri:x86_64-darwin17 => copy:nokogiri:x86_64-darwin17:3.1.2 => tmp/x86_64-darwin17/nokogiri/3.1.2/nokogiri.bundle => tmp/x86_64-darwin17/nokogiri/3.1.2/Makefile
(See full trace by running task with --trace)

mkmf.log

block in append_cflags: checking for whether -std=c99 is accepted as CFLAGS... -------------------- yes

DYLD_FALLBACK_LIBRARY_PATH=.:/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/lib "clang -o conftest -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/x86_64-darwin17 -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/ruby/backward -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0 -I../../../../ext/nokogiri -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef  -fno-common -pipe conftest.c  -L. -L/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/lib -L. -fstack-protector-strong -L/nix/store/rfdxfrkcrx77ww2jm7fhsjgs4qhd7g30-gettext-0.21/lib -L/nix/store/ii7vxyl7q2vg6navl4ngdhnhj9nwvwd1-file-5.41/lib -L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-ruby-2.7.6/lib -L/nix/store/hy8c71sidqv5pnrqmck9a5wjkjjdc8ka-libffi-3.4.2-dev/lib -L/nix/store/8zx3qw601hrzyl07rdj6hq9pkcgdjj8f-ncurses-6.3-p20220507-dev/lib -L/nix/store/pksf93apa597jx56ggh2hixqw4232hhg-zlib-1.2.12-dev/lib -L/nix/store/xs1d61fj4rcv6lpd8750rssv1gnvixiw-openssl-1.1.1o-dev/lib -L/nix/store/nyb8c9zqv2d15r82d5ymw3iz5k9pmq22-gdbm-1.23/lib -L/nix/store/7p6cpw9lfpsm6gnrg0d8ym7kx0jrbr9m-libyaml-0.2.5/lib -L/nix/store/a1ccfsrw16r8kbajg05i2bpnn28z70yj-libiconv-50/lib -L/nix/store/117lzg3kp13swfbsrkhh55myqpgy67ic-objc4-709.1/lib -L/nix/store/gigab57p75dpp7ngyc9k74n9q8gg4paa-libunwind-35.3/lib -L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-clang-wrapper-11.1.0/resource-root/lib -L/nix/store/b6xhc77ffsqh7g25i07pm42ldz7bmkjv-Libsystem-1238.60.2/lib     -lruby-3.1.2   "
ld: warning: directory not found for option '-L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-ruby-2.7.6/lib'
ld: warning: directory not found for option '-L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-clang-wrapper-11.1.0/resource-root/lib'
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return !!argv[argc];
6: }
/* end */

DYLD_FALLBACK_LIBRARY_PATH=.:/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/lib "clang -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/x86_64-darwin17 -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/ruby/backward -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0 -I../../../../ext/nokogiri -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef  -fno-common -pipe  -std=c99 -Werror -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return !!argv[argc];
6: }
/* end */

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

block in append_cflags: checking for whether -Wno-declaration-after-statement is accepted as CFLAGS... -------------------- yes

DYLD_FALLBACK_LIBRARY_PATH=.:/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/lib "clang -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/x86_64-darwin17 -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/ruby/backward -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0 -I../../../../ext/nokogiri -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef  -fno-common -pipe -std=c99  -Wno-declaration-after-statement -Werror -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return !!argv[argc];
6: }
/* end */

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

block in append_cflags: checking for whether -g is accepted as CFLAGS... -------------------- yes

DYLD_FALLBACK_LIBRARY_PATH=.:/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/lib "clang -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/x86_64-darwin17 -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/ruby/backward -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0 -I../../../../ext/nokogiri -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef  -fno-common -pipe -std=c99 -Wno-declaration-after-statement  -g -Werror -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return !!argv[argc];
6: }
/* end */

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

block in append_cflags: checking for whether -Winline is accepted as CFLAGS... -------------------- yes

DYLD_FALLBACK_LIBRARY_PATH=.:/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/lib "clang -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/x86_64-darwin17 -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/ruby/backward -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0 -I../../../../ext/nokogiri -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef  -fno-common -pipe -std=c99 -Wno-declaration-after-statement -g  -Winline -Werror -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return !!argv[argc];
6: }
/* end */

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

block in append_cflags: checking for whether -Wmissing-noreturn is accepted as CFLAGS... -------------------- yes

DYLD_FALLBACK_LIBRARY_PATH=.:/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/lib "clang -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/x86_64-darwin17 -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/ruby/backward -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0 -I../../../../ext/nokogiri -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef  -fno-common -pipe -std=c99 -Wno-declaration-after-statement -g -Winline  -Wmissing-noreturn -Werror -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return !!argv[argc];
6: }
/* end */

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

block in append_cflags: checking for whether -Wno-error=unused-command-line-argument-hard-error-in-future is accepted as CFLAGS... -------------------- no

DYLD_FALLBACK_LIBRARY_PATH=.:/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/lib "clang -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/x86_64-darwin17 -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/ruby/backward -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0 -I../../../../ext/nokogiri -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef  -fno-common -pipe -std=c99 -Wno-declaration-after-statement -g -Winline -Wmissing-noreturn  -Wno-error=unused-command-line-argument-hard-error-in-future -Werror -c conftest.c"
error: unknown warning option '-Werror=unused-command-line-argument-hard-error-in-future'; did you mean '-Werror=unused-command-line-argument'? [-Werror,-Wunknown-warning-option]
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return !!argv[argc];
6: }
/* end */

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

have_header: checking for iconv.h... -------------------- yes

DYLD_FALLBACK_LIBRARY_PATH=.:/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/lib "clang -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/x86_64-darwin17 -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/ruby/backward -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0 -I../../../../ext/nokogiri -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef  -fno-common -pipe -std=c99 -Wno-declaration-after-statement -g -Winline -Wmissing-noreturn   -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <iconv.h>
/* end */

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

try_link_iconv: checking for iconv... -------------------- yes

DYLD_FALLBACK_LIBRARY_PATH=.:/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/lib "clang -o conftest -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/x86_64-darwin17 -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/ruby/backward -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0 -I../../../../ext/nokogiri -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef  -fno-common -pipe -std=c99 -Wno-declaration-after-statement -g -Winline -Wmissing-noreturn conftest.c  -L. -L/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/lib -L. -fstack-protector-strong -L/nix/store/rfdxfrkcrx77ww2jm7fhsjgs4qhd7g30-gettext-0.21/lib -L/nix/store/ii7vxyl7q2vg6navl4ngdhnhj9nwvwd1-file-5.41/lib -L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-ruby-2.7.6/lib -L/nix/store/hy8c71sidqv5pnrqmck9a5wjkjjdc8ka-libffi-3.4.2-dev/lib -L/nix/store/8zx3qw601hrzyl07rdj6hq9pkcgdjj8f-ncurses-6.3-p20220507-dev/lib -L/nix/store/pksf93apa597jx56ggh2hixqw4232hhg-zlib-1.2.12-dev/lib -L/nix/store/xs1d61fj4rcv6lpd8750rssv1gnvixiw-openssl-1.1.1o-dev/lib -L/nix/store/nyb8c9zqv2d15r82d5ymw3iz5k9pmq22-gdbm-1.23/lib -L/nix/store/7p6cpw9lfpsm6gnrg0d8ym7kx0jrbr9m-libyaml-0.2.5/lib -L/nix/store/a1ccfsrw16r8kbajg05i2bpnn28z70yj-libiconv-50/lib -L/nix/store/117lzg3kp13swfbsrkhh55myqpgy67ic-objc4-709.1/lib -L/nix/store/gigab57p75dpp7ngyc9k74n9q8gg4paa-libunwind-35.3/lib -L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-clang-wrapper-11.1.0/resource-root/lib -L/nix/store/b6xhc77ffsqh7g25i07pm42ldz7bmkjv-Libsystem-1238.60.2/lib     -lruby-3.1.2   "
ld: warning: directory not found for option '-L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-ruby-2.7.6/lib'
ld: warning: directory not found for option '-L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-clang-wrapper-11.1.0/resource-root/lib'
Undefined symbols for architecture x86_64:
  "_iconv", referenced from:
      _main in conftest-245d21.o
  "_iconv_open", referenced from:
      _main in conftest-245d21.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <stdlib.h>
 4: #include <iconv.h>
 5: int main(void)
 6: {
 7:     iconv_t cd = iconv_open("", "");
 8:     iconv(cd, NULL, NULL, NULL, NULL);
 9:     return EXIT_SUCCESS;
10: }
/* end */

DYLD_FALLBACK_LIBRARY_PATH=.:/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/lib "clang -o conftest -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/x86_64-darwin17 -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/ruby/backward -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0 -I../../../../ext/nokogiri -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef  -fno-common -pipe -std=c99 -Wno-declaration-after-statement -g -Winline -Wmissing-noreturn conftest.c  -L. -L/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/lib -L. -fstack-protector-strong -L/nix/store/rfdxfrkcrx77ww2jm7fhsjgs4qhd7g30-gettext-0.21/lib -L/nix/store/ii7vxyl7q2vg6navl4ngdhnhj9nwvwd1-file-5.41/lib -L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-ruby-2.7.6/lib -L/nix/store/hy8c71sidqv5pnrqmck9a5wjkjjdc8ka-libffi-3.4.2-dev/lib -L/nix/store/8zx3qw601hrzyl07rdj6hq9pkcgdjj8f-ncurses-6.3-p20220507-dev/lib -L/nix/store/pksf93apa597jx56ggh2hixqw4232hhg-zlib-1.2.12-dev/lib -L/nix/store/xs1d61fj4rcv6lpd8750rssv1gnvixiw-openssl-1.1.1o-dev/lib -L/nix/store/nyb8c9zqv2d15r82d5ymw3iz5k9pmq22-gdbm-1.23/lib -L/nix/store/7p6cpw9lfpsm6gnrg0d8ym7kx0jrbr9m-libyaml-0.2.5/lib -L/nix/store/a1ccfsrw16r8kbajg05i2bpnn28z70yj-libiconv-50/lib -L/nix/store/117lzg3kp13swfbsrkhh55myqpgy67ic-objc4-709.1/lib -L/nix/store/gigab57p75dpp7ngyc9k74n9q8gg4paa-libunwind-35.3/lib -L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-clang-wrapper-11.1.0/resource-root/lib -L/nix/store/b6xhc77ffsqh7g25i07pm42ldz7bmkjv-Libsystem-1238.60.2/lib     -lruby-3.1.2 -liconv  "
ld: warning: directory not found for option '-L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-ruby-2.7.6/lib'
ld: warning: directory not found for option '-L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-clang-wrapper-11.1.0/resource-root/lib'
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <stdlib.h>
 4: #include <iconv.h>
 5: int main(void)
 6: {
 7:     iconv_t cd = iconv_open("", "");
 8:     iconv(cd, NULL, NULL, NULL, NULL);
 9:     return EXIT_SUCCESS;
10: }
/* end */

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

block in append_cppflags: checking for whether -DNOKOGIRI_PACKAGED_LIBRARIES is accepted as CPPFLAGS... -------------------- yes

DYLD_FALLBACK_LIBRARY_PATH=.:/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/lib "clang -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/x86_64-darwin17 -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/ruby/backward -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0 -I../../../../ext/nokogiri -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef  -fno-common -pipe -std=c99 -Wno-declaration-after-statement -g -Winline -Wmissing-noreturn  -DNOKOGIRI_PACKAGED_LIBRARIES -Werror -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return !!argv[argc];
6: }
/* end */

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

block in append_cppflags: checking for whether -DNOKOGIRI_LIBXML2_PATCHES="\"0001-Remove-script-macro-support.patch 0002-Update-entities-to-remove-handling-of-ssi.patch 0003-libxml2.la-is-in-top_builddir.patch 0004-use-glibc-strlen.patch 0006-update-automake-files-for-arm64.patch 0008-htmlParseComment-handle-abruptly-closed-comments.patch 0009-allow-wildcard-namespaces.patch\"" is accepted as CPPFLAGS... -------------------- yes

DYLD_FALLBACK_LIBRARY_PATH=.:/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/lib "clang -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/x86_64-darwin17 -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/ruby/backward -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0 -I../../../../ext/nokogiri -I/Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/include/libxml2 -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -DNOKOGIRI_PACKAGED_LIBRARIES -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef  -fno-common -pipe -std=c99 -Wno-declaration-after-statement -g -Winline -Wmissing-noreturn  -DNOKOGIRI_LIBXML2_PATCHES="\"0001-Remove-script-macro-support.patch 0002-Update-entities-to-remove-handling-of-ssi.patch 0003-libxml2.la-is-in-top_builddir.patch 0004-use-glibc-strlen.patch 0006-update-automake-files-for-arm64.patch 0008-htmlParseComment-handle-abruptly-closed-comments.patch 0009-allow-wildcard-namespaces.patch\"" -Werror -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return !!argv[argc];
6: }
/* end */

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

have_library: checking for -llzma... -------------------- yes

DYLD_FALLBACK_LIBRARY_PATH=.:/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/lib "clang -o conftest -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/x86_64-darwin17 -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/ruby/backward -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0 -I../../../../ext/nokogiri -I/Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/include/libxml2 -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -DNOKOGIRI_PACKAGED_LIBRARIES -DNOKOGIRI_LIBXML2_PATCHES="\"0001-Remove-script-macro-support.patch 0002-Update-entities-to-remove-handling-of-ssi.patch 0003-libxml2.la-is-in-top_builddir.patch 0004-use-glibc-strlen.patch 0006-update-automake-files-for-arm64.patch 0008-htmlParseComment-handle-abruptly-closed-comments.patch 0009-allow-wildcard-namespaces.patch\"" -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef  -fno-common -pipe -std=c99 -Wno-declaration-after-statement -g -Winline -Wmissing-noreturn conftest.c  -L. -L/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/lib -L/Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/lib -L. -fstack-protector-strong -L/nix/store/rfdxfrkcrx77ww2jm7fhsjgs4qhd7g30-gettext-0.21/lib -L/nix/store/ii7vxyl7q2vg6navl4ngdhnhj9nwvwd1-file-5.41/lib -L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-ruby-2.7.6/lib -L/nix/store/hy8c71sidqv5pnrqmck9a5wjkjjdc8ka-libffi-3.4.2-dev/lib -L/nix/store/8zx3qw601hrzyl07rdj6hq9pkcgdjj8f-ncurses-6.3-p20220507-dev/lib -L/nix/store/pksf93apa597jx56ggh2hixqw4232hhg-zlib-1.2.12-dev/lib -L/nix/store/xs1d61fj4rcv6lpd8750rssv1gnvixiw-openssl-1.1.1o-dev/lib -L/nix/store/nyb8c9zqv2d15r82d5ymw3iz5k9pmq22-gdbm-1.23/lib -L/nix/store/7p6cpw9lfpsm6gnrg0d8ym7kx0jrbr9m-libyaml-0.2.5/lib -L/nix/store/a1ccfsrw16r8kbajg05i2bpnn28z70yj-libiconv-50/lib -L/nix/store/117lzg3kp13swfbsrkhh55myqpgy67ic-objc4-709.1/lib -L/nix/store/gigab57p75dpp7ngyc9k74n9q8gg4paa-libunwind-35.3/lib -L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-clang-wrapper-11.1.0/resource-root/lib -L/nix/store/b6xhc77ffsqh7g25i07pm42ldz7bmkjv-Libsystem-1238.60.2/lib     -lruby-3.1.2 -llzma   "
ld: warning: directory not found for option '-L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-ruby-2.7.6/lib'
ld: warning: directory not found for option '-L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-clang-wrapper-11.1.0/resource-root/lib'
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:     int (* volatile tp)(void)=(int (*)(void))&t;
 9:     printf("%d", (*tp)());
10:   }
11: 
12:   return !!argv[argc];
13: }
14: 
15: int t(void) { ; return 0; }
/* end */

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

block in append_cppflags: checking for whether -DNOKOGIRI_LIBXSLT_PATCHES="\"0001-update-automake-files-for-arm64.patch\"" is accepted as CPPFLAGS... -------------------- yes

DYLD_FALLBACK_LIBRARY_PATH=.:/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/lib "clang -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/x86_64-darwin17 -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/ruby/backward -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0 -I../../../../ext/nokogiri -I/Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/include/libxml2 -I/Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxslt/1.1.35/include -I/Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/include/libxml2 -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -DNOKOGIRI_PACKAGED_LIBRARIES -DNOKOGIRI_LIBXML2_PATCHES="\"0001-Remove-script-macro-support.patch 0002-Update-entities-to-remove-handling-of-ssi.patch 0003-libxml2.la-is-in-top_builddir.patch 0004-use-glibc-strlen.patch 0006-update-automake-files-for-arm64.patch 0008-htmlParseComment-handle-abruptly-closed-comments.patch 0009-allow-wildcard-namespaces.patch\"" -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef  -fno-common -pipe -std=c99 -Wno-declaration-after-statement -g -Winline -Wmissing-noreturn  -DNOKOGIRI_LIBXSLT_PATCHES="\"0001-update-automake-files-for-arm64.patch\"" -Werror -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return !!argv[argc];
6: }
/* end */

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

have_func: checking for xmlParseDoc() in libxml/parser.h... -------------------- no

DYLD_FALLBACK_LIBRARY_PATH=.:/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/lib "clang -o conftest -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/x86_64-darwin17 -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/ruby/backward -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0 -I../../../../ext/nokogiri -I/Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/include/libxml2 -I/Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxslt/1.1.35/include -I/Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/include/libxml2 -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -DNOKOGIRI_PACKAGED_LIBRARIES -DNOKOGIRI_LIBXML2_PATCHES="\"0001-Remove-script-macro-support.patch 0002-Update-entities-to-remove-handling-of-ssi.patch 0003-libxml2.la-is-in-top_builddir.patch 0004-use-glibc-strlen.patch 0006-update-automake-files-for-arm64.patch 0008-htmlParseComment-handle-abruptly-closed-comments.patch 0009-allow-wildcard-namespaces.patch\"" -DNOKOGIRI_LIBXSLT_PATCHES="\"0001-update-automake-files-for-arm64.patch\"" -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef  -fno-common -pipe -std=c99 -Wno-declaration-after-statement -g -Winline -Wmissing-noreturn conftest.c  -L. -L/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/lib -L/Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/lib -L/Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxslt/1.1.35/lib -L. -fstack-protector-strong -L/nix/store/rfdxfrkcrx77ww2jm7fhsjgs4qhd7g30-gettext-0.21/lib -L/nix/store/ii7vxyl7q2vg6navl4ngdhnhj9nwvwd1-file-5.41/lib -L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-ruby-2.7.6/lib -L/nix/store/hy8c71sidqv5pnrqmck9a5wjkjjdc8ka-libffi-3.4.2-dev/lib -L/nix/store/8zx3qw601hrzyl07rdj6hq9pkcgdjj8f-ncurses-6.3-p20220507-dev/lib -L/nix/store/pksf93apa597jx56ggh2hixqw4232hhg-zlib-1.2.12-dev/lib -L/nix/store/xs1d61fj4rcv6lpd8750rssv1gnvixiw-openssl-1.1.1o-dev/lib -L/nix/store/nyb8c9zqv2d15r82d5ymw3iz5k9pmq22-gdbm-1.23/lib -L/nix/store/7p6cpw9lfpsm6gnrg0d8ym7kx0jrbr9m-libyaml-0.2.5/lib -L/nix/store/a1ccfsrw16r8kbajg05i2bpnn28z70yj-libiconv-50/lib -L/nix/store/117lzg3kp13swfbsrkhh55myqpgy67ic-objc4-709.1/lib -L/nix/store/gigab57p75dpp7ngyc9k74n9q8gg4paa-libunwind-35.3/lib -L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-clang-wrapper-11.1.0/resource-root/lib -L/nix/store/b6xhc77ffsqh7g25i07pm42ldz7bmkjv-Libsystem-1238.60.2/lib    /Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxslt/1.1.35/lib/libexslt.a -lm -liconv -lpthread -lz /Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/lib/libxml2.a /Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxslt/1.1.35/lib/libxslt.a -lm -liconv -lpthread -lz /Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/lib/libxml2.a -llzma -lruby-3.1.2 /Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxslt/1.1.35/lib/libexslt.a -lm -liconv -lpthread -lz /Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/lib/libxml2.a /Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxslt/1.1.35/lib/libxslt.a -lm -liconv -lpthread -lz /Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/lib/libxml2.a -llzma  "
ld: warning: directory not found for option '-L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-ruby-2.7.6/lib'
ld: warning: directory not found for option '-L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-clang-wrapper-11.1.0/resource-root/lib'
Undefined symbols for architecture x86_64:
  "___darwin_check_fd_set_overflow", referenced from:
      _xmlNanoFTPCheckResponse in libxml2.a(nanoftp.o)
      _xmlNanoFTPCloseConnection in libxml2.a(nanoftp.o)
      _xmlNanoFTPList in libxml2.a(nanoftp.o)
      _xmlNanoFTPGet in libxml2.a(nanoftp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <libxml/parser.h>
 4: 
 5: /*top*/
 6: extern int t(void);
 7: int main(int argc, char **argv)
 8: {
 9:   if (argc > 1000000) {
10:     int (* volatile tp)(void)=(int (*)(void))&t;
11:     printf("%d", (*tp)());
12:   }
13: 
14:   return !!argv[argc];
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))xmlParseDoc; return !p; }
/* end */

DYLD_FALLBACK_LIBRARY_PATH=.:/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/lib "clang -o conftest -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/x86_64-darwin17 -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0/ruby/backward -I/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/include/ruby-3.1.0 -I../../../../ext/nokogiri -I/Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/include/libxml2 -I/Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxslt/1.1.35/include -I/Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/include/libxml2 -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -DNOKOGIRI_PACKAGED_LIBRARIES -DNOKOGIRI_LIBXML2_PATCHES="\"0001-Remove-script-macro-support.patch 0002-Update-entities-to-remove-handling-of-ssi.patch 0003-libxml2.la-is-in-top_builddir.patch 0004-use-glibc-strlen.patch 0006-update-automake-files-for-arm64.patch 0008-htmlParseComment-handle-abruptly-closed-comments.patch 0009-allow-wildcard-namespaces.patch\"" -DNOKOGIRI_LIBXSLT_PATCHES="\"0001-update-automake-files-for-arm64.patch\"" -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef  -fno-common -pipe -std=c99 -Wno-declaration-after-statement -g -Winline -Wmissing-noreturn conftest.c  -L. -L/nix/store/y9l998hxym9j4pqalz9jygvv9kbr4fqa-ruby-3.1.2/lib -L/Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/lib -L/Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxslt/1.1.35/lib -L. -fstack-protector-strong -L/nix/store/rfdxfrkcrx77ww2jm7fhsjgs4qhd7g30-gettext-0.21/lib -L/nix/store/ii7vxyl7q2vg6navl4ngdhnhj9nwvwd1-file-5.41/lib -L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-ruby-2.7.6/lib -L/nix/store/hy8c71sidqv5pnrqmck9a5wjkjjdc8ka-libffi-3.4.2-dev/lib -L/nix/store/8zx3qw601hrzyl07rdj6hq9pkcgdjj8f-ncurses-6.3-p20220507-dev/lib -L/nix/store/pksf93apa597jx56ggh2hixqw4232hhg-zlib-1.2.12-dev/lib -L/nix/store/xs1d61fj4rcv6lpd8750rssv1gnvixiw-openssl-1.1.1o-dev/lib -L/nix/store/nyb8c9zqv2d15r82d5ymw3iz5k9pmq22-gdbm-1.23/lib -L/nix/store/7p6cpw9lfpsm6gnrg0d8ym7kx0jrbr9m-libyaml-0.2.5/lib -L/nix/store/a1ccfsrw16r8kbajg05i2bpnn28z70yj-libiconv-50/lib -L/nix/store/117lzg3kp13swfbsrkhh55myqpgy67ic-objc4-709.1/lib -L/nix/store/gigab57p75dpp7ngyc9k74n9q8gg4paa-libunwind-35.3/lib -L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-clang-wrapper-11.1.0/resource-root/lib -L/nix/store/b6xhc77ffsqh7g25i07pm42ldz7bmkjv-Libsystem-1238.60.2/lib    /Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxslt/1.1.35/lib/libexslt.a -lm -liconv -lpthread -lz /Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/lib/libxml2.a /Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxslt/1.1.35/lib/libxslt.a -lm -liconv -lpthread -lz /Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/lib/libxml2.a -llzma -lruby-3.1.2 /Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxslt/1.1.35/lib/libexslt.a -lm -liconv -lpthread -lz /Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/lib/libxml2.a /Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxslt/1.1.35/lib/libxslt.a -lm -liconv -lpthread -lz /Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/lib/libxml2.a -llzma  "
conftest.c:16:13: error: conflicting types for 'xmlParseDoc'
extern void xmlParseDoc();
            ^
/Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/include/libxml2/libxml/parser.h:844:3: note: previous declaration is here
                xmlParseDoc             (const xmlChar *cur);
                ^
conftest.c:17:27: error: too few arguments to function call, single argument 'cur' was not specified
int t(void) { xmlParseDoc(); return 0; }
              ~~~~~~~~~~~ ^
/Users/steve/programming/nokogiri/ports/x86_64-darwin17/libxml2/2.9.14/include/libxml2/libxml/parser.h:844:3: note: 'xmlParseDoc' declared here
                xmlParseDoc             (const xmlChar *cur);
                ^
2 errors generated.
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <libxml/parser.h>
 4: 
 5: /*top*/
 6: extern int t(void);
 7: int main(int argc, char **argv)
 8: {
 9:   if (argc > 1000000) {
10:     int (* volatile tp)(void)=(int (*)(void))&t;
11:     printf("%d", (*tp)());
12:   }
13: 
14:   return !!argv[argc];
15: }
16: extern void xmlParseDoc();
17: int t(void) { xmlParseDoc(); return 0; }
/* end */

--------------------
flavorjones commented 2 years ago

The relevant error is:

Undefined symbols for architecture x86_64:
  "___darwin_check_fd_set_overflow", referenced from:
      _xmlNanoFTPCheckResponse in libxml2.a(nanoftp.o)
      _xmlNanoFTPCloseConnection in libxml2.a(nanoftp.o)
      _xmlNanoFTPList in libxml2.a(nanoftp.o)
      _xmlNanoFTPGet in libxml2.a(nanoftp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

which I've never seen before but googling indicates it may be related to specific versions of clang or xcode?

stevecheckoway commented 2 years ago

And that's why 1. I should read the entire log and not just the last entry showing an error; and 2. I should post the full log the first time.

I'm using the system clang.

% clang --version
Apple clang version 13.0.0 (clang-1300.0.29.30)
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
stevecheckoway commented 2 years ago

Okay, this works.

LDFLAGS='-Wl,-U,___darwin_check_fd_set_overflow' bundle exec rake compile

I got that from here.

flavorjones commented 2 years ago

Phew, OK. It may be worth rebuilding libxml2/libxslt if you haven't done that since upgrading clang/xcode, too. bundle exec rake clean clobber will wipe the slate clean.

flavorjones commented 2 years ago

And once you've got it building, to run the html5lib-tests suite, see https://github.com/sparklemotion/nokogiri/blob/main/CONTRIBUTING.md#gumbo-html5-parser and update the submodule to origin/master

stevecheckoway commented 2 years ago

Okay, I'm now getting the error, but I think the test is wrong. I don't believe <!doctype html><button><p></button> has any errors. I'll follow up with html5lib-tests.

stevecheckoway commented 2 years ago

PR filed upstream. https://github.com/html5lib/html5lib-tests/pull/149

flavorjones commented 2 years ago

Thank you!

flavorjones commented 2 years ago

PR was merged and upstream is green again: https://github.com/sparklemotion/nokogiri/actions/runs/2648112105