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

Bump libxml-ruby to fix build failure #51439

Merged
merged 1 commit into from Apr 1, 2024

Conversation

CodingItWrong
Copy link
Contributor

@CodingItWrong CodingItWrong commented Mar 28, 2024

Motivation / Background

This fixes bundle install when using the latest version of libxml2

Detail

Sample installation log
bundle install
Fetching gem metadata from https://rubygems.org/.........
Installing mysql2 0.5.5 with native extensions
Installing libxml-ruby 5.0.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/josh/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/libxml-ruby-5.0.0/ext/libxml
/Users/josh/.rbenv/versions/3.3.0/bin/ruby extconf.rb
checking for libxml/xmlversion.h in
/opt/include/libxml2,/opt/local/include/libxml2,/opt/homebrew/opt/libxml2/include/libxml2,/usr/local/include/libxml2,/usr/include/libxml2,/usr/local/include,/usr/local/opt/libxml2/include/libxml2...
yes
checking for xmlParseDoc() in -lxml2... yes
creating extconf.h
creating Makefile

current directory: /Users/josh/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/libxml-ruby-5.0.0/ext/libxml
make DESTDIR\= sitearchdir\=./.gem.20240328-25424-bulg40 sitelibdir\=./.gem.20240328-25424-bulg40 clean

current directory: /Users/josh/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/libxml-ruby-5.0.0/ext/libxml
make DESTDIR\= sitearchdir\=./.gem.20240328-25424-bulg40 sitelibdir\=./.gem.20240328-25424-bulg40
compiling libxml.c
compiling ruby_xml.c
compiling ruby_xml_attr.c
compiling ruby_xml_attr_decl.c
compiling ruby_xml_attributes.c
compiling ruby_xml_cbg.c
compiling ruby_xml_document.c
compiling ruby_xml_dtd.c
compiling ruby_xml_encoding.c
compiling ruby_xml_error.c
ruby_xml_error.c:123:35: error: incompatible function pointer types passing 'void (void *, const xmlError *)' (aka
'void (void *, const struct _xmlError *)') to parameter of type 'xmlStructuredErrorFunc' (aka 'void (*)(void *,
struct _xmlError *)') [-Wincompatible-function-pointer-types]
  xmlSetStructuredErrorFunc(NULL, structuredErrorFunc);
                                  ^~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libxml/xmlerror.h:870:29:
note: passing argument to parameter 'handler' here
                                 xmlStructuredErrorFunc handler);
                                                        ^
1 error generated.
make: *** [ruby_xml_error.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/josh/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/libxml-ruby-5.0.0 for
inspection.
Results logged to
/Users/josh/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/extensions/arm64-darwin-23/3.3.0/libxml-ruby-5.0.0/gem_make.out

  /Users/josh/.rbenv/versions/3.3.0/lib/ruby/site_ruby/3.3.0/rubygems/ext/builder.rb:125:in `run'
  /Users/josh/.rbenv/versions/3.3.0/lib/ruby/site_ruby/3.3.0/rubygems/ext/builder.rb:51:in `block in make'
  /Users/josh/.rbenv/versions/3.3.0/lib/ruby/site_ruby/3.3.0/rubygems/ext/builder.rb:43:in `each'
  /Users/josh/.rbenv/versions/3.3.0/lib/ruby/site_ruby/3.3.0/rubygems/ext/builder.rb:43:in `make'
  /Users/josh/.rbenv/versions/3.3.0/lib/ruby/site_ruby/3.3.0/rubygems/ext/ext_conf_builder.rb:42:in `build'
  /Users/josh/.rbenv/versions/3.3.0/lib/ruby/site_ruby/3.3.0/rubygems/ext/builder.rb:193:in `build_extension'
/Users/josh/.rbenv/versions/3.3.0/lib/ruby/site_ruby/3.3.0/rubygems/ext/builder.rb:227:in `block in
build_extensions'
  /Users/josh/.rbenv/versions/3.3.0/lib/ruby/site_ruby/3.3.0/rubygems/ext/builder.rb:224:in `each'
  /Users/josh/.rbenv/versions/3.3.0/lib/ruby/site_ruby/3.3.0/rubygems/ext/builder.rb:224:in `build_extensions'
  /Users/josh/.rbenv/versions/3.3.0/lib/ruby/site_ruby/3.3.0/rubygems/installer.rb:852:in `build_extensions'
/Users/josh/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.4/lib/bundler/rubygems_gem_installer.rb:76:in
`build_extensions'
/Users/josh/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.4/lib/bundler/rubygems_gem_installer.rb:28:in
`install'
/Users/josh/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.4/lib/bundler/source/rubygems.rb:205:in
`install'
/Users/josh/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.4/lib/bundler/installer/gem_installer.rb:54:in
`install'
/Users/josh/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.4/lib/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
/Users/josh/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.4/lib/bundler/installer/parallel_installer.rb:132:in
`do_install'
/Users/josh/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.4/lib/bundler/installer/parallel_installer.rb:123:in
`block in worker_pool'
  /Users/josh/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.4/lib/bundler/worker.rb:62:in `apply_func'
/Users/josh/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.4/lib/bundler/worker.rb:57:in `block in
process_queue'
  <internal:kernel>:187:in `loop'
/Users/josh/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.4/lib/bundler/worker.rb:54:in
`process_queue'
/Users/josh/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.4/lib/bundler/worker.rb:90:in `block (2
levels) in create_threads'

An error occurred while installing libxml-ruby (5.0.0), and Bundler cannot continue.

In Gemfile:
  libxml-ruby

Additional information

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Unrelated changes should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • - n/a - Tests are added or updated if you fix a bug or add a feature.
  • - n/a - CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

Copy link
Member

@flavorjones flavorjones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend this get merged, libxml2 changed some function signatures upstream.

@yahonda
Copy link
Member

yahonda commented Apr 1, 2024

Although we usually do not just bump every gem version in the Gemfile.lock, xml4r/libxml-ruby#213 actually prevents from bundle install as I reported . I think we can merge it.

@yahonda yahonda merged commit 0033d46 into rails:main Apr 1, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants