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

Force strict dependencies for default gems #13336

Merged
merged 1 commit into from
Jan 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions lib/vagrant/bundler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -523,10 +523,20 @@ def internal_install(plugins, update, **extra)
if Vagrant.strict_dependency_enforcement
@logger.debug("Enabling strict dependency enforcement")
plugin_deps += vagrant_internal_specs.map do |spec|
next if system_plugins.include?(spec.name)
# If this spec is for a default plugin included in
# the ruby stdlib, ignore it
next if spec.default_gem?
# NOTE: When working within bundler, skip any system plugins and
# default gems. However, when not within bundler (in the installer)
# include them as strict dependencies to prevent the resolver from
# attempting to create a solution with a newer version. The request
# set does allow for resolving conservatively but it can't be set
# from the public API (requires an instance variable set on the resolver
# instance) so strict dependencies are used instead.
if Vagrant.in_bundler?
next if system_plugins.include?(spec.name)
# # If this spec is for a default plugin included in
# # the ruby stdlib, ignore it
next if spec.default_gem?
end

# If we are not running within the installer and
# we are not within a bundler environment then we
# only want activated specs
Expand Down