Vagrant: Vagrant 2.1.2 Centos rpm on Fedora does not build libvirt

Created on 12 Jul 2018  ·  5Comments  ·  Source: hashicorp/vagrant

Unable to build or install vagrant-libvirt with Vagrant 2.1.2 on Fedora 28.

Vagrant version

Vagrant 2.1.2

Host operating system

Fedora 28

Debug output

"pkg-config --exists libvirt"
| pkg-config --libs libvirt
=> "-lvirt \n"
"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/vagrant-substrate/cache/ruby-2.4.4/include -O3 -fPIC 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 -Wl,-rpath=XORIGIN/../lib:/opt/vagrant/embedded/lib -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"
In file included from /opt/vagrant/embedded/include/ruby-2.4.0/ruby.h:33,
                 from conftest.c:1:
/opt/vagrant/embedded/include/ruby-2.4.0/ruby/ruby.h:631:1: 警告:「const」 attribute on function returning 「void」 [-Wattributes]
 CONSTFUNC(void rb_secure_update(VALUE));
 ^~~~~~~~~
In file included from /opt/vagrant/embedded/include/ruby-2.4.0/ruby/ruby.h:2012,
                 from /opt/vagrant/embedded/include/ruby-2.4.0/ruby.h:33,
                 from conftest.c:1:
/opt/vagrant/embedded/include/ruby-2.4.0/ruby/intern.h:257:1: 警告:「const」 attribute on function returning 「void」 [-Wattributes]
 CONSTFUNC(void rb_error_untrusted(VALUE));
 ^~~~~~~~~
/opt/vagrant/embedded/include/ruby-2.4.0/ruby/intern.h:259:1: 警告:「const」 attribute on function returning 「void」 [-Wattributes]
 CONSTFUNC(void rb_check_trusted(VALUE));
 ^~~~~~~~~
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

"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/vagrant-substrate/cache/ruby-2.4.4/include -O3 -fPIC 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 -Wl,-rpath=XORIGIN/../lib:/opt/vagrant/embedded/lib -fstack-protector -rdynamic -Wl,-export-dynamic -L/opt/vagrant/embedded/lib  -Wl,-rpath,/opt/vagrant/embedded/lib     -Wl,-rpath,'/../lib' -Wl,-rpath,'/../lib' -lruby -lvirt -lpthread -lrt -lgmp -ldl -lcrypt -lm   -lc"
In file included from /opt/vagrant/embedded/include/ruby-2.4.0/ruby.h:33,
                 from conftest.c:1:
/opt/vagrant/embedded/include/ruby-2.4.0/ruby/ruby.h:631:1: 警告:「const」 attribute on function returning 「void」 [-Wattributes]
 CONSTFUNC(void rb_secure_update(VALUE));
 ^~~~~~~~~
In file included from /opt/vagrant/embedded/include/ruby-2.4.0/ruby/ruby.h:2012,
                 from /opt/vagrant/embedded/include/ruby-2.4.0/ruby.h:33,
                 from conftest.c:1:
/opt/vagrant/embedded/include/ruby-2.4.0/ruby/intern.h:257:1: 警告:「const」 attribute on function returning 「void」 [-Wattributes]
 CONSTFUNC(void rb_error_untrusted(VALUE));
 ^~~~~~~~~
/opt/vagrant/embedded/include/ruby-2.4.0/ruby/intern.h:259:1: 警告:「const」 attribute on function returning 「void」 [-Wattributes]
 CONSTFUNC(void rb_check_trusted(VALUE));
 ^~~~~~~~~
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

package configuration for libvirt is not found

Expected behavior

What should have happened?
The plugin should have installed successfully

Actual behavior

What actually happened?

Steps to reproduce

  1. Install Fedora 28
  2. sudo dnf -y install qemu libvirt libvirt-devel ruby-devel gcc
  3. Install the Vagrant 2.1.2 rpm for Centos.
  4. vagrant plugin install vagrant-libvirt
bug installer

Most helpful comment

Until team finds out why this is not working you can use this workaround:
CONFIGURE_ARGS="with-libvirt-include=/usr/include/libvirt --with-libvirt-lib=/usr/lib64/libvirt" vagrant plugin install vagrant-libvirt

All 5 comments

Until team finds out why this is not working you can use this workaround:
CONFIGURE_ARGS="with-libvirt-include=/usr/include/libvirt --with-libvirt-lib=/usr/lib64/libvirt" vagrant plugin install vagrant-libvirt

This workaround, which worked for me, is documented in the vagrant-libvirt README file.

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

The RPM and linux binary were both updated in 2.1.4 to properly compile against libvirt. If there are any other issues, please do let us know and I'll investigate more. Thanks!

none of this works in F29 !! with vagrant v2.2.3

I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mpontillo picture mpontillo  ·  3Comments

Cbeck527 picture Cbeck527  ·  3Comments

barkingfoodog picture barkingfoodog  ·  3Comments

bbaassssiiee picture bbaassssiiee  ·  3Comments

jsirex picture jsirex  ·  3Comments