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.2.3 -> 2.2.5 #64302

Merged
merged 1 commit into from Aug 2, 2019
Merged

vagrant: 2.2.3 -> 2.2.5 #64302

merged 1 commit into from Aug 2, 2019

Conversation

angristan
Copy link
Member

@angristan angristan commented Jul 4, 2019

Motivation for this change

Fixes #64243.

FYI, it is written:

NOTE: bumping the version and updating the hash is insufficient;
you must use bundix to generate a new gemset.nix in the Vagrant source.

However doing this did work for me:

stanislas@nixpsla ~/n/p/d/t/vagrant> (vagrant/update/2.2.5|✚1) ./result/bin/vagrant version
Installed Version: 2.2.5
Latest Version: 2.2.5
 
You're running an up-to-date version of Vagrant!

Now, I am interested to know how to update the gems without the Gemfile. I saw #47519 (comment) but it's doing weird stuff for me.

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 nix-review --run "nix-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @aneeshusa

@angristan
Copy link
Member Author

angristan commented Jul 4, 2019

FYI by using Vagrant's Gemfile + bundle + bundix, I'm getting this: gemset.nix.txt which seems weirdly... long?

@nixos-discourse
Copy link

This pull request has been mentioned on Nix community. There might be relevant details there:

https://discourse.nixos.org/t/prs-already-reviewed/2617/47

@worldofpeace
Copy link
Contributor

Perhaps @alyssais and @manveru could help you with this.

I don't think I see any reason that the gemset.nix would be generated improperly.

@angristan
Copy link
Member Author

In any case, we need some clear documentation/script to update vagrant once this is settled! 🙂

@manveru
Copy link
Contributor

manveru commented Jul 31, 2019

Well, I can explain it a bit later, a working version is at: manveru@c2b5d07 for now
You basically have to make a Gemfile because bundix doesn't support the gemspec method yet. It looks like this:

# frozen_string_literal: true

source 'https://rubygems.org' do
  gem 'bcrypt_pbkdf', '~> 1.0.0'
  gem 'childprocess', '~> 0.6.0'
  gem 'ed25519', '~> 1.2.4'
  gem 'erubis', '~> 2.7.0'
  gem 'hashicorp-checkpoint', '~> 0.1.5'
  gem 'i18n', '~> 1.1.1'
  gem 'listen', '~> 3.1.5'
  gem 'log4r', '~> 1.1.9', '< 1.1.11'
  gem 'net-scp', '~> 1.2.0'
  gem 'net-sftp', '~> 2.1'
  gem 'net-ssh', '~> 5.1.0'
  gem 'rb-kqueue', '~> 0.2.0'
  gem 'rest-client', '>= 1.6.0', '< 3.0'
  gem 'ruby_dep', '<= 1.3.1'
  gem 'rubyzip', '~> 1.2.2'
  gem 'vagrant-spec', git: 'https://github.com/hashicorp/vagrant-spec.git'
  gem 'vagrant_cloud', '~> 2.0.2'
  gem 'wdm', '~> 0.1.0'
  gem 'winrm', '~> 2.1'
  gem 'winrm-elevated', '~> 1.1'
  gem 'winrm-fs', '~> 1.0'
end

is taken from the dependencies in the Gemfile and gemspec files in the vagrant repo.
Then you can run nix-shell --pure -p bundler bundix git --run 'bundle lock && bundix' to generate the gemspec.nix.

@angristan
Copy link
Member Author

angristan commented Jul 31, 2019

Thanks for posting this! 🙂

If I understand correctly you manually created a Gemfile using:

https://github.com/hashicorp/vagrant/blob/5d4c9ef8a74df967f6f24867360d4f6e1f3705ff/vagrant.gemspec#L19..#L43

Thus... don't we keep our own Gemfile (or why did we remove it) in nixpkgs/pkgs/development/tools/vagrant/Gemfile? It seems very bothersome to manually create a new one each time (+ how are newcomers supposed to know?). I understand we can regenerate the Gemfile.lock but we need that Gemfile.

Then, I suppose there are some missing steps when using nix-shell:

stanislas@nixpsla ~/n/p/d/t/vagrant> (vagrant/update/2.2.5|…) nix-shell --pure -p bundler bundix git --run 'bundle lock && bundix'
Fetching https://github.com/hashicorp/vagrant-spec.git
There was an error accessing `/nix/store/glhmssxi9zpw6r84ws2zdyw2hfvpsnm2-ruby-2.5.5/lib/ruby/gems/2.5.0/cache/bundler/git`.
The underlying system error is Errno::EROFS: Read-only file system @ dir_s_mkdir -
/nix/store/glhmssxi9zpw6r84ws2zdyw2hfvpsnm2-ruby-2.5.5/lib/ruby/gems/2.5.0/cache/bundler

Without using nix-shell, which I know I shouldn't, it works (with warnings though):

stanislas@nixpsla ~/n/p/d/t/vagrant> (vagrant/update/2.2.5|…) pwd
/home/stanislas/nixpkgs/pkgs/development/tools/vagrant
stanislas@nixpsla ~/n/p/d/t/vagrant> (vagrant/update/2.2.5|…) ll
.rw-r--r-- 3,3k stanislas users  7 mai   17:25 -- 0004-Support-system-installed-plugins.patch
.rw-r--r-- 3,2k stanislas users 31 juil. 15:36 -- default.nix
.rw-r--r--  749 stanislas users 31 juil. 15:44 -N Gemfile
.rw-r--r--  12k stanislas users  4 juil. 15:32 -- gemset.nix
.rw-r--r-- 3,0k stanislas users  7 mai   17:25 -- gemset_libvirt.nix
lrwxrwxrwx   57 stanislas users  4 juil. 15:49 -- result -> /nix/store/iqah7ygpsvyghfsz7cflc4pcpzy9m532-vagrant-2.2.5
.rw-r--r--  439 stanislas users  7 mai   17:25 -- unofficial-installation-nowarn.patch
.rw-r--r--  475 stanislas users  7 mai   17:25 -- use-system-bundler-version.patch
.rw-r--r--  168 stanislas users  7 mai   17:25 -- vagrant-libvirt.json.in
stanislas@nixpsla ~/n/p/d/t/vagrant> (vagrant/update/2.2.5|…) bundle lock
Following files may not be writable, so sudo is needed:
  /nix/store/8hwd3zmw07ag6gar799kn5d5fxfh9qnw-ruby-2.6.3/bin
  /nix/store/8hwd3zmw07ag6gar799kn5d5fxfh9qnw-ruby-2.6.3/lib/ruby/gems/2.6.0
  /nix/store/8hwd3zmw07ag6gar799kn5d5fxfh9qnw-ruby-2.6.3/lib/ruby/gems/2.6.0/build_info
  /nix/store/8hwd3zmw07ag6gar799kn5d5fxfh9qnw-ruby-2.6.3/lib/ruby/gems/2.6.0/cache
  /nix/store/8hwd3zmw07ag6gar799kn5d5fxfh9qnw-ruby-2.6.3/lib/ruby/gems/2.6.0/doc
  /nix/store/8hwd3zmw07ag6gar799kn5d5fxfh9qnw-ruby-2.6.3/lib/ruby/gems/2.6.0/extensions
  /nix/store/8hwd3zmw07ag6gar799kn5d5fxfh9qnw-ruby-2.6.3/lib/ruby/gems/2.6.0/gems
  /nix/store/8hwd3zmw07ag6gar799kn5d5fxfh9qnw-ruby-2.6.3/lib/ruby/gems/2.6.0/nix
  /nix/store/8hwd3zmw07ag6gar799kn5d5fxfh9qnw-ruby-2.6.3/lib/ruby/gems/2.6.0/specifications
Fetching https://github.com/hashicorp/vagrant-spec.git
Fetching gem metadata from https://rubygems.org/............
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Writing lockfile to /home/stanislas/nixpkgs/pkgs/development/tools/vagrant/Gemfile.lock
stanislas@nixpsla ~/n/p/d/t/vagrant> (vagrant/update/2.2.5|…) ll
.rw-r--r-- 3,3k stanislas users  7 mai   17:25 -- 0004-Support-system-installed-plugins.patch
.rw-r--r-- 3,2k stanislas users 31 juil. 15:36 -- default.nix
.rw-r--r--  749 stanislas users 31 juil. 15:44 -N Gemfile
.rw-r--r-- 3,1k stanislas users 31 juil. 15:48 -N Gemfile.lock
.rw-r--r--  12k stanislas users  4 juil. 15:32 -- gemset.nix
.rw-r--r-- 3,0k stanislas users  7 mai   17:25 -- gemset_libvirt.nix
lrwxrwxrwx   57 stanislas users  4 juil. 15:49 -- result -> /nix/store/iqah7ygpsvyghfsz7cflc4pcpzy9m532-vagrant-2.2.5
.rw-r--r--  439 stanislas users  7 mai   17:25 -- unofficial-installation-nowarn.patch
.rw-r--r--  475 stanislas users  7 mai   17:25 -- use-system-bundler-version.patch
.rw-r--r--  168 stanislas users  7 mai   17:25 -- vagrant-libvirt.json.in
stanislas@nixpsla ~/n/p/d/t/vagrant> (vagrant/update/2.2.5|…) bundix
19vxrclxc5l8n2agwvv291740s6gna2phg3lkybjb0ldkmpi3sj2 => winrm-2.3.2.gem
1ll6w64ibh81qwvjx19h8nj7mngxgffg7aigjx11klvf5k2g4nxf => unf_ext-0.0.7.6.gem
1w9gw28ly3zyqydnm8phxchf4ymyjl2r7zf7c12z8kla10cpmhlc => rubyzip-1.2.3.gem
1m00pg19cm47n1qlcxgl91ajh2yq0fszvn1vy8fy0s1jkrp9fw4a => mime-types-data-3.2019.0331.gem
13l6pqbfrx3vv7cw26nq9p8rnyp9br31gaz85q32wx6hnzfcriwh => gssapi-1.3.0.gem
06mvxpjply8qh4j3fj9wh08kdzwkbnvsiysh0vrhlk5cwxzjmblh => ffi-1.11.1.gem
0lcqjsmixjp52bnlgzh4lg9ppsk52x9hpwdjd53k8jnbah2602h0 => domain_name-0.5.20190701.gem
1x07r23s7836cpp5z9yrlbpljcxpax14yw4fy4bnp6crhr6x24an => concurrent-ruby-1.1.5.gem
02vssr285m7kpsr47jdmzbar1h1d0mnkmyrpr1zg828isfmwii35 => bcrypt_pbkdf-1.0.1.gem
stanislas@nixpsla ~/n/p/d/t/vagrant> (vagrant/update/2.2.5|✚1…) ll
.rw-r--r-- 3,3k stanislas users  7 mai   17:25 -- 0004-Support-system-installed-plugins.patch
.rw-r--r-- 3,2k stanislas users 31 juil. 15:36 -- default.nix
.rw-r--r--  749 stanislas users 31 juil. 15:44 -N Gemfile
.rw-r--r-- 3,1k stanislas users 31 juil. 15:48 -N Gemfile.lock
.rw-r--r--  11k stanislas users 31 juil. 15:48 -M gemset.nix
.rw-r--r-- 3,0k stanislas users  7 mai   17:25 -- gemset_libvirt.nix
lrwxrwxrwx   57 stanislas users  4 juil. 15:49 -- result -> /nix/store/iqah7ygpsvyghfsz7cflc4pcpzy9m532-vagrant-2.2.5
.rw-r--r--  439 stanislas users  7 mai   17:25 -- unofficial-installation-nowarn.patch
.rw-r--r--  475 stanislas users  7 mai   17:25 -- use-system-bundler-version.patch
.rw-r--r--  168 stanislas users  7 mai   17:25 -- vagrant-libvirt.json.in

@Ma27
Copy link
Member

Ma27 commented Aug 2, 2019

@GrahamcOfBorg build vagrant

Copy link
Member

@Ma27 Ma27 left a comment

Choose a reason for hiding this comment

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

Built and tested locally. Regarding the Gemfile discussion: I agree that we should either add a Gemfile for vagrant and/or leave a comment on how to regenerate vagrant's gemset.nix.

However I'd prefer to have an up-to-date version of vagrant on master and release-19.03 now, so I'll merge this for now, feel free to improve the documentation for this package in a separate PR and ping me :)

@Ma27 Ma27 merged commit a3eab9e into NixOS:master Aug 2, 2019
@Ma27
Copy link
Member

Ma27 commented Aug 2, 2019

@angristan thanks!
Backported as 25eb016

@angristan
Copy link
Member Author

Ok, thanks!

@angristan
Copy link
Member Author

I think I will do a PR to add the Gemfile back. What would be a good place to add documentation (besides a comment in the Gemfile?)

@Ma27
Copy link
Member

Ma27 commented Aug 2, 2019

I think I will do a PR to add the Gemfile back. What would be a good place to add documentation (besides a comment in the Gemfile?)

As this is only relevant for folks who want to modify the vagrant package it should be sufficient to enhance the comment :)

@angristan angristan mentioned this pull request Aug 2, 2019
10 tasks
@angristan
Copy link
Member Author

After thinking a bit about it, adding an update script is better than revendoring Gemfile and Gemfile.lock. See #65800 (need some feedback!)

angristan added a commit to angristan/nixpkgs that referenced this pull request Aug 5, 2019
Since Gemfile and Gemfile.lock were removed in 16a8e49, we need an easy to update the gemset.nix using the Vagrant source.

This update.sh script updates the version and hash of vagrant and generates a new gemset.nix using a temporary copy of the vagrant source code.

See discussion in NixOS#64302
Ma27 added a commit to Ma27/nixpkgs that referenced this pull request Nov 6, 2019
https://github.com/hashicorp/vagrant/releases/tag/v2.2.6

Generated the `gemset.nix` by converting the `vagrant.gemspec` file to a
different `Gemfile` as described in the previous update PR[1].

[1] NixOS#64302 (comment)
@Ma27 Ma27 mentioned this pull request Nov 6, 2019
10 tasks
Ma27 added a commit that referenced this pull request Dec 4, 2019
https://github.com/hashicorp/vagrant/releases/tag/v2.2.6

Generated the `gemset.nix` by converting the `vagrant.gemspec` file to a
different `Gemfile` as described in the previous update PR[1].

[1] #64302 (comment)

(cherry picked from commit 728f7a7)
dtzWill pushed a commit to dtzWill/nixpkgs that referenced this pull request Dec 4, 2019
https://github.com/hashicorp/vagrant/releases/tag/v2.2.6

Generated the `gemset.nix` by converting the `vagrant.gemspec` file to a
different `Gemfile` as described in the previous update PR[1].

[1] NixOS#64302 (comment)

(cherry picked from commit 728f7a7)
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.

Vagrant is out-of-date (2.2.3 -> 2.2.5)
6 participants