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 plugin install updates depencies irrelevant to the plugin being installed #4278

Closed
Tyrael opened this issue Aug 1, 2014 · 2 comments
Milestone

Comments

@Tyrael
Copy link

Tyrael commented Aug 1, 2014

When I was hit by #3769 I noticed a strange behavior from vagrant plugin install: even installing vagrant plugins without any immediate or transitive dependency to nokogiri tries to install/update it.
This was also noticed in devopsgroup-io/vagrant-hostmanager#110 and @sciurus suggested to report this as a separate issue for more visibility.
Here is my original comment from #3769 :

I did a little bit more digging why does vagrant try to upgrade nokogiri when installing a plugin which seemingly doesn't have any dependency for it.
It seems that we are generating a bunch of gemfiles (10 gemfile and 3 lockfile for me) on a simple plugin install (it is already reported at #4103)
But based on my tests, it seems that the unnecessary plugin upgrade is caused by a lockfile, which shouldn't even be loaded according to the commit message in
5197d3d
At least non of the other gem/lockfiles generated by the plugin install command has any reference to the nokogiri 1.6.3.1 version, only to the pre-installed 1.6.2.1.

for testing/reproducing the issue, one should remove any other nokogiri gem from ~./.vagrant.d via

rm ~/.vagrant.d/gems/specifications/nokogiri-*.gemspec
rm -rf ~/.vagrant.d/gems/gems/nokogiri-*

then create a directory for the tmp files (so you don't have to look up your ruby tmpdir and tell apart the old vagrant gem/lockfiles from the ones created in this test)

mkdir vagrant_tmp

then execute a plugin install with a plugin which doesn't have nokogiri dependency, I choose vagrant-hostmanager:

vagrant plugin uninstall vagrant-hostmanager
TMPDIR=$PWD"/vagrant_tmp" vagrant plugin install --debug --verbose vagrant-hostmanager

this will trigger the nokogiri install (at least on my system), and leave behind a bunch of files in vagrant_tmp:

[tyrael@Ferencs-MacBook-Pro-135 ~ ]$ grep nokogiri -R vagrant_tmp/
vagrant_tmp//vagrant-gemfile20140731-13145-1nvjfol.lock:      nokogiri
vagrant_tmp//vagrant-gemfile20140731-13145-1nvjfol.lock:    nokogiri (1.6.3.1)
vagrant_tmp//vagrant-gemfile20140731-13145-1nvjfol.lock:      nokogiri (>= 1.4.0)
vagrant_tmp//vagrant-gemfile20140731-13145-1nvjfol.lock:      nokogiri (>= 1.4.0)
vagrant_tmp//vagrant-gemfile20140731-13145-1nvjfol.lock:      nokogiri (~> 1.5)
vagrant_tmp//vagrant20140731-13145-yh83sw2.lock:      nokogiri
vagrant_tmp//vagrant20140731-13145-yh83sw2.lock:    nokogiri (1.6.2.1)
vagrant_tmp//vagrant20140731-13145-yh83sw2.lock:      nokogiri (>= 1.4.0)
vagrant_tmp//vagrant20140731-13145-yh83sw2.lock:      nokogiri (>= 1.4.0)
vagrant_tmp//vagrant20140731-13145-yh83sw2.lock:      nokogiri (~> 1.5)

but only the vagrant-gemfile (which should be ignore according to @mitchellh's commit refers to the latest nokogiri version.

@mitchellh
Copy link
Contributor

I think there is another issue tracking this same thing. If I find it I'll update this thread, but this is a known bug. Thanks.

@sethvargo
Copy link
Contributor

This should be fixed in the next release where we properly cleanup tempfiles. There's also another issue that discusses installing plugins in complete isolation which would completely alleviate this. Thanks! 😄

@hashicorp hashicorp locked and limited conversation to collaborators Apr 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants