Hello,
I tried to install the nokogiri Ruby gem today with a freshly installed Cygwin
(and cygwin's ruby). Unfortunately, compilation of the native extension module
fails with errors like:
nokogiri.c:103:3: error: stray '\' in program
rb_const_set(mNokogiri, rb_intern("NOKOGIRI_LIBXSLT_PATCHES"),
rb_str_split(NOKOGIRI_STR_NEW2(NOKOGIRI_LIBXSLT_PATCHES), " "));
I suspected that this had something to do with the gcc command defined in the
Makefile, which includes backslashes to escape quotes in -D values like this:
-DNOKOGIRI_LIBXML2_PATH\=\"/home/.../2.9.2\"
But here is the strange thing: if I copy the exact command displayed by make
and run it directly in bash, it works flawlessly! I am completely puzzled. Is
this some difference in how make and bash are interpreting escape sequences?
Seems like a bug to me. The versions of make and bash are the most current as
of today, i.e. GNU make 4.1 and bash 4.3.33.
For reference, this is the complete command:
gcc -I. -I/usr/include/ruby-2.0.0 -I/usr/include/ruby-2.0.0/ruby/backward
-I/usr/include/ruby-2.0.0 -I. -DHAVE_XMLPARSEDOC -DHAVE_XSLTPARSESTYLESHEETDOC
-DHAVE_EXSLTFUNCREGISTER -DHAVE_XMLHASFEATURE -DHAVE_XMLFIRSTELEMENTCHILD
-DHAVE_XMLRELAXNGSETPARSERSTRUCTUREDERRORS
-DHAVE_XMLRELAXNGSETPARSERSTRUCTUREDERRORS
-DHAVE_XMLRELAXNGSETVALIDSTRUCTUREDERRORS
-DHAVE_XMLSCHEMASETVALIDSTRUCTUREDERRORS
-DHAVE_XMLSCHEMASETPARSERSTRUCTUREDERRORS
-I/home/Denis/.gem/ruby/gems/nokogiri-1.6.6.2/ports/x86_64-unknown-cygwin/libxslt/1.1.28/include
-I/home/Denis/.gem/ruby/gems/nokogiri-1.6.6.2/ports/x86_64-unknown-cygwin/libxml2/2.9.2/include/libxml2
-DLIBXML_STATIC
-I/home/Denis/.gem/ruby/gems/nokogiri-1.6.6.2/ports/x86_64-unknown-cygwin/libxml2/2.9.2/include/libxml2
-DLIBXML_STATIC
-DNOKOGIRI_LIBXML2_PATH\=\"/home/Denis/.gem/ruby/gems/nokogiri-1.6.6.2/ports/x86_64-unknown-cygwin/libxml2/2.9.2\"
-DNOKOGIRI_LIBXML2_PATCHES\=\"0001-Revert-Missing-initialization-for-the-catalog-module.patch\
0002-Fix-missing-entities-after-CVE-2014-3660-fix.patch\"
-DNOKOGIRI_LIBXSLT_PATH\=\"/home/Denis/.gem/ruby/gems/nokogiri-1.6.6.2/ports/x86_64-unknown-cygwin/libxslt/1.1.28\"
-DNOKOGIRI_LIBXSLT_PATCHES\=\"0001-Adding-doc-update-related-to-1.1.28.patch\
0002-Fix-a-couple-of-places-where-f-printf-parameters-wer.patch\
0003-Initialize-pseudo-random-number-generator-with-curre.patch\
0004-EXSLT-function-str-replace-is-broken-as-is.patch\
0006-Fix-str-padding-to-work-with-UTF-8-strings.patch\
0007-Separate-function-for-predicate-matching-in-patterns.patch\
0008-Fix-direct-pattern-matching.patch\
0009-Fix-certain-patterns-with-predicates.patch\
0010-Fix-handling-of-UTF-8-strings-in-EXSLT-crypto-module.patch\
0013-Memory-leak-in-xsltCompileIdKeyPattern-error-path.patch\
0014-Fix-for-bug-436589.patch\ 0015-Fix-mkdir-for-mingw.patch\" -ggdb -O2
-pipe -Wimplicit-function-declaration-g -DXP_UNIX -Wall -Wcast-qual
-Wwrite-strings -Wconversion -Wmissing-noreturn -Winline
-DNOKOGIRI_USE_PACKAGED_LIBRARIES -o nokogiri.o -c nokogiri.c
Regards,
Denis Washington
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple