Package Details: vagrant-libvirt 0.0.45-1

Git Clone URL: https://aur.archlinux.org/vagrant-libvirt.git (read-only)
Package Base: vagrant-libvirt
Description: libvirt provider plugin for Vagrant
Upstream URL: https://github.com/vagrant-libvirt/vagrant-libvirt
Licenses: MIT
Submitter: mtorromeo
Maintainer: IooNag
Last Packager: IooNag
Votes: 18
Popularity: 0.016120
First Submitted: 2016-12-02 14:08
Last Updated: 2018-11-05 20:07

Pinned Comments

mtorromeo commented on 2016-12-07 12:30

The plugin should still be installed using `vagrant plugin install vagrant-libvirt` as a normal user.
Vagrant will find all the required ruby gems already installed and will just mark the plugin as installed in `~/.vagrant.d/plugins.json` without compiling anything.

Latest Comments

« First ‹ Previous 1 2

gbs commented on 2017-03-05 15:07

mtorromeo: your workaround did not work for me.
The build system needs libvirt.so to detect which functions are available, so setting with-libvirt-lib to a non existing path creates a broken package.
After some fiddling, I came up with this:

export CONFIGURE_ARGS="with-ldflags=-L/opt/vagrant/embedded/lib with-libvirt-include=/usr/include/ with-libvirt-lib=/usr/lib"
export CFLAGS="$CFLAGS -Wl,-rpath=/usr/lib/ -Wl,-rpath=/opt/vagrant/embedded/lib/ -l:libruby.so.2.2"

ruby-libvirt ends up linking to both libruby.so.2.2 and libruby.so.2.4, but it manages to find the correct symbols as far as I can tell.

I also had to restore the old $PATH at the end of the function, otherwise I would get errors like:

-> Generating .BUILDINFO file...
WARNING: can't open config file: /build/vagrant-substrate/src/vagrant-installers/opt/vagrant/embedded/openssl.cnf
-> Generating .MTREE file...
Fatal Internal Error in libarchive: Out of memory

( As an aside, you could replace your noextract array with the single line: `noextract=("${source[@]##*/}")` )

mtorromeo commented on 2017-02-07 11:29

IooNag: thanks for the description of the issue.
It explains why it was working for me as I always build inside a clean chroot (which is not hard at all to do).

The solution is easier than what you propose. I changed with-libvirt-lib to a non existing path. The build forces you to specify bot with-libvirt-include and with-libvirt-lib but only the former is really needed in this case.

IooNag commented on 2017-02-04 20:18

Like other people already reported, the extension links with the wrong libruby.so when building the package on a system which has ruby installed (it uses /usr/lib/libruby.so.2.4.0 instead of /opt/vagrant/embedded/lib/libruby.so.2.2.0). This is because adding "with-libvirt-lib=/usr/lib" to CONFIGURE_ARGS introduces "-L/usr/lib" before "-L/opt/vagrant/embedded/lib" in the command line which is used to build _libvirt.so.
There are several ways to fix this:
1/ Build the package in a clean chroot environment without ruby (without /usr/lib/libruby.so*)
2/ Build the package and modify the header of _libvirt.so to use the right Ruby library, for example with: sudo sed 's/libruby\.so\.2\.4/libruby.so.2.2/' -i /opt/vagrant/embedded/gems/extensions/x86_64-linux/2.2.0/ruby-libvirt-0.7.0/_libvirt.so
3/ Introduce a link-package which installs libvirt.so into /opt/vagrant/embedded/ (with the libcurl which is used there) and drop with-libvirt-* from CONFIGURE_ARGS.

Option 3 seems the most reasonable one to enable "simple use" of the plugin. Have you already considered this option?

efenex commented on 2017-02-02 09:15

Having the same issue as alwyn does with this package, i.e.

/opt/vagrant/embedded/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': incompatible library version - /opt/vagrant/embedded/gems/extensions/x86_64-linux/2.2.0/ruby-libvirt-0.7.0/_libvirt.so (LoadError)

mtorromeo commented on 2016-12-09 13:46

This package is built using the same workaround you are mentioning and it works fine for me.

You may try to build the package in a clean chroot: https://wiki.archlinux.org/index.php/DeveloperWiki:Building_in_a_Clean_Chroot

alwyn commented on 2016-12-09 11:59

Thanks for the comment. I ran `vagrant plugin install vagrant-libvirt` after having installed this package, and that ran well. However when doing `vagrant up --provider=libvirt` the following errors arose: https://gist.github.com/Alveel/d77cab359ec4d22787cc60f63452448b

Also see my comment on the gist.

mtorromeo commented on 2016-12-07 12:30

The plugin should still be installed using `vagrant plugin install vagrant-libvirt` as a normal user.
Vagrant will find all the required ruby gems already installed and will just mark the plugin as installed in `~/.vagrant.d/plugins.json` without compiling anything.

alwyn commented on 2016-12-07 11:04

Hi, using this package and vagrant from the community repo's, when I do vagrant up --provider=libvirt it tells me "No usable default provider could be found for your system."

I'd like to debug myself but I'm not sure where to start...