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

Does not install on Fedora 32 #1105

Closed
rmb938 opened this issue May 4, 2020 · 9 comments
Closed

Does not install on Fedora 32 #1105

rmb938 opened this issue May 4, 2020 · 9 comments

Comments

@rmb938
Copy link

rmb938 commented May 4, 2020

Steps to reproduce

  1. vagrant plugin install vagrant-libvirt

Expected behaviour

Plugin should install

Actual behaviour

Vagrant failed to properly resolve required dependencies. These
errors can commonly be caused by misconfigured plugin installations
or transient network issues. The reported error is:

ERROR: Failed to build gem native extension.

    current directory: /home/rbelgrave/.vagrant.d/gems/2.4.9/gems/nokogiri-1.10.9/ext/nokogiri
/opt/vagrant/embedded/bin/ruby -r ./siteconf20200504-26704-1b40zih.rb extconf.rb
checking if the C compiler accepts -I/opt/vagrant/embedded/include -I/opt/vagrant/embedded/include/libxml2... *** 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
        --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=.
        --curdir
        --ruby=/opt/vagrant/embedded/bin/$(RUBY_BASE_NAME)
        --help
        --clean
/opt/vagrant/embedded/lib/ruby/2.4.0/mkmf.rb:457:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from /opt/vagrant/embedded/lib/ruby/2.4.0/mkmf.rb:572:in `block in try_compile'
        from /opt/vagrant/embedded/lib/ruby/2.4.0/mkmf.rb:523:in `with_werror'
        from /opt/vagrant/embedded/lib/ruby/2.4.0/mkmf.rb:572:in `try_compile'
        from extconf.rb:138:in `nokogiri_try_compile'
        from extconf.rb:162:in `block in add_cflags'
        from /opt/vagrant/embedded/lib/ruby/2.4.0/mkmf.rb:630:in `with_cflags'
        from extconf.rb:161:in `add_cflags'
        from extconf.rb:416:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /home/rbelgrave/.vagrant.d/gems/2.4.9/extensions/x86_64-linux/2.4.0/nokogiri-1.10.9/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/rbelgrave/.vagrant.d/gems/2.4.9/gems/nokogiri-1.10.9 for inspection.
Results logged to /home/rbelgrave/.vagrant.d/gems/2.4.9/extensions/x86_64-linux/2.4.0/nokogiri-1.10.9/gem_make.out
"gcc -o conftest -I/opt/vagrant/embedded/include/ruby-2.4.0/x86_64-linux -I/opt/vagrant/embedded/include/ruby-2.4.0/ruby/backward -I/opt/vagrant/embedded/include/ruby-2.4.0 -I. -I/opt/vagrant/embedded/include -I/opt/vagrant/embedded/include   -I/opt/vagrant/embedded/include -fPIC -I/opt/vagrant/embedded/include -I/opt/vagrant/embedded/include/libxml2 conftest.c  -L. -L/opt/vagrant/embedded/lib -Wl,-rpath,/opt/vagrant/embedded/lib -L/opt/vagrant/embedded/lib -Wl,-rpath,/opt/vagrant/embedded/lib -L. -L/opt/vagrant/embedded/lib -L/opt/vagrant/embedded/lib64 -Wl,-rpath=XORIGIN/../lib:XORIGIN/../lib64:/opt/vagrant/embedded/lib:/opt/vagrant/embedded/lib64 -fstack-protector -rdynamic -Wl,-export-dynamic -L/opt/vagrant/embedded/lib  -Wl,-rpath,/opt/vagrant/embedded/lib     -Wl,-rpath,'/../lib' -Wl,-rpath,'/../lib' -lruby  -lpthread -lrt -lgmp -ldl -lcrypt -lm   -lc "
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
collect2: error: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

System configuration

OS/Distro version:: Fedora 32

Libvirt version: libvirtd (libvirt) 6.1.0

Output of vagrant version; vagrant plugin list:

Installed Version: 2.2.7
Latest Version: 2.2.7
 
You're running an up-to-date version of Vagrant!
No plugins installed.

Are you using upstream vagrant package or your distros package?
Upstream

I saw a few similar issues on this repo but none of them seem to have this specific error.

@rmb938
Copy link
Author

rmb938 commented May 4, 2020

Figured it out.

export LIBRARY_PATH=/usr/lib64:$LIBRARY_PATH

CONFIGURE_ARGS='with-ldflags=-L/opt/vagrant/embedded/lib with-libvirt-include=/usr/include/libvirt with-libvirt-lib=/usr/lib64' GEM_HOME=~/.vagrant.d/gems GEM_PATH=$GEM_HOME:/opt/vagrant/embedded/gems PATH=/opt/vagrant/embedded/bin:$PATH vagrant plugin install vagrant-libvirt

Note the with-libvirt-lib=/usr/lib64'

@rmb938 rmb938 closed this as completed May 4, 2020
@rmb938
Copy link
Author

rmb938 commented May 4, 2020

Hmm actually now vagrant up is failing with this

vagrant up
Bringing machine 'pxeclient' up with 'libvirt' provider...
/opt/vagrant/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require': /usr/lib64/libk5crypto.so.3: undefined symbol: EVP_KDF_ctrl, version OPENSSL_1_1_1b - /home/rbelgrave/.vagrant.d/gems/2.4.9/gems/ruby-libvirt-0.7.1/lib/_libvirt.so (LoadError)

@rmb938 rmb938 reopened this May 4, 2020
@buckaroogeek
Copy link
Contributor

I have the same problem with the upstream vagrant 2.2.8 from Hashicorp on Fedora 32. I found a similar error for matlab (see https://www.mathworks.com/matlabcentral/answers/514366-error-while-installing-matlab-r2020a-on-fedora-32). The hack used there does not resolve the vagrant problem that i can find.

@ruzickap
Copy link
Contributor

ruzickap commented May 7, 2020

Same problem here...
Looks like it's not easy to make vagrant-libvirt on Fedora 32 with "upstream" Vagrant (2.2.8) running...

@buckaroogeek
Copy link
Contributor

My attempt to capture this as a bug with RedHat Bugzilla for Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1833024

Not sure what will happen.

@voxik
Copy link
Contributor

voxik commented May 7, 2020

I think the problem is that Ruby in Vagrant is build against bundled version of OpenSSL while during vagrant-libvirt installation, the system version of OpenSSL is used and later they clash.

The configure args are hardly correct. They should refer to vagrant libraries, not to the system.

This won't happen with Fedora version of Vagrant.

@buckaroogeek
Copy link
Contributor

@voxik - thanks. I was using the configure args as recommended by the vagrant-libvirt readme when running into installation problems. Do you have a recommended change to CONFIGURE_ARGS?

@buckaroogeek
Copy link
Contributor

Please see the solution in this thread: hashicorp/vagrant#11020 (comment).

@electrofelix
Copy link
Contributor

The readme has been updated with the steps needed in #1107 that appear to work as described.

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

No branches or pull requests

5 participants