Tracks 2.1 installation fails on Ubuntu 12.10 with "-Werror=format-security" errors on nokogiri and mongrel gems
My Tracks 2.1 installation that was working on Ubuntu 12.04 was broken on Ubuntu 12.10 upgrade.
Trying to re-install on Ubuntu 12.10, "bundle install" fails with an "-Werror=format-security" error on nokogiri :
"""
Installing nokogiri (1.4.7) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
extconf.rb:10: Use RbConfig instead of obsolete and deprecated Config.
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... yes
checking for libexslt/exslt.h... yes
checking for iconv_open() in iconv.h... yes
checking for xmlParseDoc() in -lxml2... yes
checking for xsltParseStylesheetDoc() in -lxslt... yes
checking for exsltFuncRegister() in -lexslt... 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
make
compiling xml_comment.c
compiling html_sax_parser_context.c
compiling xml_element_decl.c
compiling nokogiri.c
compiling xml_syntax_error.c
compiling xml_namespace.c
xml_namespace.c: In function ‘prefix’:
xml_namespace.c:14:13: attention : variable ‘doc’ set but not used [-Wunused-but-set-variable]
xml_namespace.c: In function ‘href’:
xml_namespace.c:33:13: attention : variable ‘doc’ set but not used [-Wunused-but-set-variable]
compiling xml_dtd.c
compiling xml_node_set.c
compiling xml_schema.c
compiling xml_encoding_handler.c
compiling xml_document_fragment.c
compiling xml_sax_parser_context.c
compiling html_element_description.c
html_element_description.c: In function ‘get_description’:
html_element_description.c:249:10: attention : cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
compiling xml_entity_reference.c
compiling xml_io.c
xml_io.c: In function ‘io_read_callback’:
xml_io.c:28:3: attention : conversion to ‘int’ from ‘size_t’ may change the sign of the result [-Wsign-conversion]
compiling xml_libxml2_hacks.c
compiling xml_reader.c
compiling xml_sax_parser.c
compiling xml_text.c
compiling xml_element_content.c
compiling xml_document.c
compiling xslt_stylesheet.c
compiling xml_cdata.c
compiling html_document.c
compiling xml_relax_ng.c
compiling xml_attribute_decl.c
compiling xml_node.c
compiling xml_sax_push_parser.c
compiling html_entity_lookup.c
compiling xml_processing_instruction.c
compiling xml_attr.c
compiling xml_entity_decl.c
compiling xml_xpath_context.c
xml_xpath_context.c: In function ‘xpath_generic_exception_handler’:
xml_xpath_context.c:184:3: erreur: le format n'est pas une chaîne littérale et pas d'argument de format [-Werror=format-security]
cc1: some warnings being treated as errors
make: *** [xml_xpath_context.o] Erreur 1
Gem files will remain installed in /var/lib/gems/1.9.1/gems/nokogiri-1.4.7 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/nokogiri-1.4.7/ext/nokogiri/gem_make.out
An error occurred while installing nokogiri (1.4.7), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.4.7'` succeeds before bundling.
"""
This first error could be fixed by upgrading to nokogiri 1.5+ (cf. http://stackoverflow.com/questions/13085404/installing-nokogiri-v-1-5-0-gem-in-ubuntu-12-10 ),
but then you get the same error on the mongrel gem.
As suggested in a comment from https://github.com/macournoyer/thin/issues/119 , a workaround is to override the CFLAGS:
"""
Successfully installed nokogiri-1.4.7
1 gem installed
Installing ri documentation for nokogiri-1.4.7...
Building YARD (yri) index for nokogiri-1.4.7...
Installing RDoc documentation for nokogiri-1.4.7...
"""
and
""""
Successfully installed mongrel-1.2.0.pre2
1 gem installed
Installing ri documentation for mongrel-1.2.0.pre2...
Installing RDoc documentation for mongrel-1.2.0.pre2...
"""
"bundle install" then finishes successfully.
Trying to re-install on Ubuntu 12.10, "bundle install" fails with an "-Werror=format-security" error on nokogiri :
"""
Installing nokogiri (1.4.7) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
extconf.rb:10: Use RbConfig instead of obsolete and deprecated Config.
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... yes
checking for libexslt/exslt.h... yes
checking for iconv_open() in iconv.h... yes
checking for xmlParseDoc() in -lxml2... yes
checking for xsltParseStylesheetDoc() in -lxslt... yes
checking for exsltFuncRegister() in -lexslt... 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
make
compiling xml_comment.c
compiling html_sax_parser_context.c
compiling xml_element_decl.c
compiling nokogiri.c
compiling xml_syntax_error.c
compiling xml_namespace.c
xml_namespace.c: In function ‘prefix’:
xml_namespace.c:14:13: attention : variable ‘doc’ set but not used [-Wunused-but-set-variable]
xml_namespace.c: In function ‘href’:
xml_namespace.c:33:13: attention : variable ‘doc’ set but not used [-Wunused-but-set-variable]
compiling xml_dtd.c
compiling xml_node_set.c
compiling xml_schema.c
compiling xml_encoding_handler.c
compiling xml_document_fragment.c
compiling xml_sax_parser_context.c
compiling html_element_description.c
html_element_description.c: In function ‘get_description’:
html_element_description.c:249:10: attention : cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
compiling xml_entity_reference.c
compiling xml_io.c
xml_io.c: In function ‘io_read_callback’:
xml_io.c:28:3: attention : conversion to ‘int’ from ‘size_t’ may change the sign of the result [-Wsign-conversion]
compiling xml_libxml2_hacks.c
compiling xml_reader.c
compiling xml_sax_parser.c
compiling xml_text.c
compiling xml_element_content.c
compiling xml_document.c
compiling xslt_stylesheet.c
compiling xml_cdata.c
compiling html_document.c
compiling xml_relax_ng.c
compiling xml_attribute_decl.c
compiling xml_node.c
compiling xml_sax_push_parser.c
compiling html_entity_lookup.c
compiling xml_processing_instruction.c
compiling xml_attr.c
compiling xml_entity_decl.c
compiling xml_xpath_context.c
xml_xpath_context.c: In function ‘xpath_generic_exception_handler’:
xml_xpath_context.c:184:3: erreur: le format n'est pas une chaîne littérale et pas d'argument de format [-Werror=format-security]
cc1: some warnings being treated as errors
make: *** [xml_xpath_context.o] Erreur 1
Gem files will remain installed in /var/lib/gems/1.9.1/gems/nokogiri-1.4.7 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/nokogiri-1.4.7/ext/nokogiri/gem_make.out
An error occurred while installing nokogiri (1.4.7), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.4.7'` succeeds before bundling.
"""
This first error could be fixed by upgrading to nokogiri 1.5+ (cf. http://stackoverflow.com/questions/13085404/installing-nokogiri-v-1-5-0-gem-in-ubuntu-12-10 ),
but then you get the same error on the mongrel gem.
As suggested in a comment from https://github.com/macournoyer/thin/issues/119 , a workaround is to override the CFLAGS:
"""
- gem install nokogiri -v '1.4.7' -- --with-cflags=\"-O2 -pipe -march=native -w\"
Successfully installed nokogiri-1.4.7
1 gem installed
Installing ri documentation for nokogiri-1.4.7...
Building YARD (yri) index for nokogiri-1.4.7...
Installing RDoc documentation for nokogiri-1.4.7...
"""
and
""""
- gem install mongrel --pre -- --with-cflags=\"-O2 -pipe -march=native -w\"
Successfully installed mongrel-1.2.0.pre2
1 gem installed
Installing ri documentation for mongrel-1.2.0.pre2...
Installing RDoc documentation for mongrel-1.2.0.pre2...
"""
"bundle install" then finishes successfully.
Leave a comment
on 2012-11-23 23:55 *
By mattr-
Status changed from New to Invalid
Status changed from New to Invalid
This is due to problems in the C extensions for those gems and are not actually a Tracks issue. You'll need to file issues against those other gems indicating that they don't built on Ubuntu 12.10.
This happens because the Ubuntu team has decided to include additional flags for the compiler by default that cause these errors to happen.
This happens because the Ubuntu team has decided to include additional flags for the compiler by default that cause these errors to happen.
Agreed, the intrinsic issues are indeed with those gems.
When filing this ticket, I only meant to inform other people about them (i.e. Tracks 2.1 depends on outdated or unmaintained third party gems) and that it can be worked around.
Maybe this information could make it into the FAQ?
Regards,
Patrick.
When filing this ticket, I only meant to inform other people about them (i.e. Tracks 2.1 depends on outdated or unmaintained third party gems) and that it can be worked around.
Maybe this information could make it into the FAQ?
Regards,
Patrick.