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

Fix overly strict dependency requirement of the logger gem to allow plugin installation #13532

Merged
merged 2 commits into from
Nov 4, 2024

Conversation

brlin-tw
Copy link
Contributor

@brlin-tw brlin-tw commented Nov 4, 2024

Vagrant version 2.4.2 introduced a patch(512bb74) that sets the logger gem dependency to "~>1.6.1", which is too strict and prevents many Vagrant plugins from being installed.

This patch tones down the dependency specification to mitigate this problem.

Fixes #13527.

Refer-to: Add logger and ostruct to the gemspec by hswong3i · Pull Request #13499 · hashicorp/vagrant #13499

I'm not acquainted with Ruby, RubyGems, and the usage of the logger gem in Vagrant, please review.

…lugin installation

Vagrant version 2.4.2 introduced a patch(512bb74) that sets the logger gem dependency to "~>1.6.1", which is too strict and prevents many Vagrant plugins from being installed.

This patch tones down the dependency specification to mitigate this problem.

Fixes hashicorp#13527.

Refer-to: Add logger and ostruct to the gemspec by hswong3i · Pull Request hashicorp#13499 · hashicorp/vagrant <hashicorp#13499>
@brlin-tw
Copy link
Contributor Author

brlin-tw commented Nov 4, 2024

I can verify that the patched version works at my end.

@pranabdas
Copy link

Just curious: on my MacOS system, I do not see all the dependencies listed in this file installed locally (with gem list --local). Why is the newly added logger looking for locally installed gems? I suppose there should be a better way to handle dependencies, either bundle them together with vagrant or run an installation script to install/upgrade gems without user interaction 🤔

Copy link
Member

@chrisroberts chrisroberts left a comment

Choose a reason for hiding this comment

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

Thank you for this PR! Just FYI that I did further relax this constraint.

@chrisroberts
Copy link
Member

@pranabdas The gems that are installed will not be listed with the gem command. Vagrant uses an isolated installation area for gems (two, actually: one for Vagrant's direct dependencies that's in /opt/vagrant/embedded/gems and one for plugin installs that's in $VAGRANT_HOME/gems) so the output of gem list will not include them.

@chrisroberts chrisroberts merged commit e0161e5 into hashicorp:main Nov 4, 2024
12 checks passed
@brlin-tw brlin-tw deleted the patch/fix-plugin-installation branch November 4, 2024 17:05
hswong3i added a commit to alvistack/hashicorp-vagrant that referenced this pull request Nov 5, 2024
    git clean -xdf
    git submodule sync --recursive
    git submodule update --recursive --init
    git submodule foreach --recursive git clean -xdf
    gem build vagrant.gemspec -o ../vagrant-2.4.2.gem
    bundle config set --local path ./bundle
    bundle install --verbose --standalone
    bundle config set --local cache_all true
    bundle config set --local cache_all_platforms true
    bundle cache
    mv ../vagrant-2.4.2.gem ./vendor/cache/
    rm -rf .bundle bundle vendor/bundle Gemfile.lock
    tar zcvf ../vagrant_2.4.2.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp vagrant.spec ../vagrant_2.4.2-1.spec
    cp vagrant.rpmlintrc /osc/home\:alvistack/hashicorp-vagrant-2.4.2/
    cp ../vagrant*2.4.2*.{gz,xz,spec,dsc} /osc/home\:alvistack/hashicorp-vagrant-2.4.2/
    rm -rf ../vagrant*2.4.2*.*

See https://salsa.debian.org/ruby-team/vagrant/-/blob/master/debian/patches/0001-bin-vagrant-silence-warning-about-installer.patch
See https://salsa.debian.org/ruby-team/vagrant/-/blob/master/debian/patches/0005-Relax-dependency-resolution.patch
See https://build.opensuse.org/package/show/openSUSE:Factory/vagrant
See hashicorp#13532

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
@gdbonino
Copy link

gdbonino commented Nov 6, 2024

Is there any way to install plugins with 2.4.2 installed? Or do I necessarily have to wait for the new version of vagrant to be released?

@brlin-tw
Copy link
Contributor Author

brlin-tw commented Nov 6, 2024

@gdbonino

Is there any way to install plugins with 2.4.2 installed? Or do I necessarily have to wait for the new version of vagrant to be released?

There's an environment variable that can be set to workaround the problem, check the source issue for more information.

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

Successfully merging this pull request may close these issues.

Vagrant plugins cannot be installed anymore for vagrant 2.4.2
4 participants