vagrant plugin install reinstalls all plugins

Skip to first unread message

Darragh Bailey

Mar 23, 2021, 12:32:49 PM3/23/21
to Vagrant

I'm noticing that if I have a set of plugins installed that any subsequent plugin install will trigger reinstalling of all of the existing plugins even if there has been no changes to the versions of the plugins installed or their dependencies.

Is this intentional or unexpected?

When I enable debug output I see a dependency list of gems for installation, a report on activating a solution set, followed by removal of activation request from install as already installed for specific gems, which appears to only include the gems bundled with vagrant, it doesn't include any of the dependencies that appear under the user global ~/.vagrant.d/gems/<ruby-version>/gems/

The reason this is of interest is that due to library conflicts between distros and the released package via, that appear for gems with native extensions. Possibly doesn't impact many, but it's definitely been an issue for vagrant-libvirt. Hence I've been looking at providing a docker based image containing vagrant + vagrant-libvirt using a distro release that is known working.

The behaviour of reinstalling the plugins every time impacts the ability for people to extend the image. Potentially this is less of an issue with the support for installing plugins locally to a project, but for teams wanting to provide an pre-build docker image for CI or to ensure consistency across multiple projects to provide the same versions for all team members it can be an issue. Additionally installing vagrant-libvirt locally isn't much good if it's simply not possible due to library conflicts between what the embedded ruby was build against versus what the libvirt library was compiled against, and thus preventing ruby-libvirt from either building, or subsequently loading.

The reason I spotted this was, I was installing a plugin that I thought was pure ruby and yet I saw the lines about native extensions appearing in the output:
Building native extensions. This could take a while...
Building native extensions. This could take a while...

Digging deeper I noticed that all of the gems under the global config directory for the current vagrant install were getting updated timestamps even though all except the one I'd requested to install had already been present due to being dependencies of vagrant-libvirt

It looks like it goes through the process of detecting all of the dependencies, but only recognizing those bundled with the ruby install under /opt/vagrant/embedded/lib/ruby/2.6.0/ and /opt/vagrant/embedded/lib/ruby/gems/2.6.0/gems/, along with the ones needed by vagrant itself under /opt/vagrant/embedded/gems/2.2.13/gems/ as already installed, ignoring the any under ~/.vagrant.d/gems/2.6.6/gems/, which are the following gems:

With the last 4 being the plugins installed, and the preceding ones being any dependencies.


Reply all
Reply to author
0 new messages