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: build and install vagrant-libvirt plugin #52413

Merged
merged 5 commits into from Dec 19, 2018

Conversation

mat8913
Copy link
Contributor

@mat8913 mat8913 commented Dec 17, 2018

Motivation for this change

I was having trouble installing vagrant-libvirt with vagrant plugin install vagrant-libvirt, and I think it's cleaner to just let Nix manage everything.

#26202

Things done
  • 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"
  • 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)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

With this, you can "install" the plugin just by adding the following to
~/vagrant.d/plugins.json:

  {
    "version":"1",
    "installed": {
      "vagrant-libvirt": {
        "ruby_version":"2.5.3",
        "vagrant_version":"2.2.0",
        "gem_version":"",
        "require":"",
        "sources":[]
      }
    }
  }
@globin
Copy link
Member

globin commented Dec 17, 2018

@calbrecht could you have a look at this?

@calbrecht
Copy link
Member

sure, i will

@@ -0,0 +1,96 @@
From: Antonio Terceiro <terceiro@debian.org>
Copy link
Member

Choose a reason for hiding this comment

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

is this an upstream patch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it's from Debian: https://sources.debian.org/src/vagrant/2.1.5+dfsg-1/debian/patches/0004-Support-system-installed-plugins.patch/

I made a couple of modifications to make it work with Nix.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

+ rescue Errno::EROFS
+ # Ignore read-only filesystem against system-installed plugins; regular
+ # users are not supposed to write there.
+ raise unless @system
Copy link
Member

Choose a reason for hiding this comment

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

Is this some kind of registry of installed plugins or what does this function do?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure.

Copy link
Member

@calbrecht calbrecht left a comment

Choose a reason for hiding this comment

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

Tested installation in a user environment. vagrant-libvirt is present as system plugin afterwards and works as expected.

I'm just wondering why the sha256 changed for the mini_portile2 gem.

@mat8913
Copy link
Contributor Author

mat8913 commented Dec 19, 2018

@calbrecht I think you might have accidentally put the wrong hash. 0gzfmcywp1da8nzfqsql2zqi648mfnx6qwkig3cv36n9m0yy676y seems to be the hash for netrc, as seen here:

netrc = {
source = {
remotes = ["https://rubygems.org"];
sha256 = "0gzfmcywp1da8nzfqsql2zqi648mfnx6qwkig3cv36n9m0yy676y";
type = "gem";
};
version = "0.11.0";
};

@Mic92 Mic92 merged commit da09302 into NixOS:master Dec 19, 2018
@Mic92
Copy link
Member

Mic92 commented Dec 19, 2018

Thanks!

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

5 participants