Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes to allow C code to compile with Visual C++ compiler #2061

Closed
wants to merge 2 commits into from
Closed

Fixes to allow C code to compile with Visual C++ compiler #2061

wants to merge 2 commits into from

Conversation

preetpalS
Copy link

@preetpalS preetpalS commented Aug 12, 2020


Thank you for contributing to Nokogiri! To help us prioritize, please take care to answer the questions below when you submit this pull request.

The Nokogiri core team work off of master, so please submit all PRs based on the master branch. We generally will cherry-pick relevant bug fixes onto the current release branch.

What problem is this PR intended to solve?

This allows the C code to compile when compiling with the C compiler from Microsoft Visual Studio (Microsoft (R) C/C++ Optimizing Compiler Version 19.26.28805 for x64).

This is relevant because if you compile Ruby with that compiler, that would be the compiler you use for compiling native extensions.

Related to #2015.

Have you included adequate test coverage?

These changes are not intended to cause any changes in behavior.

Does this change affect the C or the Java implementations?

These changes are only relevant to the C implementation.

@codeclimate
Copy link

codeclimate bot commented Aug 12, 2020

Code Climate has analyzed commit 22450ec and detected 0 issues on this pull request.

View more on Code Climate.

@AppVeyorBot
Copy link

Build nokogiri 1.0.630 failed (commit 42a63a789f by @preetpalS)

@flavorjones
Copy link
Member

@preetpalS Thanks for submitting this change. Please note that CI is failing:

../../../../ext/nokogiri/xml_document.c:58:26: error: 'st_foreach_callback_func' undeclared (first use in this function); did you mean 'st_update_callback_func'?

@flavorjones
Copy link
Member

@preetpalS Hi! Can you provide some insight into why you're contributing these changes? I'd like to understand if you're addressing something that causes errors during compilation, or if these are just warnings, or something else.

@preetpalS
Copy link
Author

@flavorjones I am addressing something that causes errors during compilation.

@AppVeyorBot
Copy link

@preetpalS
Copy link
Author

I compiled Ruby with the Microsoft Visual C++ compiler.

I compiled it from the download from ruby-lang.org using the instructions in the win32 folder and by downloading and installing some libraries (like openssl, zlib) using vcpkg (you have to modify the LIB, INCLUDE, PATH environment variables with based on the triplet being used (I used the x64-windows triplet)).

The test suite runs but has some failures when running with Ruby compiled with the Visual C++ compiler (this may be due to issues with my setup though).

I copied and pasted some the command line output from the compilation and test suite run below.

Command Prompt Output
C:\Users\preet\Projects\OpenSource\nokogiri>bundle exec rake compile
rake aborted!
Interrupt:
C:/Users/preet/Projects/OpenSource/nokogiri/Rakefile:15:in `<top (required)>'
(See full trace by running task with --trace)
Terminate batch job (Y/N)? ;
Terminate batch job (Y/N)? y
Terminate batch job (Y/N)? y

C:\Users\preet\Projects\OpenSource\nokogiri>bundle exec rake compile -- --use-system-libraries
mkdir -p tmp/x64-mswin64_140/nokogiri/2.7.1
cd tmp/x64-mswin64_140/nokogiri/2.7.1
C:/ruby/mswin64/ruby-2.7.1/bin/ruby.exe -I. ../../../../ext/nokogiri/extconf.rb  -- --use-system-libraries
checking if the C compiler accepts ... no
Building nokogiri using system libraries.
pkg-config could not be used to find libxml-2.0
Please install either `pkg-config` or the pkg-config gem per

    gem install pkg-config -v "~> 1.1"

pkg-config could not be used to find libxslt
Please install either `pkg-config` or the pkg-config gem per

    gem install pkg-config -v "~> 1.1"

pkg-config could not be used to find libexslt
Please install either `pkg-config` or the pkg-config gem per

    gem install pkg-config -v "~> 1.1"

checking for xmlParseDoc() in libxml/parser.h... no
checking for xmlParseDoc() in xml2.lib... no
checking for xmlParseDoc() in libxml2.lib... yes
checking for xsltParseStylesheetDoc() in libxslt/xslt.h... no
checking for xsltParseStylesheetDoc() in xslt.lib... no
checking for xsltParseStylesheetDoc() in libxslt.lib... yes
checking for exsltFuncRegister() in libexslt/exslt.h... no
checking for exsltFuncRegister() in exslt.lib... no
checking for exsltFuncRegister() in libexslt.lib... yes
checking for xmlHasFeature()... yes
checking for xmlFirstElementChild()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetValidStructuredErrors()... yes
checking for xmlSchemaSetValidStructuredErrors()... yes
checking for xmlSchemaSetParserStructuredErrors()... yes
creating Makefile
cd -
cd tmp/x64-mswin64_140/nokogiri/2.7.1
nmake

Microsoft (R) Program Maintenance Utility Version 14.26.28805.0
Copyright (C) Microsoft Corporation.  All rights reserved.

generating nokogiri-x64-mswin64_140.def
compiling ../../../../ext/nokogiri/html_document.c
html_document.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/html_element_description.c
html_element_description.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/html_entity_lookup.c
html_entity_lookup.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/html_sax_parser_context.c
html_sax_parser_context.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/html_sax_push_parser.c
html_sax_push_parser.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/nokogiri.c
nokogiri.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_attr.c
xml_attr.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_attribute_decl.c
xml_attribute_decl.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_cdata.c
xml_cdata.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_comment.c
xml_comment.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_document.c
xml_document.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_document_fragment.c
xml_document_fragment.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_dtd.c
xml_dtd.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_element_content.c
xml_element_content.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_element_decl.c
xml_element_decl.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_encoding_handler.c
xml_encoding_handler.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_entity_decl.c
xml_entity_decl.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_entity_reference.c
xml_entity_reference.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_io.c
xml_io.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_libxml2_hacks.c
xml_libxml2_hacks.c
compiling ../../../../ext/nokogiri/xml_namespace.c
xml_namespace.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_node.c
xml_node.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
../../../../ext/nokogiri/xml_node.c(304): warning C4090: 'function': different 'const' qualifiers
../../../../ext/nokogiri/xml_node.c(383): warning C4311: 'type cast': pointer truncation from 'xmlNodePtr' to 'long'
compiling ../../../../ext/nokogiri/xml_node_set.c
xml_node_set.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_processing_instruction.c
xml_processing_instruction.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_reader.c
xml_reader.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_relax_ng.c
xml_relax_ng.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_sax_parser.c
xml_sax_parser.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_sax_parser_context.c
xml_sax_parser_context.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_sax_push_parser.c
xml_sax_push_parser.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_schema.c
xml_schema.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_syntax_error.c
xml_syntax_error.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_text.c
xml_text.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_xpath_context.c
xml_xpath_context.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xslt_stylesheet.c
xslt_stylesheet.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
../../../../ext/nokogiri/xslt_stylesheet.c(167): warning C4090: 'function': different 'const' qualifiers
linking shared-object nokogiri/nokogiri.so
   Creating library nokogiri-x64-mswin64_140.lib and object nokogiri-x64-mswin64_140.exp
cd -
mkdir -p tmp/x64-mswin64_140/stage/lib/nokogiri
cp LICENSE-DEPENDENCIES.md tmp/x64-mswin64_140/stage/LICENSE-DEPENDENCIES.md
cp LICENSE.md tmp/x64-mswin64_140/stage/LICENSE.md
cp README.md tmp/x64-mswin64_140/stage/README.md
mkdir -p tmp/x64-mswin64_140/stage/bin
cp bin/nokogiri tmp/x64-mswin64_140/stage/bin/nokogiri
cp dependencies.yml tmp/x64-mswin64_140/stage/dependencies.yml
mkdir -p tmp/x64-mswin64_140/stage/ext/nokogiri
cp ext/nokogiri/depend tmp/x64-mswin64_140/stage/ext/nokogiri/depend
cp ext/nokogiri/extconf.rb tmp/x64-mswin64_140/stage/ext/nokogiri/extconf.rb
cp ext/nokogiri/html_document.c tmp/x64-mswin64_140/stage/ext/nokogiri/html_document.c
cp ext/nokogiri/html_document.h tmp/x64-mswin64_140/stage/ext/nokogiri/html_document.h
cp ext/nokogiri/html_element_description.c tmp/x64-mswin64_140/stage/ext/nokogiri/html_element_description.c
cp ext/nokogiri/html_element_description.h tmp/x64-mswin64_140/stage/ext/nokogiri/html_element_description.h
cp ext/nokogiri/html_entity_lookup.c tmp/x64-mswin64_140/stage/ext/nokogiri/html_entity_lookup.c
cp ext/nokogiri/html_entity_lookup.h tmp/x64-mswin64_140/stage/ext/nokogiri/html_entity_lookup.h
cp ext/nokogiri/html_sax_parser_context.c tmp/x64-mswin64_140/stage/ext/nokogiri/html_sax_parser_context.c
cp ext/nokogiri/html_sax_parser_context.h tmp/x64-mswin64_140/stage/ext/nokogiri/html_sax_parser_context.h
cp ext/nokogiri/html_sax_push_parser.c tmp/x64-mswin64_140/stage/ext/nokogiri/html_sax_push_parser.c
cp ext/nokogiri/html_sax_push_parser.h tmp/x64-mswin64_140/stage/ext/nokogiri/html_sax_push_parser.h
cp ext/nokogiri/nokogiri.c tmp/x64-mswin64_140/stage/ext/nokogiri/nokogiri.c
cp ext/nokogiri/nokogiri.h tmp/x64-mswin64_140/stage/ext/nokogiri/nokogiri.h
cp ext/nokogiri/xml_attr.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_attr.c
cp ext/nokogiri/xml_attr.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_attr.h
cp ext/nokogiri/xml_attribute_decl.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_attribute_decl.c
cp ext/nokogiri/xml_attribute_decl.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_attribute_decl.h
cp ext/nokogiri/xml_cdata.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_cdata.c
cp ext/nokogiri/xml_cdata.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_cdata.h
cp ext/nokogiri/xml_comment.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_comment.c
cp ext/nokogiri/xml_comment.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_comment.h
cp ext/nokogiri/xml_document.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_document.c
cp ext/nokogiri/xml_document.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_document.h
cp ext/nokogiri/xml_document_fragment.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_document_fragment.c
cp ext/nokogiri/xml_document_fragment.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_document_fragment.h
cp ext/nokogiri/xml_dtd.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_dtd.c
cp ext/nokogiri/xml_dtd.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_dtd.h
cp ext/nokogiri/xml_element_content.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_element_content.c
cp ext/nokogiri/xml_element_content.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_element_content.h
cp ext/nokogiri/xml_element_decl.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_element_decl.c
cp ext/nokogiri/xml_element_decl.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_element_decl.h
cp ext/nokogiri/xml_encoding_handler.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_encoding_handler.c
cp ext/nokogiri/xml_encoding_handler.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_encoding_handler.h
cp ext/nokogiri/xml_entity_decl.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_entity_decl.c
cp ext/nokogiri/xml_entity_decl.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_entity_decl.h
cp ext/nokogiri/xml_entity_reference.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_entity_reference.c
cp ext/nokogiri/xml_entity_reference.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_entity_reference.h
cp ext/nokogiri/xml_io.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_io.c
cp ext/nokogiri/xml_io.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_io.h
cp ext/nokogiri/xml_libxml2_hacks.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_libxml2_hacks.c
cp ext/nokogiri/xml_libxml2_hacks.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_libxml2_hacks.h
cp ext/nokogiri/xml_namespace.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_namespace.c
cp ext/nokogiri/xml_namespace.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_namespace.h
cp ext/nokogiri/xml_node.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_node.c
cp ext/nokogiri/xml_node.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_node.h
cp ext/nokogiri/xml_node_set.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_node_set.c
cp ext/nokogiri/xml_node_set.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_node_set.h
cp ext/nokogiri/xml_processing_instruction.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_processing_instruction.c
cp ext/nokogiri/xml_processing_instruction.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_processing_instruction.h
cp ext/nokogiri/xml_reader.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_reader.c
cp ext/nokogiri/xml_reader.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_reader.h
cp ext/nokogiri/xml_relax_ng.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_relax_ng.c
cp ext/nokogiri/xml_relax_ng.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_relax_ng.h
cp ext/nokogiri/xml_sax_parser.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_sax_parser.c
cp ext/nokogiri/xml_sax_parser.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_sax_parser.h
cp ext/nokogiri/xml_sax_parser_context.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_sax_parser_context.c
cp ext/nokogiri/xml_sax_parser_context.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_sax_parser_context.h
cp ext/nokogiri/xml_sax_push_parser.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_sax_push_parser.c
cp ext/nokogiri/xml_sax_push_parser.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_sax_push_parser.h
cp ext/nokogiri/xml_schema.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_schema.c
cp ext/nokogiri/xml_schema.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_schema.h
cp ext/nokogiri/xml_syntax_error.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_syntax_error.c
cp ext/nokogiri/xml_syntax_error.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_syntax_error.h
cp ext/nokogiri/xml_text.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_text.c
cp ext/nokogiri/xml_text.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_text.h
cp ext/nokogiri/xml_xpath_context.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_xpath_context.c
cp ext/nokogiri/xml_xpath_context.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_xpath_context.h
cp ext/nokogiri/xslt_stylesheet.c tmp/x64-mswin64_140/stage/ext/nokogiri/xslt_stylesheet.c
cp ext/nokogiri/xslt_stylesheet.h tmp/x64-mswin64_140/stage/ext/nokogiri/xslt_stylesheet.h
cp lib/nokogiri.rb tmp/x64-mswin64_140/stage/lib/nokogiri.rb
cp lib/nokogiri/css.rb tmp/x64-mswin64_140/stage/lib/nokogiri/css.rb
mkdir -p tmp/x64-mswin64_140/stage/lib/nokogiri/css
cp lib/nokogiri/css/node.rb tmp/x64-mswin64_140/stage/lib/nokogiri/css/node.rb
cp lib/nokogiri/css/parser.rb tmp/x64-mswin64_140/stage/lib/nokogiri/css/parser.rb
cp lib/nokogiri/css/parser.y tmp/x64-mswin64_140/stage/lib/nokogiri/css/parser.y
cp lib/nokogiri/css/parser_extras.rb tmp/x64-mswin64_140/stage/lib/nokogiri/css/parser_extras.rb
cp lib/nokogiri/css/syntax_error.rb tmp/x64-mswin64_140/stage/lib/nokogiri/css/syntax_error.rb
cp lib/nokogiri/css/tokenizer.rb tmp/x64-mswin64_140/stage/lib/nokogiri/css/tokenizer.rb
cp lib/nokogiri/css/tokenizer.rex tmp/x64-mswin64_140/stage/lib/nokogiri/css/tokenizer.rex
cp lib/nokogiri/css/xpath_visitor.rb tmp/x64-mswin64_140/stage/lib/nokogiri/css/xpath_visitor.rb
mkdir -p tmp/x64-mswin64_140/stage/lib/nokogiri/decorators
cp lib/nokogiri/decorators/slop.rb tmp/x64-mswin64_140/stage/lib/nokogiri/decorators/slop.rb
cp lib/nokogiri/html.rb tmp/x64-mswin64_140/stage/lib/nokogiri/html.rb
mkdir -p tmp/x64-mswin64_140/stage/lib/nokogiri/html
cp lib/nokogiri/html/builder.rb tmp/x64-mswin64_140/stage/lib/nokogiri/html/builder.rb
cp lib/nokogiri/html/document.rb tmp/x64-mswin64_140/stage/lib/nokogiri/html/document.rb
cp lib/nokogiri/html/document_fragment.rb tmp/x64-mswin64_140/stage/lib/nokogiri/html/document_fragment.rb
cp lib/nokogiri/html/element_description.rb tmp/x64-mswin64_140/stage/lib/nokogiri/html/element_description.rb
cp lib/nokogiri/html/element_description_defaults.rb tmp/x64-mswin64_140/stage/lib/nokogiri/html/element_description_defaults.rb
cp lib/nokogiri/html/entity_lookup.rb tmp/x64-mswin64_140/stage/lib/nokogiri/html/entity_lookup.rb
mkdir -p tmp/x64-mswin64_140/stage/lib/nokogiri/html/sax
cp lib/nokogiri/html/sax/parser.rb tmp/x64-mswin64_140/stage/lib/nokogiri/html/sax/parser.rb
cp lib/nokogiri/html/sax/parser_context.rb tmp/x64-mswin64_140/stage/lib/nokogiri/html/sax/parser_context.rb
cp lib/nokogiri/html/sax/push_parser.rb tmp/x64-mswin64_140/stage/lib/nokogiri/html/sax/push_parser.rb
mkdir -p tmp/x64-mswin64_140/stage/lib/nokogiri/jruby
cp lib/nokogiri/jruby/dependencies.rb tmp/x64-mswin64_140/stage/lib/nokogiri/jruby/dependencies.rb
cp lib/nokogiri/syntax_error.rb tmp/x64-mswin64_140/stage/lib/nokogiri/syntax_error.rb
cp lib/nokogiri/version.rb tmp/x64-mswin64_140/stage/lib/nokogiri/version.rb
cp lib/nokogiri/xml.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml.rb
mkdir -p tmp/x64-mswin64_140/stage/lib/nokogiri/xml
cp lib/nokogiri/xml/attr.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/attr.rb
cp lib/nokogiri/xml/attribute_decl.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/attribute_decl.rb
cp lib/nokogiri/xml/builder.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/builder.rb
cp lib/nokogiri/xml/cdata.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/cdata.rb
cp lib/nokogiri/xml/character_data.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/character_data.rb
cp lib/nokogiri/xml/document.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/document.rb
cp lib/nokogiri/xml/document_fragment.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/document_fragment.rb
cp lib/nokogiri/xml/dtd.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/dtd.rb
cp lib/nokogiri/xml/element_content.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/element_content.rb
cp lib/nokogiri/xml/element_decl.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/element_decl.rb
cp lib/nokogiri/xml/entity_decl.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/entity_decl.rb
cp lib/nokogiri/xml/entity_reference.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/entity_reference.rb
cp lib/nokogiri/xml/namespace.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/namespace.rb
cp lib/nokogiri/xml/node.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/node.rb
mkdir -p tmp/x64-mswin64_140/stage/lib/nokogiri/xml/node
cp lib/nokogiri/xml/node/save_options.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/node/save_options.rb
cp lib/nokogiri/xml/node_set.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/node_set.rb
cp lib/nokogiri/xml/notation.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/notation.rb
cp lib/nokogiri/xml/parse_options.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/parse_options.rb
cp lib/nokogiri/xml/pp.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/pp.rb
mkdir -p tmp/x64-mswin64_140/stage/lib/nokogiri/xml/pp
cp lib/nokogiri/xml/pp/character_data.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/pp/character_data.rb
cp lib/nokogiri/xml/pp/node.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/pp/node.rb
cp lib/nokogiri/xml/processing_instruction.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/processing_instruction.rb
cp lib/nokogiri/xml/reader.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/reader.rb
cp lib/nokogiri/xml/relax_ng.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/relax_ng.rb
cp lib/nokogiri/xml/sax.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/sax.rb
mkdir -p tmp/x64-mswin64_140/stage/lib/nokogiri/xml/sax
cp lib/nokogiri/xml/sax/document.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/sax/document.rb
cp lib/nokogiri/xml/sax/parser.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/sax/parser.rb
cp lib/nokogiri/xml/sax/parser_context.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/sax/parser_context.rb
cp lib/nokogiri/xml/sax/push_parser.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/sax/push_parser.rb
cp lib/nokogiri/xml/schema.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/schema.rb
cp lib/nokogiri/xml/searchable.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/searchable.rb
cp lib/nokogiri/xml/syntax_error.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/syntax_error.rb
cp lib/nokogiri/xml/text.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/text.rb
cp lib/nokogiri/xml/xpath.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/xpath.rb
mkdir -p tmp/x64-mswin64_140/stage/lib/nokogiri/xml/xpath
cp lib/nokogiri/xml/xpath/syntax_error.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/xpath/syntax_error.rb
cp lib/nokogiri/xml/xpath_context.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/xpath_context.rb
cp lib/nokogiri/xslt.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xslt.rb
mkdir -p tmp/x64-mswin64_140/stage/lib/nokogiri/xslt
cp lib/nokogiri/xslt/stylesheet.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xslt/stylesheet.rb
mkdir -p tmp/x64-mswin64_140/stage/lib/xsd/xmlparser
cp lib/xsd/xmlparser/nokogiri.rb tmp/x64-mswin64_140/stage/lib/xsd/xmlparser/nokogiri.rb
install -c tmp/x64-mswin64_140/nokogiri/2.7.1/nokogiri.so lib/nokogiri/nokogiri.so
cp tmp/x64-mswin64_140/nokogiri/2.7.1/nokogiri.so tmp/x64-mswin64_140/stage/lib/nokogiri/nokogiri.so

C:\Users\preet\Projects\OpenSource\nokogiri>bundle exec rake test
rubocop lib --only Security
Inspecting 62 files
..............................................................

62 files inspected, no offenses detected
rubocop lib --auto-correct-all --only Style/FrozenStringLiteralComment
Inspecting 62 files
..............................................................

62 files inspected, no offenses detected
WARNING: Nokogiri was built against libxml version 2.9.9, but has dynamically loaded 2.9.4
WARNING: Nokogiri was built against libxslt version 1.1.33, but has dynamically loaded 1.1.32
C:/Users/preet/Projects/OpenSource/nokogiri/test/helper.rb:29: version info: {"warnings"=>["Nokogiri was built against libxml version 2.9.9, but has dynamically loaded 2.9.4", "Nokogiri was built against libxslt version 1.1.33, but has dynamically loaded 1.1.32"], "nokogiri"=>"1.11.0.rc2", "ruby"=>{"version"=>"2.7.1", "platform"=>"x64-mswin64_140", "description"=>"ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x64-mswin64_140]", "engine"=>"ruby"}, "libxml"=>{"source"=>"system", "compiled"=>"2.9.9", "loaded"=>"2.9.4"}, "libxslt"=>{"source"=>"system", "compiled"=>"1.1.33", "loaded"=>"1.1.32"}}
Run options: --seed 17625

# Running:

*******************************************************************************S***************************************************************************************F**************F***************
*******************************************************************************************************************************************************************************************************************************************S**************output error : unknown encoding EUC-JP
F*****************************************************S*************************************************WARNING: Nokogiri was built against libxml version 2.9.9, but has dynamically loaded 2.9.4
WARNING: Nokogiri was built against libxslt version 1.1.33, but has dynamically loaded 1.1.32
*WARNING: Nokogiri was built against libxml version 2.9.9, but has dynamically loaded 2.9.4
WARNING: Nokogiri was built against libxslt version 1.1.33, but has dynamically loaded 1.1.32
*WARNING: Nokogiri was built against libxml version 2.9.9, but has dynamically loaded 2.9.4
WARNING: Nokogiri was built against libxslt version 1.1.33, but has dynamically loaded 1.1.32
*WARNING: Nokogiri was built against libxml version 2.9.9, but has dynamically loaded 2.9.4
WARNING: Nokogiri was built against libxslt version 1.1.33, but has dynamically loaded 1.1.32
SWARNING: Nokogiri was built against libxml version 2.9.9, but has dynamically loaded 2.9.4
WARNING: Nokogiri was built against libxslt version 1.1.33, but has dynamically loaded 1.1.32
S***output error : unknown encoding Shift_JIS
output error : unknown encoding Shift_JIS
output error : unknown encoding Shift_JIS
output error : unknown encoding Shift_JIS
*****output error : unknown encoding Shift_JIS
F********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************E*F*******************************************************************************************************************************S******************************************************EE**output error : unknown encoding Shift_JIS
F*************************************************************S**********************************************************************************************************************************************************S*********SS********************************************************************************************************EEEE**************E******

Fabulous run in 17.480190s, 86.7840 runs/s, 240.5008 assertions/s.

  1) Failure:
Nokogiri::HTML::TestDocumentFragment#test_inspect_encoding [C:/Users/preet/Projects/OpenSource/nokogiri/test/html/test_document_fragment.rb:21]:
--- expected
+++ actual
@@ -1 +1,3 @@
-"こんにちは!"
+# encoding: UTF-8
+#    valid: false
+"ij\xA4ó¤Ë¤Á¤Ï¡ª"


  2) Failure:
Nokogiri::HTML::TestDocumentFragment#test_html_parse_encoding [C:/Users/preet/Projects/OpenSource/nokogiri/test/html/test_document_fragment.rb:28]:
--- expected
+++ actual
@@ -1 +1,3 @@
-"こんにちは!"
+# encoding: UTF-8
+#    valid: false
+"ij\xA4ó¤Ë¤Á¤Ï¡ª"


  3) Failure:
Nokogiri::XML::TestDocument#test_encoding= [C:/Users/preet/Projects/OpenSource/nokogiri/test/xml/test_document.rb:530]:
Expected /EUC\-JP/ to match # encoding: EUC-JP
#    valid: true
"".

  4) Failure:
Nokogiri::HTML::TestNodeEncoding#test_inner_html [C:/Users/preet/Projects/OpenSource/nokogiri/test/html/test_node_encoding.rb:62]:
Expected /\x{82B1}\x{82F1}\x{82C9}\x{82BF}\x{82CD}/ to match # encoding: Shift_JIS
#    valid: true
"".

  5) Error:
Nokogiri::HTML::TestDocumentEncodingDetection#test_document_xhtml_enc:
Nokogiri::XML::SyntaxError: 1:41: FATAL: Unsupported encoding Shift_JIS
    C:/Users/preet/Projects/OpenSource/nokogiri/lib/nokogiri/xml/document.rb:63:in `read_memory'
    C:/Users/preet/Projects/OpenSource/nokogiri/lib/nokogiri/xml/document.rb:63:in `parse'
    C:/Users/preet/Projects/OpenSource/nokogiri/lib/nokogiri/xml.rb:36:in `XML'
    C:/Users/preet/Projects/OpenSource/nokogiri/lib/nokogiri/html/document.rb:259:in `detect_encoding'
    C:/Users/preet/Projects/OpenSource/nokogiri/lib/nokogiri/html/document.rb:204:in `parse'
    C:/Users/preet/Projects/OpenSource/nokogiri/lib/nokogiri/html.rb:16:in `HTML'
    C:/Users/preet/Projects/OpenSource/nokogiri/test/html/test_document_encoding.rb:117:in `block in test_document_xhtml_enc'
    C:/Users/preet/Projects/OpenSource/nokogiri/test/html/test_document_encoding.rb:113:in `each'
    C:/Users/preet/Projects/OpenSource/nokogiri/test/html/test_document_encoding.rb:113:in `test_document_xhtml_enc'

  6) Failure:
Nokogiri::HTML::TestDocumentEncodingDetection#test_document_html_charset [C:/Users/preet/Projects/OpenSource/nokogiri/test/html/test_document_encoding.rb:109]:
Expected: "たこ焼き仮面"
  Actual: "$B$?$3>F$-2>LL(B"

  7) Error:
Nokogiri::HTML::TestDocumentEncoding#test_encoding_non_utf8:
Encoding::InvalidByteSequenceError: "\x93" on UTF-8
    C:/Users/preet/Projects/OpenSource/nokogiri/test/html/test_document_encoding.rb:62:in `encode'
    C:/Users/preet/Projects/OpenSource/nokogiri/test/html/test_document_encoding.rb:62:in `block in test_encoding_non_utf8'
    C:/Users/preet/Projects/OpenSource/nokogiri/test/html/test_document_encoding.rb:53:in `each'
    C:/Users/preet/Projects/OpenSource/nokogiri/test/html/test_document_encoding.rb:53:in `test_encoding_non_utf8'

  8) Error:
Nokogiri::HTML::TestDocumentEncoding#test_encoding_without_charset:
ArgumentError: invalid byte sequence in UTF-8
    C:/Users/preet/Projects/OpenSource/nokogiri/test/html/test_document_encoding.rb:26:in `test_encoding_without_charset'

  9) Failure:
Nokogiri::HTML::TestDocumentEncoding#test_encoding [C:/Users/preet/Projects/OpenSource/nokogiri/test/html/test_document_encoding.rb:12]:
Expected /Shift_JIS/ to match # encoding: Shift_JIS
#    valid: true
"".

 10) Error:
Nokogiri::XML::TestDocumentEncoding#test_encoding:
Nokogiri::XML::SyntaxError: 1:41: FATAL: Unsupported encoding Shift_JIS
    C:/Users/preet/Projects/OpenSource/nokogiri/lib/nokogiri/xml/document.rb:63:in `read_memory'
    C:/Users/preet/Projects/OpenSource/nokogiri/lib/nokogiri/xml/document.rb:63:in `parse'
    C:/Users/preet/Projects/OpenSource/nokogiri/lib/nokogiri/xml.rb:36:in `XML'
    C:/Users/preet/Projects/OpenSource/nokogiri/test/xml/test_document_encoding.rb:8:in `setup'

 11) Error:
Nokogiri::XML::TestDocumentEncoding#test_url:
Nokogiri::XML::SyntaxError: 1:41: FATAL: Unsupported encoding Shift_JIS
    C:/Users/preet/Projects/OpenSource/nokogiri/lib/nokogiri/xml/document.rb:63:in `read_memory'
    C:/Users/preet/Projects/OpenSource/nokogiri/lib/nokogiri/xml/document.rb:63:in `parse'
    C:/Users/preet/Projects/OpenSource/nokogiri/lib/nokogiri/xml.rb:36:in `XML'
    C:/Users/preet/Projects/OpenSource/nokogiri/test/xml/test_document_encoding.rb:8:in `setup'

 12) Error:
Nokogiri::XML::TestDocumentEncoding#test_dotted_version:
Nokogiri::XML::SyntaxError: 1:41: FATAL: Unsupported encoding Shift_JIS
    C:/Users/preet/Projects/OpenSource/nokogiri/lib/nokogiri/xml/document.rb:63:in `read_memory'
    C:/Users/preet/Projects/OpenSource/nokogiri/lib/nokogiri/xml/document.rb:63:in `parse'
    C:/Users/preet/Projects/OpenSource/nokogiri/lib/nokogiri/xml.rb:36:in `XML'
    C:/Users/preet/Projects/OpenSource/nokogiri/test/xml/test_document_encoding.rb:8:in `setup'

 13) Error:
Nokogiri::XML::TestDocumentEncoding#test_empty_doc_encoding:
Nokogiri::XML::SyntaxError: 1:41: FATAL: Unsupported encoding Shift_JIS
    C:/Users/preet/Projects/OpenSource/nokogiri/lib/nokogiri/xml/document.rb:63:in `read_memory'
    C:/Users/preet/Projects/OpenSource/nokogiri/lib/nokogiri/xml/document.rb:63:in `parse'
    C:/Users/preet/Projects/OpenSource/nokogiri/lib/nokogiri/xml.rb:36:in `XML'
    C:/Users/preet/Projects/OpenSource/nokogiri/test/xml/test_document_encoding.rb:8:in `setup'

 14) Error:
Nokogiri::XML::TestNodeEncoding#test_serialize_encoding_xml:
Nokogiri::XML::SyntaxError: 1:41: FATAL: Unsupported encoding Shift_JIS
    C:/Users/preet/Projects/OpenSource/nokogiri/lib/nokogiri/xml/document.rb:60:in `read_io'
    C:/Users/preet/Projects/OpenSource/nokogiri/lib/nokogiri/xml/document.rb:60:in `parse'
    C:/Users/preet/Projects/OpenSource/nokogiri/lib/nokogiri/xml.rb:36:in `XML'
    C:/Users/preet/Projects/OpenSource/nokogiri/test/xml/test_node_encoding.rb:8:in `test_serialize_encoding_xml'

1517 runs, 4204 assertions, 6 failures, 8 errors, 10 skips

You have skipped tests. Run with --verbose for details.
Coverage report generated for Minitest to C:/Users/preet/Projects/OpenSource/nokogiri/coverage. 2263 / 2396 LOC (94.45%) covered.
rake aborted!
Command failed with status (1): [C:/ruby/mswin64/ruby-2.7.1/bin/ruby.exe -I...]

Tasks: TOP => test
(See full trace by running task with --trace)

C:\Users\preet\Projects\OpenSource\nokogiri>ruby -v
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x64-mswin64_140]

@preetpalS
Copy link
Author

@flavorjones This library cannot compile as-is when using Ruby compiled with the Visual C++ compiler. It's kind of a pain to install so here is some proof that these changes fix actual compilation errors:

Log of compilation failures when not using these changes (first without using system libraries, then when using system libraries)

C:\Users\preet\Projects\OpenSource\upstream>git clone https://github.com/sparklemotion/nokogiri.git
Cloning into 'nokogiri'...
remote: Enumerating objects: 25, done.
remote: Counting objects: 100% (25/25), done.
remote: Compressing objects: 100% (22/22), done.
remote: Total 32790 (delta 6), reused 11 (delta 3), pack-reused 32765
Receiving objects: 100% (32790/32790), 13.74 MiB | 4.30 MiB/s, done.
Resolving deltas: 100% (22136/22136), done.

C:\Users\preet\Projects\OpenSource\upstream>cd nokogiri

C:\Users\preet\Projects\OpenSource\upstream\nokogiri>bundle
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Using rake 13.0.1
Using ast 2.4.1
Using bundler 2.1.4
Using sync 0.5.0
Using tins 1.25.0
Using term-ansicolor 1.7.1
Using concourse 0.33.0
Using docile 1.3.2
Using hoe 3.22.1
Using hoe-bundler 1.5.0
Using hoe-debugging 2.0.0
Using hoe-gemspec 1.0.0
Using hoe-git 1.6.0
Using hoe-markdown 1.2.0
Using mini_portile2 2.5.0
Using minitest 5.14.1
Using parallel 1.19.2
Using parser 2.7.1.4
Using racc 1.4.16
Using rainbow 3.0.0
Using rake-compiler 1.1.1
Using rake-compiler-dock 1.0.1
Using rdoc 6.2.1
Using regexp_parser 1.7.1
Using rexical 1.0.7
Using rexml 3.2.4
Using rubocop-ast 0.3.0
Using ruby-progressbar 1.10.1
Using unicode-display_width 1.7.0
Fetching rubocop 0.89.1
Installing rubocop 0.89.1
Using simplecov-html 0.12.2
Using simplecov 0.18.5
Bundle complete! 17 Gemfile dependencies, 32 gems now installed.
Use bundle info [gemname] to see where a bundled gem is installed.

C:\Users\preet\Projects\OpenSource\upstream\nokogiri>bundle exec rake compile
mkdir -p tmp/x64-mswin64_140/nokogiri/2.7.1
cd tmp/x64-mswin64_140/nokogiri/2.7.1
C:/ruby/mswin64/ruby-2.7.1/bin/ruby.exe -I. ../../../../ext/nokogiri/extconf.rb
checking if the C compiler accepts ... no
Building nokogiri using packaged libraries.
Using mini_portile version 2.5.0


IMPORTANT NOTICE:

Building Nokogiri with a packaged version of zlib-1.2.11.

Team Nokogiri will keep on doing their best to provide security
updates in a timely manner, but if this is a concern for you and want
to use the system library instead; abort this installation process and
reinstall nokogiri as follows:

gem install nokogiri -- --use-system-libraries
    [--with-xml2-config=/path/to/xml2-config]
    [--with-xslt-config=/path/to/xslt-config]

If you are using Bundler, tell it to use the option:

bundle config build.nokogiri --use-system-libraries
bundle install

Downloading zlib-1.2.11.tar.gz (100%)
Extracting zlib-1.2.11.tar.gz into tmp/x64-mswin64_140/ports/zlib/1.2.11... OK
Running 'compile' for zlib 1.2.11... OK
Running 'install' for zlib 1.2.11... OK
Activating zlib 1.2.11 (from C:/Users/preet/Projects/OpenSource/upstream/nokogiri/ports/x64-mswin64_140/zlib/1.2.11)...


IMPORTANT NOTICE:

Building Nokogiri with a packaged version of libiconv-1.15.

Team Nokogiri will keep on doing their best to provide security
updates in a timely manner, but if this is a concern for you and want
to use the system library instead; abort this installation process and
reinstall nokogiri as follows:

gem install nokogiri -- --use-system-libraries
    [--with-xml2-config=/path/to/xml2-config]
    [--with-xslt-config=/path/to/xslt-config]

If you are using Bundler, tell it to use the option:

bundle config build.nokogiri --use-system-libraries
bundle install

Downloading libiconv-1.15.tar.gz (100%)
Extracting libiconv-1.15.tar.gz into tmp/x64-mswin64_140/ports/libiconv/1.15... OK
Running 'configure' for libiconv 1.15... ERROR, review 'C:/Users/preet/Projects/OpenSource/upstream/nokogiri/tmp/x64-mswin64_140/nokogiri/2.7.1/tmp/x64-mswin64_140/ports/libiconv/1.15/configure.log' to see what happened. Last lines are:

checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make sets $(MAKE)... (cached) yes
checking for x64-mswin64_140-gcc... cl -nologo
checking whether the C compiler works... yes
checking for C compiler default output file name... conftest.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... obj
checking whether we are using the GNU C compiler... no
checking whether cl -nologo accepts -g... no
checking for cl -nologo option to accept ISO C89... none needed
checking whether cl -nologo understands -c and -o together... no
checking for style of include used by make... GNU
checking dependency style of /c/Users/preet/Projects/OpenSource/upstream/nokogiri/tmp/x64-mswin64_140/nokogiri/2.7.1/tmp/x64-mswin64_140/ports/libiconv/1.15/libiconv-1.15/build-aux/compile cl -nologo... none
checking how to run the C preprocessor... /c/Users/preet/Projects/OpenSource/upstream/nokogiri/tmp/x64-mswin64_140/nokogiri/2.7.1/tmp/x64-mswin64_140/ports/libiconv/1.15/libiconv-1.15/build-aux/compile cl -nologo -E
checking for strip... /mingw64/bin/strip
checking build system type... x86_64-pc-msys
checking host system type... Invalid configuration x64-mswin64_140': machine x64' not recognized
configure: error: /bin/sh build-aux/config.sub x64-mswin64_140 failed

*** ../../../../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
--srcdir=../../../../ext/nokogiri
--curdir
--ruby=C:/ruby/mswin64/ruby-2.7.1/bin/ruby
--help
--clean
--use-system-libraries
--enable-static
--disable-static
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--enable-cross-build
--disable-cross-build
Traceback (most recent call last):
12: from ../../../../ext/nokogiri/extconf.rb:535:in <main>' 11: from ../../../../ext/nokogiri/extconf.rb:266:in process_recipe'
10: from ../../../../ext/nokogiri/extconf.rb:266:in tap' 9: from ../../../../ext/nokogiri/extconf.rb:368:in block in process_recipe'
8: from ../../../../ext/nokogiri/extconf.rb:260:in chdir_for_build' 7: from ../../../../ext/nokogiri/extconf.rb:260:in chdir'
6: from ../../../../ext/nokogiri/extconf.rb:261:in block in chdir_for_build' 5: from ../../../../ext/nokogiri/extconf.rb:369:in block (2 levels) in process_recipe'
4: from C:/ruby/mswin64/ruby-2.7.1/lib/ruby/gems/2.7.0/gems/mini_portile2-2.5.0/lib/mini_portile2/mini_portile.rb:153:in cook' 3: from C:/ruby/mswin64/ruby-2.7.1/lib/ruby/gems/2.7.0/gems/mini_portile2-2.5.0/lib/mini_portile2/mini_portile.rb:108:in configure'
2: from C:/ruby/mswin64/ruby-2.7.1/lib/ruby/gems/2.7.0/gems/mini_portile2-2.5.0/lib/mini_portile2/mini_portile.rb:376:in execute' 1: from C:/ruby/mswin64/ruby-2.7.1/lib/ruby/gems/2.7.0/gems/mini_portile2-2.5.0/lib/mini_portile2/mini_portile.rb:376:in chdir'
C:/ruby/mswin64/ruby-2.7.1/lib/ruby/gems/2.7.0/gems/mini_portile2-2.5.0/lib/mini_portile2/mini_portile.rb:405:in `block in execute': Failed to complete configure task (RuntimeError)
rake aborted!
Command failed with status (1): [C:/ruby/mswin64/ruby-2.7.1/bin/ruby.exe -I...]

Tasks: TOP => compile => compile:x64-mswin64_140 => compile:nokogiri:x64-mswin64_140 => copy:nokogiri:x64-mswin64_140:2.7.1 => tmp/x64-mswin64_140/nokogiri/2.7.1/nokogiri.so => tmp/x64-mswin64_140/nokogiri/2.7.1/Makefile
(See full trace by running task with --trace)

C:\Users\preet\Projects\OpenSource\upstream\nokogiri>bundle exec rake compile -- --use-system-libraries
cd tmp/x64-mswin64_140/nokogiri/2.7.1
C:/ruby/mswin64/ruby-2.7.1/bin/ruby.exe -I. ../../../../ext/nokogiri/extconf.rb -- --use-system-libraries
checking if the C compiler accepts ... no
Building nokogiri using system libraries.
pkg-config could not be used to find libxml-2.0
Please install either pkg-config or the pkg-config gem per

gem install pkg-config -v "~> 1.1"

pkg-config could not be used to find libxslt
Please install either pkg-config or the pkg-config gem per

gem install pkg-config -v "~> 1.1"

pkg-config could not be used to find libexslt
Please install either pkg-config or the pkg-config gem per

gem install pkg-config -v "~> 1.1"

checking for xmlParseDoc() in libxml/parser.h... no
checking for xmlParseDoc() in xml2.lib... no
checking for xmlParseDoc() in libxml2.lib... yes
checking for xsltParseStylesheetDoc() in libxslt/xslt.h... no
checking for xsltParseStylesheetDoc() in xslt.lib... no
checking for xsltParseStylesheetDoc() in libxslt.lib... yes
checking for exsltFuncRegister() in libexslt/exslt.h... no
checking for exsltFuncRegister() in exslt.lib... no
checking for exsltFuncRegister() in libexslt.lib... yes
checking for xmlHasFeature()... yes
checking for xmlFirstElementChild()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetValidStructuredErrors()... yes
checking for xmlSchemaSetValidStructuredErrors()... yes
checking for xmlSchemaSetParserStructuredErrors()... yes
creating Makefile
cd -
cd tmp/x64-mswin64_140/nokogiri/2.7.1
nmake

Microsoft (R) Program Maintenance Utility Version 14.26.28805.0
Copyright (C) Microsoft Corporation. All rights reserved.

generating nokogiri-x64-mswin64_140.def
compiling ../../../../ext/nokogiri/html_document.c
html_document.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/html_element_description.c
html_element_description.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/html_entity_lookup.c
html_entity_lookup.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/html_sax_parser_context.c
html_sax_parser_context.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/html_sax_push_parser.c
html_sax_push_parser.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/nokogiri.c
nokogiri.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_attr.c
xml_attr.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_attribute_decl.c
xml_attribute_decl.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_cdata.c
xml_cdata.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_comment.c
xml_comment.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_document.c
xml_document.c
C:\ruby\mswin64\ruby-2.7.1\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
../../../../ext/nokogiri/xml_document.c(58): error C4028: formal parameter 1 different from declaration
../../../../ext/nokogiri/xml_document.c(58): error C4028: formal parameter 2 different from declaration
../../../../ext/nokogiri/xml_document.c(58): error C4028: formal parameter 3 different from declaration
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX64\x64\cl.EXE"' : return code '0x2'
Stop.
rake aborted!
Command failed with status (2): [nmake...]

Tasks: TOP => compile => compile:x64-mswin64_140 => compile:nokogiri:x64-mswin64_140 => copy:nokogiri:x64-mswin64_140:2.7.1 => tmp/x64-mswin64_140/nokogiri/2.7.1/nokogiri.so
(See full trace by running task with --trace)

C:\Users\preet\Projects\OpenSource\upstream\nokogiri>

@larskanis
Copy link
Member

@preetpalS Thanks for all the logs! They give some more insight what's happening.

Since the changes are non-obvious it's a good practice to copy+paste the error message of the particular compiler into the commit message like so: 368b354 This provides a direct relationship between the patch and the error it tries to fix.

Regarding the test failures there is a serious encoding issue. I'm not sure where it comes from but it looks somehow like the Ruby build is broken in this regard.

@preetpalS
Copy link
Author

@larskanis Thanks for the tip, I should have done that for these commits, it would have made things more clear.

The Ruby build I am using is broken (some more information on the what and why of this Ruby build and a log of running Ruby test suite with it).

My usage of this Ruby build is mainly experimental. I was able to run a hello world Sinatra web app with the Puma web server (native gem) without any issues. I even got Rails working (I had to modify this gem along with the bcrypt gem; also bypassed the bootsnap gem; removed some ERB from a yaml file) but I ran into issues with the pg gem (I am guessing the SQLite3 adapter would compile though).

The reason why I wanted to try this out was to see if I could use any of the CUDA-related gems on Windows. From what I understand, you need to use the Visual C++ compiler to work with CUDA on Windows.

C:\ruby\builds\ruby-2.7.1\build>nmake check

Microsoft (R) Program Maintenance Utility Version 14.26.28805.0
Copyright (C) Microsoft Corporation.  All rights reserved.

        BASERUBY = C:\RUBY27~1\bin\ruby.exe
        CC = cl -nologo
        LD = cl -nologo
        LDSHARED = cl -nologo -LD
        CFLAGS = -MD -Zi -W2 -wd4100 -wd4127 -wd4210 -wd4214 -wd4255 -wd4574  -wd4668 -wd4710 -wd4711 -wd4820 -wd4996  -we4028 -we4142 -we4047 -O2sy- -Zm600
        XCFLAGS = -DRUBY_EXPORT -I. -I.ext/include/x64-mswin64_140 -I../include -I.. -I../enc/unicode/12.1.0  -DCANONICALIZATION_FOR_MATHN
        CPPFLAGS =  -D_WIN32_WINNT=0x0600
        DLDFLAGS = -incremental:no -debug -opt:ref -opt:icf -dll
        SOLIBS =
        LANG =
        LC_ALL =
        LC_CTYPE =
        MFLAGS = -l
../revision.h unchanged
generating enc.mk
making srcs under enc
generating transdb.h
transdb.h unchanged
generating makefiles ext/configure-ext.mk
ext/configure-ext.mk unchanged
generating makefile exts.mk
exts.mk unchanged
'ruby.exe' is up-to-date
'rubyw.exe' is up-to-date
*** Following extensions are not compiled:
dbm:
"       Could not be configured. It will not be installed."
"       Check ext/dbm/mkmf.log for more details."
gdbm:
"       Could not be configured. It will not be installed."
"       Check ext/gdbm/mkmf.log for more details."
*** Fix the problems, then remove these directories and try again if you want.
making enc
making trans
making encs
Fiber count: 10000 (skipping)
Thread count: 10000 (skipping)
PASS all 1409 tests
         .\ruby.exe -I../lib -I".ext/x64-mswin64_140" -I. "../tool/runruby.rb" --extout=".ext"  -- --disable-gems "../bootstraptest/runner.rb" --ruby="ruby.exe --disable-gems"   ../KNOWNBUGS.rb
2020-08-13 17:45:40 -0700
Driver is ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x64-mswin64_140]
Target is ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x64-mswin64_140]

KNOWNBUGS.rb  PASS 0
No tests, no problem

test succeeded
Run options: "--ruby=.\\ruby.exe -I../lib -I.ext/x64-mswin64_140 -I. ../tool/runruby.rb --extout=.ext -- --disable-gems"

# Running tests:

[107/229] TestMiniTestUnitTestCase#test_assert_equal_different_collection_hash_hex_invisible = 0.00 s
  1) Failure:
TestMiniTestUnitTestCase#test_assert_equal_different_collection_hash_hex_invisible [C:/ruby/builds/ruby-2.7.1/tool/test/minitest/test_minitest_unit.rb:755]:
Expected: "No visible difference in the Hash#inspect output.\nYou should look at the implementation of #== on Hash or its members.\n{1=>#<Object:0xXXXXXX>}"
  Actual: "Expected: {1=>#<Object:0x0000020553b90d70>}\n  Actual: {1=>#<Object:0x0000020553b90c80>}"

[112/229] TestMiniTestUnitTestCase#test_assert_equal_different_escaped_newline = 0.00 s
  2) Failure:
TestMiniTestUnitTestCase#test_assert_equal_different_escaped_newline [C:/ruby/builds/ruby-2.7.1/tool/test/minitest/test_minitest_unit.rb:873]:
Expected: "--- expected\n+++ actual\n@@ -1,2 +1,2 @@\n \"xxx\n-a\\\\nb\"\n+a\\\\nc\"\n"
  Actual: "Expected: \"xxx\\na\\\\nb\"\n  Actual: \"xxx\\na\\\\nc\""

[117/229] TestMiniTestUnitTestCase#test_assert_equal_different_collection_array_hex_invisible = 0.01 s
  3) Failure:
TestMiniTestUnitTestCase#test_assert_equal_different_collection_array_hex_invisible [C:/ruby/builds/ruby-2.7.1/tool/test/minitest/test_minitest_unit.rb:742]:
Expected: "No visible difference in the Array#inspect output.\nYou should look at the implementation of #== on Array or its members.\n[#<Object:0xXXXXXX>]"
  Actual: "Expected: [#<Object:0x0000020553ccc7c0>]\n  Actual: [#<Object:0x0000020553ccc680>]"

[147/229] TestMiniTestUnitTestCase#test_assert_equal_different_long_invisible = 0.01 s
  4) Failure:
TestMiniTestUnitTestCase#test_assert_equal_different_long_invisible [C:/ruby/builds/ruby-2.7.1/tool/test/minitest/test_minitest_unit.rb:826]:
Expected: "No visible difference in the String#inspect output.\nYou should look at the implementation of #== on String or its members.\n\"blahblahblahblahblahblahblahblahblahblah\""
  Actual: "Expected: \"blahblahblahblahblahblahblahblahblahblah\"\n  Actual: \"blahblahblahblahblahblahblahblahblahblah\""

[154/229] TestMiniTestUnitTestCase#test_assert_equal_different_hex = 0.00 s
  5) Failure:
TestMiniTestUnitTestCase#test_assert_equal_different_hex [C:/ruby/builds/ruby-2.7.1/tool/test/minitest/test_minitest_unit.rb:787]:
Expected: "--- expected\n+++ actual\n@@ -1 +1 @@\n-#<#<Class:0xXXXXXX>:0xXXXXXX @name=\"a\">\n+#<#<Class:0xXXXXXX>:0xXXXXXX @name=\"b\">\n"
  Actual: "Expected: #<#<Class:0x0000020552e79128>:0x0000020552e79308 @name=\"a\">\n  Actual: #<#<Class:0x0000020552e79128>:0x0000020552e7b1f8 @name=\"b\">"

[168/229] TestMiniTestUnitTestCase#test_assert_equal_different_long = 0.00 s
  6) Failure:
TestMiniTestUnitTestCase#test_assert_equal_different_long [C:/ruby/builds/ruby-2.7.1/tool/test/minitest/test_minitest_unit.rb:813]:
Expected: "--- expected\n+++ actual\n@@ -1 +1 @@\n-\"hahahahahahahahahahahahahahahahahahahaha\"\n+\"blahblahblahblahblahblahblahblahblahblah\"\n"
  Actual: "Expected: \"hahahahahahahahahahahahahahahahahahahaha\"\n  Actual: \"blahblahblahblahblahblahblahblahblahblah\""

[185/229] TestMiniTestUnitTestCase#test_assert_equal_different_hex_invisible = 0.00 s
  7) Failure:
TestMiniTestUnitTestCase#test_assert_equal_different_hex_invisible [C:/ruby/builds/ruby-2.7.1/tool/test/minitest/test_minitest_unit.rb:800]:
Expected: "No visible difference in the Object#inspect output.\nYou should look at the implementation of #== on Object or its members.\n#<Object:0xXXXXXX>"
  Actual: "Expected: #<Object:0x0000020553b936b0>\n  Actual: #<Object:0x0000020553b93660>"

[191/229] TestMiniTestUnitTestCase#test_assert_equal_different_short_multiline = 0.00 s
  8) Failure:
TestMiniTestUnitTestCase#test_assert_equal_different_short_multiline [C:/ruby/builds/ruby-2.7.1/tool/test/minitest/test_minitest_unit.rb:866]:
Expected: "--- expected\n+++ actual\n@@ -1,2 +1,2 @@\n \"a\n-b\"\n+c\"\n"
  Actual: "Expected: \"a\\nb\"\n  Actual: \"a\\nc\""

[200/229] TestMiniTestUnitTestCase#test_assert_equal_different_long_msg = 0.00 s
  9) Failure:
TestMiniTestUnitTestCase#test_assert_equal_different_long_msg [C:/ruby/builds/ruby-2.7.1/tool/test/minitest/test_minitest_unit.rb:845]:
Expected: "message.\n--- expected\n+++ actual\n@@ -1 +1 @@\n-\"hahahahahahahahahahahahahahahahahahahaha\"\n+\"blahblahblahblahblahblahblahblahblahblah\"\n"
  Actual: "message.\nExpected: \"hahahahahahahahahahahahahahahahahahahaha\"\n  Actual: \"blahblahblahblahblahblahblahblahblahblah\""

Finished tests in 10.423830s, 21.9689 tests/s, 47.9670 assertions/s.
229 tests, 500 assertions, 9 failures, 0 errors, 0 skips

ruby -v: ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x64-mswin64_140]
NMAKE : fatal error U1077: '.\ruby.exe' : return code '0x9'
Stop.

C:\ruby\builds\ruby-2.7.1\build>

I am not sure if these commits should be accepted (I do not have much experience with C programming). If these changes do not do any harm, please consider them so that Nokogiri can be compiled when using a Ruby build that uses Visual C++ as its C compiler. If there is harm caused by these changes, maybe there is an opportunity to add a test to the test suite that could detect that harm.

@flavorjones
Copy link
Member

@preetpalS Thanks for the additional context. I don't have any philosophical objections to merging a change like this to ensure we can compile on your platform; but I'd like to ask that you please include the error message in the commit message, as Lars asked, particularly because we don't have automated testing set up for a Visual C++ compiler environment.

Error was as follows:

compiling ../../../../ext/nokogiri/xml_document.c
xml_document.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
../../../../ext/nokogiri/xml_document.c(58): error C4028: formal parameter 1 different from declaration
../../../../ext/nokogiri/xml_document.c(58): error C4028: formal parameter 2 different from declaration
../../../../ext/nokogiri/xml_document.c(58): error C4028: formal parameter 3 different from declaration
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\cl.EXE"' : return code '0x2'
Stop.
rake aborted!
Command failed with status (2): [nmake...]
Error was as follows:

compiling ../../../../ext/nokogiri/xml_io.c
xml_io.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
../../../../ext/nokogiri/xml_io.c(20): error C4028: formal parameter 1 different from declaration
../../../../ext/nokogiri/xml_io.c(20): warning C4113: 'VALUE (__cdecl *)(void)' differs in parameter lists from 'VALUE (__cdecl *)(VALUE,VALUE)'
../../../../ext/nokogiri/xml_io.c(47): error C4028: formal parameter 1 different from declaration
../../../../ext/nokogiri/xml_io.c(47): warning C4113: 'VALUE (__cdecl *)(void)' differs in parameter lists from 'VALUE (__cdecl *)(VALUE,VALUE)'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\cl.EXE"' : return code '0x2'
Stop.
rake aborted!
Command failed with status (2): [nmake...]
@AppVeyorBot
Copy link

@flavorjones
Copy link
Member

I'm going to merge @larskanis's PR #2068 as I prefer that approach. Thank you so much for putting in the time to report this and to submit a proposed patch! I appreciate your efforts.

flavorjones added a commit that referenced this pull request Aug 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants