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

vagrant: 2.1.2 -> 2.2.0 + vagrant-libvirt: init at 2.2.0 #49220

Merged
merged 3 commits into from Nov 7, 2018

Conversation

calbrecht
Copy link
Member

@calbrecht calbrecht commented Oct 27, 2018

Motivation for this change
Things done
  • closure size
    • vagrant without libvirt
    nix path-info -rS $(which vagrant) | awk '{print $2}' | paste -sd+ | bc
    6355939856
    nix path-info -S $(which vagrant) | awk '{print $2}' | paste -sd+ | bc
    252213208
    
    • vagrant with libvirt
    nix path-info -rS $(which vagrant) | awk '{print $2}' | paste -sd+ | bc
    11342383160
    nix path-info -S $(which vagrant) | awk '{print $2}' | paste -sd+ | bc
    551161720
    
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip --against 591ba7335bae245733777c1c4eeedb4d34ef57af"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

Adds a flag and a new package to build vagrant with libvirt support,
to be able to install and use the vagrant-libvirt plugin.
@calbrecht
Copy link
Member Author

@aneeshusa, @globin please review.

@calbrecht
Copy link
Member Author

Perhaps it is not needed/wanted to add the withLibvirt flag and always prepare vagrant to be able to run with libvirt, idk, please advice.

@lheckemann
Copy link
Member

@GrahamcOfBorg build libvirt vagrant-libvirt

@calbrecht
Copy link
Member Author

Like discussed with @globin and @lheckemann i changed the derivation to default to withLibvirt = true and removed the extra package attribute vagrant-libvirt.

@Ma27
Copy link
Member

Ma27 commented Nov 5, 2018

awesome work @calbrecht!

@globin
Copy link
Member

globin commented Nov 5, 2018

@GrahamcOfBorg build vagrant

@GrahamcOfBorg

This comment has been minimized.

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: vagrant

Partial log (click to expand)

/nix/store/82n3zdlkn1izb8mf57h7prw2f3bcwm89-vagrant-2.2.0/lib/ruby/gems/2.5.0/gems/vagrant-2.2.0/bin/vagrant: interpreter directive changed from "/usr/bin/env ruby" to "/nix/store/7q6hflyldr1yay11rl3hqb7yl42242s7-ruby-2.5.3/bin/ruby"
/nix/store/82n3zdlkn1izb8mf57h7prw2f3bcwm89-vagrant-2.2.0/lib/ruby/gems/2.5.0/gems/vagrant-2.2.0/bin/vagrant.orig: interpreter directive changed from "/usr/bin/env ruby" to "/nix/store/7q6hflyldr1yay11rl3hqb7yl42242s7-ruby-2.5.3/bin/ruby"
/nix/store/82n3zdlkn1izb8mf57h7prw2f3bcwm89-vagrant-2.2.0/lib/ruby/gems/2.5.0/gems/vagrant-2.2.0/plugins/hosts/darwin/scripts/install_virtualbox.sh: interpreter directive changed from "/bin/bash" to "/nix/store/n9hba031gjky8hpjgx9fnlaxhidyzxbz-bash-4.4-p23/bin/bash"
/nix/store/82n3zdlkn1izb8mf57h7prw2f3bcwm89-vagrant-2.2.0/lib/ruby/gems/2.5.0/gems/vagrant-2.2.0/plugins/provisioners/salt/bootstrap-salt.sh: interpreter directive changed from "/bin/sh -" to "/nix/store/n9hba031gjky8hpjgx9fnlaxhidyzxbz-bash-4.4-p23/bin/sh -"
/nix/store/82n3zdlkn1izb8mf57h7prw2f3bcwm89-vagrant-2.2.0/lib/ruby/gems/2.5.0/gems/vagrant-2.2.0/scripts/sign.sh: interpreter directive changed from "/bin/bash" to "/nix/store/n9hba031gjky8hpjgx9fnlaxhidyzxbz-bash-4.4-p23/bin/bash"
/nix/store/82n3zdlkn1izb8mf57h7prw2f3bcwm89-vagrant-2.2.0/lib/ruby/gems/2.5.0/gems/vagrant-2.2.0/scripts/website_push_docs.sh: interpreter directive changed from "/bin/bash" to "/nix/store/n9hba031gjky8hpjgx9fnlaxhidyzxbz-bash-4.4-p23/bin/bash"
/nix/store/82n3zdlkn1izb8mf57h7prw2f3bcwm89-vagrant-2.2.0/lib/ruby/gems/2.5.0/gems/vagrant-2.2.0/scripts/website_push_www.sh: interpreter directive changed from "/bin/bash" to "/nix/store/n9hba031gjky8hpjgx9fnlaxhidyzxbz-bash-4.4-p23/bin/bash"
running install tests
Vagrant smoke check passed
/nix/store/82n3zdlkn1izb8mf57h7prw2f3bcwm89-vagrant-2.2.0

@GrahamcOfBorg

This comment has been minimized.

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: vagrant

Partial log (click to expand)

/nix/store/82n3zdlkn1izb8mf57h7prw2f3bcwm89-vagrant-2.2.0

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: vagrant

Partial log (click to expand)

/nix/store/832z67mz9z1sq6zxh0zym2xyz44s7g7p-vagrant-2.2.0/lib/ruby/gems/2.5.0/gems/vagrant-2.2.0/bin/vagrant.orig: interpreter directive changed from "/usr/bin/env ruby" to "/nix/store/imzyjwl9yv28h02zwsjpdsb2va7s8rqk-ruby-2.5.3/bin/ruby"
/nix/store/832z67mz9z1sq6zxh0zym2xyz44s7g7p-vagrant-2.2.0/lib/ruby/gems/2.5.0/gems/vagrant-2.2.0/bin/vagrant: interpreter directive changed from "/usr/bin/env ruby" to "/nix/store/imzyjwl9yv28h02zwsjpdsb2va7s8rqk-ruby-2.5.3/bin/ruby"
/nix/store/832z67mz9z1sq6zxh0zym2xyz44s7g7p-vagrant-2.2.0/lib/ruby/gems/2.5.0/gems/vagrant-2.2.0/scripts/website_push_docs.sh: interpreter directive changed from "/bin/bash" to "/nix/store/r47p5pzx52m3n34vdgqpk5rvqgm0m24m-bash-4.4-p23/bin/bash"
/nix/store/832z67mz9z1sq6zxh0zym2xyz44s7g7p-vagrant-2.2.0/lib/ruby/gems/2.5.0/gems/vagrant-2.2.0/scripts/website_push_www.sh: interpreter directive changed from "/bin/bash" to "/nix/store/r47p5pzx52m3n34vdgqpk5rvqgm0m24m-bash-4.4-p23/bin/bash"
/nix/store/832z67mz9z1sq6zxh0zym2xyz44s7g7p-vagrant-2.2.0/lib/ruby/gems/2.5.0/gems/vagrant-2.2.0/scripts/sign.sh: interpreter directive changed from "/bin/bash" to "/nix/store/r47p5pzx52m3n34vdgqpk5rvqgm0m24m-bash-4.4-p23/bin/bash"
/nix/store/832z67mz9z1sq6zxh0zym2xyz44s7g7p-vagrant-2.2.0/lib/ruby/gems/2.5.0/gems/vagrant-2.2.0/.runner.sh: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/r47p5pzx52m3n34vdgqpk5rvqgm0m24m-bash-4.4-p23/bin/bash"
checking for references to /build in /nix/store/832z67mz9z1sq6zxh0zym2xyz44s7g7p-vagrant-2.2.0...
running install tests
Vagrant smoke check passed
/nix/store/832z67mz9z1sq6zxh0zym2xyz44s7g7p-vagrant-2.2.0

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: vagrant

Partial log (click to expand)

/nix/store/832z67mz9z1sq6zxh0zym2xyz44s7g7p-vagrant-2.2.0/lib/ruby/gems/2.5.0/gems/vagrant-2.2.0/bin/vagrant.orig: interpreter directive changed from "/usr/bin/env ruby" to "/nix/store/imzyjwl9yv28h02zwsjpdsb2va7s8rqk-ruby-2.5.3/bin/ruby"
/nix/store/832z67mz9z1sq6zxh0zym2xyz44s7g7p-vagrant-2.2.0/lib/ruby/gems/2.5.0/gems/vagrant-2.2.0/bin/vagrant: interpreter directive changed from "/usr/bin/env ruby" to "/nix/store/imzyjwl9yv28h02zwsjpdsb2va7s8rqk-ruby-2.5.3/bin/ruby"
/nix/store/832z67mz9z1sq6zxh0zym2xyz44s7g7p-vagrant-2.2.0/lib/ruby/gems/2.5.0/gems/vagrant-2.2.0/scripts/website_push_docs.sh: interpreter directive changed from "/bin/bash" to "/nix/store/r47p5pzx52m3n34vdgqpk5rvqgm0m24m-bash-4.4-p23/bin/bash"
/nix/store/832z67mz9z1sq6zxh0zym2xyz44s7g7p-vagrant-2.2.0/lib/ruby/gems/2.5.0/gems/vagrant-2.2.0/scripts/website_push_www.sh: interpreter directive changed from "/bin/bash" to "/nix/store/r47p5pzx52m3n34vdgqpk5rvqgm0m24m-bash-4.4-p23/bin/bash"
/nix/store/832z67mz9z1sq6zxh0zym2xyz44s7g7p-vagrant-2.2.0/lib/ruby/gems/2.5.0/gems/vagrant-2.2.0/scripts/sign.sh: interpreter directive changed from "/bin/bash" to "/nix/store/r47p5pzx52m3n34vdgqpk5rvqgm0m24m-bash-4.4-p23/bin/bash"
/nix/store/832z67mz9z1sq6zxh0zym2xyz44s7g7p-vagrant-2.2.0/lib/ruby/gems/2.5.0/gems/vagrant-2.2.0/.runner.sh: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/r47p5pzx52m3n34vdgqpk5rvqgm0m24m-bash-4.4-p23/bin/bash"
checking for references to /build in /nix/store/832z67mz9z1sq6zxh0zym2xyz44s7g7p-vagrant-2.2.0...
running install tests
Vagrant smoke check passed
/nix/store/832z67mz9z1sq6zxh0zym2xyz44s7g7p-vagrant-2.2.0

@GrahamcOfBorg

This comment has been minimized.

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: vagrant

Partial log (click to expand)

/nix/store/j4dmdr2rx9hz9y5xvg0dc5r0n15qj8r5-vagrant-2.2.0/lib/ruby/gems/2.5.0/gems/vagrant-2.2.0/scripts/sign.sh: interpreter directive changed from "/bin/bash" to "/nix/store/dsyc1z7ck08ga7l0b1jcxx35wj69qcii-bash-4.4-p23/bin/bash"
/nix/store/j4dmdr2rx9hz9y5xvg0dc5r0n15qj8r5-vagrant-2.2.0/lib/ruby/gems/2.5.0/gems/vagrant-2.2.0/plugins/provisioners/salt/bootstrap-salt.sh: interpreter directive changed from "/bin/sh -" to "/nix/store/dsyc1z7ck08ga7l0b1jcxx35wj69qcii-bash-4.4-p23/bin/sh -"
/nix/store/j4dmdr2rx9hz9y5xvg0dc5r0n15qj8r5-vagrant-2.2.0/lib/ruby/gems/2.5.0/gems/vagrant-2.2.0/plugins/hosts/darwin/scripts/install_virtualbox.sh: interpreter directive changed from "/bin/bash" to "/nix/store/dsyc1z7ck08ga7l0b1jcxx35wj69qcii-bash-4.4-p23/bin/bash"
/nix/store/j4dmdr2rx9hz9y5xvg0dc5r0n15qj8r5-vagrant-2.2.0/lib/ruby/gems/2.5.0/gems/vagrant-2.2.0/bin/vagrant.orig: interpreter directive changed from "/usr/bin/env ruby" to "/nix/store/51sgjlq650kkxs7iz2wcz33lx74awn57-ruby-2.5.3/bin/ruby"
/nix/store/j4dmdr2rx9hz9y5xvg0dc5r0n15qj8r5-vagrant-2.2.0/lib/ruby/gems/2.5.0/gems/vagrant-2.2.0/bin/vagrant: interpreter directive changed from "/usr/bin/env ruby" to "/nix/store/51sgjlq650kkxs7iz2wcz33lx74awn57-ruby-2.5.3/bin/ruby"
/nix/store/j4dmdr2rx9hz9y5xvg0dc5r0n15qj8r5-vagrant-2.2.0/lib/ruby/gems/2.5.0/gems/vagrant-2.2.0/.runner.sh: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/dsyc1z7ck08ga7l0b1jcxx35wj69qcii-bash-4.4-p23/bin/bash"
checking for references to /build in /nix/store/j4dmdr2rx9hz9y5xvg0dc5r0n15qj8r5-vagrant-2.2.0...
running install tests
Vagrant smoke check passed
/nix/store/j4dmdr2rx9hz9y5xvg0dc5r0n15qj8r5-vagrant-2.2.0

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: vagrant

Partial log (click to expand)

shrinking /nix/store/h5bg6ci03x9mqpxx27p12x31bnmpy2lm-dnsmasq-2.79/bin/dhcp_release6
shrinking /nix/store/h5bg6ci03x9mqpxx27p12x31bnmpy2lm-dnsmasq-2.79/bin/dhcp_release
shrinking /nix/store/h5bg6ci03x9mqpxx27p12x31bnmpy2lm-dnsmasq-2.79/bin/dhcp_lease_time
shrinking /nix/store/h5bg6ci03x9mqpxx27p12x31bnmpy2lm-dnsmasq-2.79/bin/dnsmasq
gzipping man pages under /nix/store/h5bg6ci03x9mqpxx27p12x31bnmpy2lm-dnsmasq-2.79/share/man/
strip is /nix/store/p9akxn2sfy4wkhqdqa3li97pc6jaz3r1-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/h5bg6ci03x9mqpxx27p12x31bnmpy2lm-dnsmasq-2.79/bin
patching script interpreter paths in /nix/store/h5bg6ci03x9mqpxx27p12x31bnmpy2lm-dnsmasq-2.79
checking for references to /build in /nix/store/h5bg6ci03x9mqpxx27p12x31bnmpy2lm-dnsmasq-2.79...
/nix/store/j4dmdr2rx9hz9y5xvg0dc5r0n15qj8r5-vagrant-2.2.0

@lheckemann
Copy link
Member

This does double the closure size of vagrant. Not sure if that's a problem.

# before
/nix/store/2kv4z9c3d7p8k3ssvx85wsspfslfhvrd-vagrant-2.1.2         250885416
# after
/nix/store/832z67mz9z1sq6zxh0zym2xyz44s7g7p-vagrant-2.2.0         551210856

@globin
Copy link
Member

globin commented Nov 7, 2018

I don't think that should be too critical for vagrant since it will never be a light-weight application and it is possible to disable it easily.

@globin globin merged commit c5e8ae3 into NixOS:master Nov 7, 2018
@globin globin deleted the vagrant_2_2_0_libvirt branch November 7, 2018 16:47
@mat8913
Copy link
Contributor

mat8913 commented Dec 15, 2018

How does this work? I tried running vagrant plugin install vagrant-libvirt, but I just got

Installing the 'vagrant-libvirt' plugin. This can take a few minutes...
Fetching: excon-0.62.0.gem (100%)
Fetching: formatador-0.2.5.gem (100%)
Fetching: fog-core-1.43.0.gem (100%)
Fetching: fog-json-1.2.0.gem (100%)
Fetching: mini_portile2-2.3.0.gem (100%)
Fetching: fog-xml-0.1.3.gem (100%)
Fetching: ruby-libvirt-0.7.1.gem (100%)
Building native extensions. This could take a while...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:

ERROR: Failed to build gem native extension.

    current directory: /home/matthew/.vagrant.d/gems/2.5.3/gems/ruby-libvirt-0.7.1/ext/libvirt
/nix/store/8wg1if3a1krbwwi85cvkv8xagcrzdsrb-ruby-2.5.3/bin/ruby -r ./siteconf20181215-20807-bw4rki.rb extconf.rb
*** 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
	--without-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=/nix/store/8wg1if3a1krbwwi85cvkv8xagcrzdsrb-ruby-2.5.3/bin/$(RUBY_BASE_NAME)
	--with-libvirt-include
	--without-libvirt-include
	--with-libvirt-lib
	--without-libvirt-lib
	--with-libvirt-config
	--without-libvirt-config
	--with-pkg-config
	--without-pkg-config
/nix/store/8wg1if3a1krbwwi85cvkv8xagcrzdsrb-ruby-2.5.3/lib/ruby/2.5.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
	from /nix/store/8wg1if3a1krbwwi85cvkv8xagcrzdsrb-ruby-2.5.3/lib/ruby/2.5.0/mkmf.rb:541:in `try_link0'
	from /nix/store/8wg1if3a1krbwwi85cvkv8xagcrzdsrb-ruby-2.5.3/lib/ruby/2.5.0/mkmf.rb:559:in `try_link'
	from /nix/store/8wg1if3a1krbwwi85cvkv8xagcrzdsrb-ruby-2.5.3/lib/ruby/2.5.0/mkmf.rb:661:in `try_ldflags'
	from /nix/store/8wg1if3a1krbwwi85cvkv8xagcrzdsrb-ruby-2.5.3/lib/ruby/2.5.0/mkmf.rb:1821:in `pkg_config'
	from extconf.rb:72:in `<main>'

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

  /home/matthew/.vagrant.d/gems/2.5.3/extensions/x86_64-linux/2.5.0/ruby-libvirt-0.7.1/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/matthew/.vagrant.d/gems/2.5.3/gems/ruby-libvirt-0.7.1 for inspection.
Results logged to /home/matthew/.vagrant.d/gems/2.5.3/extensions/x86_64-linux/2.5.0/ruby-libvirt-0.7.1/gem_make.out

@booxter
Copy link
Contributor

booxter commented Mar 12, 2019

@mat8913 with the PR, libvirt plugin is already installed with vagrant itself. But please make sure that you build from master branch of nixpkgs because the PR was not backported to stable.

@mat8913
Copy link
Contributor

mat8913 commented Mar 12, 2019

@booxter I know, I wrote the PR that did that (#52413) 😆

@booxter
Copy link
Contributor

booxter commented Mar 12, 2019

@mat8913 Epic. Thanks for your work then. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants