bundler 2.6.9 → 2.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1136 -1033
- data/README.md +7 -7
- data/bundler.gemspec +2 -2
- data/lib/bundler/build_metadata.rb +10 -11
- data/lib/bundler/checksum.rb +6 -0
- data/lib/bundler/cli/cache.rb +0 -1
- data/lib/bundler/cli/common.rb +1 -1
- data/lib/bundler/cli/config.rb +2 -2
- data/lib/bundler/cli/gem.rb +62 -30
- data/lib/bundler/cli/install.rb +5 -7
- data/lib/bundler/cli/lock.rb +5 -5
- data/lib/bundler/cli/outdated.rb +1 -1
- data/lib/bundler/cli/show.rb +2 -6
- data/lib/bundler/cli/update.rb +3 -3
- data/lib/bundler/cli.rb +45 -49
- data/lib/bundler/compact_index_client.rb +1 -5
- data/lib/bundler/current_ruby.rb +27 -3
- data/lib/bundler/definition.rb +97 -81
- data/lib/bundler/dependency.rb +1 -1
- data/lib/bundler/dsl.rb +34 -24
- data/lib/bundler/feature_flag.rb +15 -12
- data/lib/bundler/fetcher/dependency.rb +2 -1
- data/lib/bundler/fetcher/downloader.rb +33 -7
- data/lib/bundler/fetcher.rb +49 -19
- data/lib/bundler/friendly_errors.rb +2 -1
- data/lib/bundler/index.rb +7 -2
- data/lib/bundler/installer.rb +5 -4
- data/lib/bundler/lazy_specification.rb +9 -7
- data/lib/bundler/lockfile_parser.rb +21 -5
- data/lib/bundler/man/bundle-add.1 +1 -1
- data/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/lib/bundler/man/bundle-cache.1 +1 -1
- data/lib/bundler/man/bundle-check.1 +1 -1
- data/lib/bundler/man/bundle-clean.1 +1 -1
- data/lib/bundler/man/bundle-config.1 +200 -137
- data/lib/bundler/man/bundle-config.1.ronn +138 -109
- data/lib/bundler/man/bundle-console.1 +1 -1
- data/lib/bundler/man/bundle-doctor.1 +43 -4
- data/lib/bundler/man/bundle-doctor.1.ronn +48 -4
- data/lib/bundler/man/bundle-env.1 +1 -1
- data/lib/bundler/man/bundle-exec.1 +1 -1
- data/lib/bundler/man/bundle-fund.1 +1 -1
- data/lib/bundler/man/bundle-gem.1 +67 -44
- data/lib/bundler/man/bundle-gem.1.ronn +8 -4
- data/lib/bundler/man/bundle-help.1 +1 -1
- data/lib/bundler/man/bundle-info.1 +1 -1
- data/lib/bundler/man/bundle-init.1 +1 -1
- data/lib/bundler/man/bundle-inject.1 +2 -2
- data/lib/bundler/man/bundle-inject.1.ronn +1 -1
- data/lib/bundler/man/bundle-install.1 +4 -4
- data/lib/bundler/man/bundle-install.1.ronn +3 -4
- data/lib/bundler/man/bundle-issue.1 +1 -1
- data/lib/bundler/man/bundle-licenses.1 +1 -1
- data/lib/bundler/man/bundle-list.1 +1 -1
- data/lib/bundler/man/bundle-lock.1 +1 -1
- data/lib/bundler/man/bundle-open.1 +1 -1
- data/lib/bundler/man/bundle-outdated.1 +1 -1
- data/lib/bundler/man/bundle-platform.1 +1 -1
- data/lib/bundler/man/bundle-plugin.1 +40 -15
- data/lib/bundler/man/bundle-plugin.1.ronn +44 -15
- data/lib/bundler/man/bundle-pristine.1 +1 -1
- data/lib/bundler/man/bundle-remove.1 +1 -1
- data/lib/bundler/man/bundle-show.1 +1 -1
- data/lib/bundler/man/bundle-update.1 +5 -5
- data/lib/bundler/man/bundle-update.1.ronn +4 -4
- data/lib/bundler/man/bundle-version.1 +1 -1
- data/lib/bundler/man/bundle-viz.1 +1 -1
- data/lib/bundler/man/bundle.1 +1 -1
- data/lib/bundler/man/gemfile.5 +1 -1
- data/lib/bundler/match_platform.rb +31 -12
- data/lib/bundler/materialization.rb +2 -2
- data/lib/bundler/resolver/package.rb +2 -1
- data/lib/bundler/resolver.rb +1 -3
- data/lib/bundler/rubygems_ext.rb +116 -120
- data/lib/bundler/rubygems_integration.rb +11 -6
- data/lib/bundler/runtime.rb +1 -1
- data/lib/bundler/self_manager.rb +32 -42
- data/lib/bundler/settings/validator.rb +0 -23
- data/lib/bundler/settings.rb +4 -6
- data/lib/bundler/shared_helpers.rb +6 -4
- data/lib/bundler/source/gemspec.rb +4 -0
- data/lib/bundler/source/git/git_proxy.rb +3 -3
- data/lib/bundler/source/path.rb +9 -0
- data/lib/bundler/source_list.rb +1 -5
- data/lib/bundler/source_map.rb +1 -1
- data/lib/bundler/spec_set.rb +7 -3
- data/lib/bundler/templates/Executable +0 -11
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +2 -0
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +6 -5
- data/lib/bundler/ui/shell.rb +2 -2
- data/lib/bundler/vendor/net-http-persistent/README.rdoc +1 -1
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +2 -1
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +81 -42
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +42 -6
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +3 -7
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/version.rb +10 -2
- data/lib/bundler/worker.rb +1 -1
- data/lib/bundler.rb +14 -12
- metadata +4 -14
- data/lib/bundler/gem_helpers.rb +0 -144
- data/lib/bundler/templates/Executable.bundler +0 -109
- data/lib/bundler/vendor/connection_pool/.document +0 -1
- data/lib/bundler/vendor/fileutils/.document +0 -1
- data/lib/bundler/vendor/net-http-persistent/.document +0 -1
- data/lib/bundler/vendor/pub_grub/.document +0 -1
- data/lib/bundler/vendor/securerandom/.document +0 -1
- data/lib/bundler/vendor/thor/.document +0 -1
- data/lib/bundler/vendor/tsort/.document +0 -1
- data/lib/bundler/vendor/uri/.document +0 -1
data/lib/bundler/cli.rb
CHANGED
|
@@ -77,7 +77,7 @@ module Bundler
|
|
|
77
77
|
self.options ||= {}
|
|
78
78
|
unprinted_warnings = Bundler.ui.unprinted_warnings
|
|
79
79
|
Bundler.ui = UI::Shell.new(options)
|
|
80
|
-
Bundler.ui.level = "debug" if options[
|
|
80
|
+
Bundler.ui.level = "debug" if options[:verbose] || Bundler.settings[:verbose]
|
|
81
81
|
unprinted_warnings.each {|w| Bundler.ui.warn(w) }
|
|
82
82
|
end
|
|
83
83
|
|
|
@@ -130,7 +130,7 @@ module Bundler
|
|
|
130
130
|
|
|
131
131
|
if man_pages.include?(command)
|
|
132
132
|
man_page = man_pages[command]
|
|
133
|
-
if Bundler.which("man") && !man_path.match?(%r{^file
|
|
133
|
+
if Bundler.which("man") && !man_path.match?(%r{^(?:file:/.+!|uri:classloader:)/META-INF/jruby.home/.+})
|
|
134
134
|
Kernel.exec("man", man_page)
|
|
135
135
|
else
|
|
136
136
|
puts File.read("#{man_path}/#{File.basename(man_page)}.ronn")
|
|
@@ -220,7 +220,7 @@ module Bundler
|
|
|
220
220
|
method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
|
|
221
221
|
method_option "prefer-local", type: :boolean, banner: "Only attempt to fetch gems remotely if not present locally, even if newer versions are available remotely"
|
|
222
222
|
method_option "no-cache", type: :boolean, banner: "Don't update the existing gem cache."
|
|
223
|
-
method_option "
|
|
223
|
+
method_option "force", type: :boolean, aliases: "--redownload", banner: "Force reinstalling every gem, even if already installed"
|
|
224
224
|
method_option "no-prune", type: :boolean, banner: "Don't remove stale gems from the cache."
|
|
225
225
|
method_option "path", type: :string, banner: "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME).#{" Bundler will remember this value for future installs on this machine" unless Bundler.feature_flag.forget_cli_options?}"
|
|
226
226
|
method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
|
|
@@ -232,15 +232,13 @@ module Bundler
|
|
|
232
232
|
method_option "without", type: :array, banner: "Exclude gems that are part of the specified named group."
|
|
233
233
|
method_option "with", type: :array, banner: "Include gems that are part of the specified named group."
|
|
234
234
|
def install
|
|
235
|
-
SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
|
|
236
|
-
|
|
237
235
|
%w[clean deployment frozen no-prune path shebang without with].each do |option|
|
|
238
236
|
remembered_flag_deprecation(option)
|
|
239
237
|
end
|
|
240
238
|
|
|
241
239
|
print_remembered_flag_deprecation("--system", "path.system", "true") if ARGV.include?("--system")
|
|
242
240
|
|
|
243
|
-
|
|
241
|
+
remembered_flag_deprecation("deployment", negative: true)
|
|
244
242
|
|
|
245
243
|
require_relative "cli/install"
|
|
246
244
|
Bundler.settings.temporary(no_install: false) do
|
|
@@ -263,7 +261,7 @@ module Bundler
|
|
|
263
261
|
method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
|
|
264
262
|
method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
|
|
265
263
|
method_option "source", type: :array, banner: "Update a specific source (and all gems associated with it)"
|
|
266
|
-
method_option "
|
|
264
|
+
method_option "force", type: :boolean, aliases: "--redownload", banner: "Force reinstalling every gem, even if already installed"
|
|
267
265
|
method_option "ruby", type: :boolean, banner: "Update ruby specified in Gemfile.lock"
|
|
268
266
|
method_option "bundler", type: :string, lazy_default: "> 0.a", banner: "Update the locked version of bundler"
|
|
269
267
|
method_option "patch", type: :boolean, banner: "Prefer updating only to next patch version"
|
|
@@ -274,7 +272,6 @@ module Bundler
|
|
|
274
272
|
method_option "conservative", type: :boolean, banner: "Use bundle install conservative update behavior and do not allow shared dependencies to be updated."
|
|
275
273
|
method_option "all", type: :boolean, banner: "Update everything."
|
|
276
274
|
def update(*gems)
|
|
277
|
-
SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
|
|
278
275
|
require_relative "cli/update"
|
|
279
276
|
Bundler.settings.temporary(no_install: false) do
|
|
280
277
|
Update.new(options, gems).run
|
|
@@ -290,8 +287,8 @@ module Bundler
|
|
|
290
287
|
method_option "outdated", type: :boolean, banner: "Show verbose output including whether gems are outdated."
|
|
291
288
|
def show(gem_name = nil)
|
|
292
289
|
if ARGV.include?("--outdated")
|
|
293
|
-
message = "the `--outdated` flag to `bundle show`
|
|
294
|
-
removed_message = "the `--outdated` flag to `bundle show`
|
|
290
|
+
message = "the `--outdated` flag to `bundle show` will be removed in favor of `bundle show --verbose`"
|
|
291
|
+
removed_message = "the `--outdated` flag to `bundle show` has been removed in favor of `bundle show --verbose`"
|
|
295
292
|
SharedHelpers.major_deprecation(2, message, removed_message: removed_message)
|
|
296
293
|
end
|
|
297
294
|
require_relative "cli/show"
|
|
@@ -331,6 +328,8 @@ module Bundler
|
|
|
331
328
|
method_option "all", type: :boolean, banner: "Install binstubs for all gems"
|
|
332
329
|
method_option "all-platforms", type: :boolean, default: false, banner: "Install binstubs for all platforms"
|
|
333
330
|
def binstubs(*gems)
|
|
331
|
+
remembered_flag_deprecation("path", option_name: "bin")
|
|
332
|
+
|
|
334
333
|
require_relative "cli/binstubs"
|
|
335
334
|
Binstubs.new(options, gems).run
|
|
336
335
|
end
|
|
@@ -413,8 +412,13 @@ module Bundler
|
|
|
413
412
|
D
|
|
414
413
|
def cache
|
|
415
414
|
print_remembered_flag_deprecation("--all", "cache_all", "true") if ARGV.include?("--all")
|
|
415
|
+
print_remembered_flag_deprecation("--no-all", "cache_all", "false") if ARGV.include?("--no-all")
|
|
416
416
|
|
|
417
|
-
|
|
417
|
+
%w[frozen no-prune].each do |option|
|
|
418
|
+
remembered_flag_deprecation(option)
|
|
419
|
+
end
|
|
420
|
+
|
|
421
|
+
if flag_passed?("--path")
|
|
418
422
|
message =
|
|
419
423
|
"The `--path` flag is deprecated because its semantics are unclear. " \
|
|
420
424
|
"Use `bundle config cache_path` to configure the path of your cache of gems, " \
|
|
@@ -486,13 +490,13 @@ module Bundler
|
|
|
486
490
|
def version
|
|
487
491
|
cli_help = current_command.name == "cli_help"
|
|
488
492
|
if cli_help || ARGV.include?("version")
|
|
489
|
-
build_info = " (#{BuildMetadata.
|
|
493
|
+
build_info = " (#{BuildMetadata.timestamp} commit #{BuildMetadata.git_commit_sha})"
|
|
490
494
|
end
|
|
491
495
|
|
|
492
|
-
if !cli_help && Bundler.feature_flag.
|
|
493
|
-
Bundler.ui.info "#{Bundler
|
|
496
|
+
if !cli_help && Bundler.feature_flag.bundler_4_mode?
|
|
497
|
+
Bundler.ui.info "#{Bundler.verbose_version}#{build_info}"
|
|
494
498
|
else
|
|
495
|
-
Bundler.ui.info "Bundler version #{Bundler
|
|
499
|
+
Bundler.ui.info "Bundler version #{Bundler.verbose_version}#{build_info}"
|
|
496
500
|
end
|
|
497
501
|
end
|
|
498
502
|
|
|
@@ -512,18 +516,18 @@ module Bundler
|
|
|
512
516
|
end
|
|
513
517
|
end
|
|
514
518
|
|
|
515
|
-
unless Bundler.feature_flag.
|
|
519
|
+
unless Bundler.feature_flag.bundler_4_mode?
|
|
516
520
|
desc "viz [OPTIONS]", "Generates a visual dependency graph", hide: true
|
|
517
521
|
long_desc <<-D
|
|
518
522
|
Viz generates a PNG file of the current Gemfile as a dependency graph.
|
|
519
523
|
Viz requires the ruby-graphviz gem (and its dependencies).
|
|
520
524
|
The associated gems must also be installed via 'bundle install'.
|
|
521
525
|
D
|
|
522
|
-
method_option :file, type: :string, default: "gem_graph", aliases: "-f",
|
|
523
|
-
method_option :format, type: :string, default: "png", aliases: "-F",
|
|
524
|
-
method_option :requirements, type: :boolean, default: false, aliases: "-R",
|
|
525
|
-
method_option :version, type: :boolean, default: false, aliases: "-v",
|
|
526
|
-
method_option :without, type: :array, default: [], aliases: "-W", banner: "
|
|
526
|
+
method_option :file, type: :string, default: "gem_graph", aliases: "-f", banner: "The name to use for the generated file. see format option"
|
|
527
|
+
method_option :format, type: :string, default: "png", aliases: "-F", banner: "This is output format option. Supported format is png, jpg, svg, dot ..."
|
|
528
|
+
method_option :requirements, type: :boolean, default: false, aliases: "-R", banner: "Set to show the version of each required dependency."
|
|
529
|
+
method_option :version, type: :boolean, default: false, aliases: "-v", banner: "Set to show each gem version."
|
|
530
|
+
method_option :without, type: :array, default: [], aliases: "-W", banner: "Exclude gems that are part of the specified named group."
|
|
527
531
|
def viz
|
|
528
532
|
SharedHelpers.major_deprecation 2, "The `viz` command has been renamed to `graph` and moved to a plugin. See https://github.com/rubygems/bundler-graph"
|
|
529
533
|
require_relative "cli/viz"
|
|
@@ -532,18 +536,19 @@ module Bundler
|
|
|
532
536
|
end
|
|
533
537
|
|
|
534
538
|
desc "gem NAME [OPTIONS]", "Creates a skeleton for creating a rubygem"
|
|
535
|
-
method_option :exe, type: :boolean, default: false, aliases: ["--bin", "-b"],
|
|
536
|
-
method_option :coc, type: :boolean,
|
|
537
|
-
method_option :edit, type: :string, aliases: "-e", required: false,
|
|
538
|
-
method_option :ext, type: :string,
|
|
539
|
-
method_option :git, type: :boolean, default: true,
|
|
540
|
-
method_option :mit, type: :boolean,
|
|
541
|
-
method_option :rubocop, type: :boolean,
|
|
542
|
-
method_option :changelog, type: :boolean,
|
|
539
|
+
method_option :exe, type: :boolean, default: false, aliases: ["--bin", "-b"], banner: "Generate a binary executable for your library."
|
|
540
|
+
method_option :coc, type: :boolean, banner: "Generate a code of conduct file. Set a default with `bundle config set --global gem.coc true`."
|
|
541
|
+
method_option :edit, type: :string, aliases: "-e", required: false, lazy_default: [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? }, banner: "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
|
|
542
|
+
method_option :ext, type: :string, banner: "Generate the boilerplate for C extension code.", enum: EXTENSIONS
|
|
543
|
+
method_option :git, type: :boolean, default: true, banner: "Initialize a git repo inside your library."
|
|
544
|
+
method_option :mit, type: :boolean, banner: "Generate an MIT license file. Set a default with `bundle config set --global gem.mit true`."
|
|
545
|
+
method_option :rubocop, type: :boolean, banner: "Add rubocop to the generated Rakefile and gemspec. Set a default with `bundle config set --global gem.rubocop true`."
|
|
546
|
+
method_option :changelog, type: :boolean, banner: "Generate changelog file. Set a default with `bundle config set --global gem.changelog true`."
|
|
543
547
|
method_option :test, type: :string, lazy_default: Bundler.settings["gem.test"] || "", aliases: "-t", banner: "Use the specified test framework for your library", enum: %w[rspec minitest test-unit], desc: "Generate a test directory for your library, either rspec, minitest or test-unit. Set a default with `bundle config set --global gem.test (rspec|minitest|test-unit)`."
|
|
544
|
-
method_option :ci, type: :string, lazy_default: Bundler.settings["gem.ci"] || "", enum: %w[github gitlab circle],
|
|
545
|
-
method_option :linter, type: :string, lazy_default: Bundler.settings["gem.linter"] || "", enum: %w[rubocop standard],
|
|
548
|
+
method_option :ci, type: :string, lazy_default: Bundler.settings["gem.ci"] || "", enum: %w[github gitlab circle], banner: "Generate CI configuration, either GitHub Actions, GitLab CI or CircleCI. Set a default with `bundle config set --global gem.ci (github|gitlab|circle)`"
|
|
549
|
+
method_option :linter, type: :string, lazy_default: Bundler.settings["gem.linter"] || "", enum: %w[rubocop standard], banner: "Add a linter and code formatter, either RuboCop or Standard. Set a default with `bundle config set --global gem.linter (rubocop|standard)`"
|
|
546
550
|
method_option :github_username, type: :string, default: Bundler.settings["gem.github_username"], banner: "Set your username on GitHub", desc: "Fill in GitHub username on README so that you don't have to do it manually. Set a default with `bundle config set --global gem.github_username <your_username>`."
|
|
551
|
+
method_option :bundle, type: :boolean, default: Bundler.settings["gem.bundle"], banner: "Automatically run `bundle install` after creation. Set a default with `bundle config set --global gem.bundle true`"
|
|
547
552
|
|
|
548
553
|
def gem(name)
|
|
549
554
|
require_relative "cli/gem"
|
|
@@ -720,7 +725,7 @@ module Bundler
|
|
|
720
725
|
end
|
|
721
726
|
command << Thor::Options.to_switches(options_to_print.sort_by(&:first)).strip
|
|
722
727
|
command.reject!(&:empty?)
|
|
723
|
-
Bundler.ui.info "Running `#{command * " "}` with bundler #{Bundler
|
|
728
|
+
Bundler.ui.info "Running `#{command * " "}` with bundler #{Bundler.verbose_version}"
|
|
724
729
|
end
|
|
725
730
|
|
|
726
731
|
def warn_on_outdated_bundler
|
|
@@ -747,30 +752,17 @@ module Bundler
|
|
|
747
752
|
nil
|
|
748
753
|
end
|
|
749
754
|
|
|
750
|
-
def
|
|
751
|
-
positive_name = name.gsub(/\Ano-/, "")
|
|
752
|
-
option = current_command.options[positive_name]
|
|
753
|
-
flag_name = "--no-" + option.switch_name.gsub(/\A--/, "")
|
|
754
|
-
|
|
755
|
-
flag_deprecation(positive_name, flag_name, option)
|
|
756
|
-
end
|
|
757
|
-
|
|
758
|
-
def remembered_flag_deprecation(name)
|
|
755
|
+
def remembered_flag_deprecation(name, negative: false, option_name: nil)
|
|
759
756
|
option = current_command.options[name]
|
|
760
757
|
flag_name = option.switch_name
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
end
|
|
764
|
-
|
|
765
|
-
def flag_deprecation(name, flag_name, option)
|
|
766
|
-
name_index = ARGV.find {|arg| flag_name == arg.split("=")[0] }
|
|
767
|
-
return unless name_index
|
|
758
|
+
flag_name = "--no-" + flag_name.gsub(/\A--/, "") if negative
|
|
759
|
+
return unless flag_passed?(flag_name)
|
|
768
760
|
|
|
769
761
|
value = options[name]
|
|
770
762
|
value = value.join(" ").to_s if option.type == :array
|
|
771
763
|
value = "'#{value}'" unless option.type == :boolean
|
|
772
764
|
|
|
773
|
-
print_remembered_flag_deprecation(flag_name, name.tr("-", "_"), value)
|
|
765
|
+
print_remembered_flag_deprecation(flag_name, option_name || name.tr("-", "_"), value)
|
|
774
766
|
end
|
|
775
767
|
|
|
776
768
|
def print_remembered_flag_deprecation(flag_name, option_name, option_value)
|
|
@@ -786,5 +778,9 @@ module Bundler
|
|
|
786
778
|
"#{option_value}`, and stop using this flag"
|
|
787
779
|
Bundler::SharedHelpers.major_deprecation 2, message, removed_message: removed_message
|
|
788
780
|
end
|
|
781
|
+
|
|
782
|
+
def flag_passed?(name)
|
|
783
|
+
ARGV.any? {|arg| name == arg.split("=")[0] }
|
|
784
|
+
end
|
|
789
785
|
end
|
|
790
786
|
end
|
|
@@ -28,11 +28,7 @@ module Bundler
|
|
|
28
28
|
# It may be called concurrently without global interpreter lock in some Rubies.
|
|
29
29
|
# As a result, some methods may look more complex than necessary to save memory or time.
|
|
30
30
|
class CompactIndexClient
|
|
31
|
-
|
|
32
|
-
# because we use it to generate the etag on first request during the upgrade
|
|
33
|
-
# to the compact index client that uses opaque etags saved to files.
|
|
34
|
-
# Remove once 2.5.0 has been out for a while.
|
|
35
|
-
SUPPORTED_DIGESTS = { "sha-256" => :SHA256, "md5" => :MD5 }.freeze
|
|
31
|
+
SUPPORTED_DIGESTS = { "sha-256" => :SHA256 }.freeze
|
|
36
32
|
DEBUG_MUTEX = Thread::Mutex.new
|
|
37
33
|
|
|
38
34
|
# info returns an Array of INFO Arrays. Each INFO Array has the following indices:
|
data/lib/bundler/current_ruby.rb
CHANGED
|
@@ -32,7 +32,7 @@ module Bundler
|
|
|
32
32
|
end.freeze
|
|
33
33
|
|
|
34
34
|
def ruby?
|
|
35
|
-
return true if Bundler::
|
|
35
|
+
return true if Bundler::MatchPlatform.generic_local_platform_is_ruby?
|
|
36
36
|
|
|
37
37
|
!windows? && (RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx" || RUBY_ENGINE == "maglev" || RUBY_ENGINE == "truffleruby")
|
|
38
38
|
end
|
|
@@ -50,6 +50,18 @@ module Bundler
|
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
def maglev?
|
|
53
|
+
message =
|
|
54
|
+
"`CurrentRuby#maglev?` is deprecated with no replacement. Please use the " \
|
|
55
|
+
"built-in Ruby `RUBY_ENGINE` constant to check the Ruby implementation you are running on."
|
|
56
|
+
removed_message =
|
|
57
|
+
"`CurrentRuby#maglev?` was removed with no replacement. Please use the " \
|
|
58
|
+
"built-in Ruby `RUBY_ENGINE` constant to check the Ruby implementation you are running on."
|
|
59
|
+
internally_exempted = caller_locations(1, 1).first.path == __FILE__
|
|
60
|
+
|
|
61
|
+
unless internally_exempted
|
|
62
|
+
SharedHelpers.major_deprecation(2, message, removed_message: removed_message, print_caller_location: true)
|
|
63
|
+
end
|
|
64
|
+
|
|
53
65
|
RUBY_ENGINE == "maglev"
|
|
54
66
|
end
|
|
55
67
|
|
|
@@ -71,12 +83,24 @@ module Bundler
|
|
|
71
83
|
RUBY_VERSION.start_with?("#{version}.")
|
|
72
84
|
end
|
|
73
85
|
|
|
74
|
-
|
|
75
|
-
all_platforms.each do |platform|
|
|
86
|
+
PLATFORM_MAP.keys.each do |platform|
|
|
76
87
|
define_method(:"#{platform}_#{trimmed_version}?") do
|
|
77
88
|
send(:"#{platform}?") && send(:"on_#{trimmed_version}?")
|
|
78
89
|
end
|
|
79
90
|
end
|
|
91
|
+
|
|
92
|
+
define_method(:"maglev_#{trimmed_version}?") do
|
|
93
|
+
message =
|
|
94
|
+
"`CurrentRuby##{__method__}` is deprecated with no replacement. Please use the " \
|
|
95
|
+
"built-in Ruby `RUBY_ENGINE` and `RUBY_VERSION` constants to perform a similar check."
|
|
96
|
+
removed_message =
|
|
97
|
+
"`CurrentRuby##{__method__}` was removed with no replacement. Please use the " \
|
|
98
|
+
"built-in Ruby `RUBY_ENGINE` and `RUBY_VERSION` constants to perform a similar check."
|
|
99
|
+
|
|
100
|
+
SharedHelpers.major_deprecation(2, message, removed_message: removed_message, print_caller_location: true)
|
|
101
|
+
|
|
102
|
+
send(:"maglev?") && send(:"on_#{trimmed_version}?")
|
|
103
|
+
end
|
|
80
104
|
end
|
|
81
105
|
end
|
|
82
106
|
end
|
data/lib/bundler/definition.rb
CHANGED
|
@@ -4,8 +4,6 @@ require_relative "lockfile_parser"
|
|
|
4
4
|
|
|
5
5
|
module Bundler
|
|
6
6
|
class Definition
|
|
7
|
-
include GemHelpers
|
|
8
|
-
|
|
9
7
|
class << self
|
|
10
8
|
# Do not create or modify a lockfile (Makes #lock a noop)
|
|
11
9
|
attr_accessor :no_lock
|
|
@@ -62,6 +60,7 @@ module Bundler
|
|
|
62
60
|
|
|
63
61
|
if unlock == true
|
|
64
62
|
@unlocking_all = true
|
|
63
|
+
strict = false
|
|
65
64
|
@unlocking_bundler = false
|
|
66
65
|
@unlocking = unlock
|
|
67
66
|
@sources_to_unlock = []
|
|
@@ -70,6 +69,7 @@ module Bundler
|
|
|
70
69
|
conservative = false
|
|
71
70
|
else
|
|
72
71
|
@unlocking_all = false
|
|
72
|
+
strict = unlock.delete(:strict)
|
|
73
73
|
@unlocking_bundler = unlock.delete(:bundler)
|
|
74
74
|
@unlocking = unlock.any? {|_k, v| !Array(v).empty? }
|
|
75
75
|
@sources_to_unlock = unlock.delete(:sources) || []
|
|
@@ -99,7 +99,7 @@ module Bundler
|
|
|
99
99
|
|
|
100
100
|
if lockfile_exists?
|
|
101
101
|
@lockfile_contents = Bundler.read_file(lockfile)
|
|
102
|
-
@locked_gems = LockfileParser.new(@lockfile_contents)
|
|
102
|
+
@locked_gems = LockfileParser.new(@lockfile_contents, strict: strict)
|
|
103
103
|
@locked_platforms = @locked_gems.platforms
|
|
104
104
|
@most_specific_locked_platform = @locked_gems.most_specific_locked_platform
|
|
105
105
|
@platforms = @locked_platforms.dup
|
|
@@ -189,12 +189,14 @@ module Bundler
|
|
|
189
189
|
def setup_domain!(options = {})
|
|
190
190
|
prefer_local! if options[:"prefer-local"]
|
|
191
191
|
|
|
192
|
+
sources.cached!
|
|
193
|
+
|
|
192
194
|
if options[:add_checksums] || (!options[:local] && install_needed?)
|
|
193
|
-
|
|
195
|
+
sources.remote!
|
|
194
196
|
true
|
|
195
197
|
else
|
|
196
198
|
Bundler.settings.set_command_option(:jobs, 1) unless install_needed? # to avoid the overhead of Bundler::Worker
|
|
197
|
-
|
|
199
|
+
sources.local!
|
|
198
200
|
false
|
|
199
201
|
end
|
|
200
202
|
end
|
|
@@ -282,7 +284,7 @@ module Bundler
|
|
|
282
284
|
end
|
|
283
285
|
|
|
284
286
|
def filter_relevant(dependencies)
|
|
285
|
-
platforms_array = [generic_local_platform].freeze
|
|
287
|
+
platforms_array = [Bundler.generic_local_platform].freeze
|
|
286
288
|
dependencies.select do |d|
|
|
287
289
|
d.should_include? && !d.gem_platforms(platforms_array).empty?
|
|
288
290
|
end
|
|
@@ -373,6 +375,44 @@ module Bundler
|
|
|
373
375
|
write_lock(target_lockfile, preserve_unknown_sections)
|
|
374
376
|
end
|
|
375
377
|
|
|
378
|
+
def write_lock(file, preserve_unknown_sections)
|
|
379
|
+
return if Definition.no_lock || file.nil?
|
|
380
|
+
|
|
381
|
+
contents = to_lock
|
|
382
|
+
|
|
383
|
+
# Convert to \r\n if the existing lock has them
|
|
384
|
+
# i.e., Windows with `git config core.autocrlf=true`
|
|
385
|
+
contents.gsub!(/\n/, "\r\n") if @lockfile_contents.match?("\r\n")
|
|
386
|
+
|
|
387
|
+
if @locked_bundler_version
|
|
388
|
+
locked_major = @locked_bundler_version.segments.first
|
|
389
|
+
current_major = bundler_version_to_lock.segments.first
|
|
390
|
+
|
|
391
|
+
updating_major = locked_major < current_major
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
preserve_unknown_sections ||= !updating_major && (Bundler.frozen_bundle? || !(unlocking? || @unlocking_bundler))
|
|
395
|
+
|
|
396
|
+
if File.exist?(file) && lockfiles_equal?(@lockfile_contents, contents, preserve_unknown_sections)
|
|
397
|
+
return if Bundler.frozen_bundle?
|
|
398
|
+
SharedHelpers.filesystem_access(file) { FileUtils.touch(file) }
|
|
399
|
+
return
|
|
400
|
+
end
|
|
401
|
+
|
|
402
|
+
if Bundler.frozen_bundle?
|
|
403
|
+
Bundler.ui.error "Cannot write a changed lockfile while frozen."
|
|
404
|
+
return
|
|
405
|
+
end
|
|
406
|
+
|
|
407
|
+
begin
|
|
408
|
+
SharedHelpers.filesystem_access(file) do |p|
|
|
409
|
+
File.open(p, "wb") {|f| f.puts(contents) }
|
|
410
|
+
end
|
|
411
|
+
rescue ReadOnlyFileSystemError
|
|
412
|
+
raise ProductionError, lockfile_changes_summary("file system is read-only")
|
|
413
|
+
end
|
|
414
|
+
end
|
|
415
|
+
|
|
376
416
|
def locked_ruby_version
|
|
377
417
|
return unless ruby_version
|
|
378
418
|
if @unlocking_ruby || !@locked_ruby_version
|
|
@@ -456,8 +496,8 @@ module Bundler
|
|
|
456
496
|
return if current_platform_locked? || @platforms.include?(Gem::Platform::RUBY)
|
|
457
497
|
|
|
458
498
|
raise ProductionError, "Your bundle only supports platforms #{@platforms.map(&:to_s)} " \
|
|
459
|
-
"but your local platform is #{local_platform}. " \
|
|
460
|
-
"Add the current platform to the lockfile with\n`bundle lock --add-platform #{local_platform}` and try again."
|
|
499
|
+
"but your local platform is #{Bundler.local_platform}. " \
|
|
500
|
+
"Add the current platform to the lockfile with\n`bundle lock --add-platform #{Bundler.local_platform}` and try again."
|
|
461
501
|
end
|
|
462
502
|
|
|
463
503
|
def normalize_platforms
|
|
@@ -492,8 +532,6 @@ module Bundler
|
|
|
492
532
|
@unlocking
|
|
493
533
|
end
|
|
494
534
|
|
|
495
|
-
attr_writer :source_requirements
|
|
496
|
-
|
|
497
535
|
def add_checksums
|
|
498
536
|
@locked_checksums = true
|
|
499
537
|
|
|
@@ -533,7 +571,7 @@ module Bundler
|
|
|
533
571
|
|
|
534
572
|
return unless added.any? || deleted.any? || changed.any? || resolve_needed?
|
|
535
573
|
|
|
536
|
-
msg = String.new("#{change_reason.
|
|
574
|
+
msg = String.new("#{change_reason[0].upcase}#{change_reason[1..-1].strip}, but ")
|
|
537
575
|
msg << "the lockfile " unless msg.start_with?("Your lockfile")
|
|
538
576
|
msg << "can't be updated because #{update_refused_reason}"
|
|
539
577
|
msg << "\n\nYou have added to the Gemfile:\n" << added.join("\n") if added.any?
|
|
@@ -559,6 +597,7 @@ module Bundler
|
|
|
559
597
|
@missing_lockfile_dep ||
|
|
560
598
|
@unlocking_bundler ||
|
|
561
599
|
@locked_spec_with_missing_checksums ||
|
|
600
|
+
@locked_spec_with_empty_checksums ||
|
|
562
601
|
@locked_spec_with_missing_deps ||
|
|
563
602
|
@locked_spec_with_invalid_deps
|
|
564
603
|
end
|
|
@@ -568,53 +607,15 @@ module Bundler
|
|
|
568
607
|
end
|
|
569
608
|
|
|
570
609
|
def should_add_extra_platforms?
|
|
571
|
-
!lockfile_exists? && generic_local_platform_is_ruby? && !Bundler.settings[:force_ruby_platform]
|
|
610
|
+
!lockfile_exists? && Bundler::MatchPlatform.generic_local_platform_is_ruby? && !Bundler.settings[:force_ruby_platform]
|
|
572
611
|
end
|
|
573
612
|
|
|
574
613
|
def lockfile_exists?
|
|
575
614
|
lockfile && File.exist?(lockfile)
|
|
576
615
|
end
|
|
577
616
|
|
|
578
|
-
def write_lock(file, preserve_unknown_sections)
|
|
579
|
-
return if Definition.no_lock || file.nil?
|
|
580
|
-
|
|
581
|
-
contents = to_lock
|
|
582
|
-
|
|
583
|
-
# Convert to \r\n if the existing lock has them
|
|
584
|
-
# i.e., Windows with `git config core.autocrlf=true`
|
|
585
|
-
contents.gsub!(/\n/, "\r\n") if @lockfile_contents.match?("\r\n")
|
|
586
|
-
|
|
587
|
-
if @locked_bundler_version
|
|
588
|
-
locked_major = @locked_bundler_version.segments.first
|
|
589
|
-
current_major = bundler_version_to_lock.segments.first
|
|
590
|
-
|
|
591
|
-
updating_major = locked_major < current_major
|
|
592
|
-
end
|
|
593
|
-
|
|
594
|
-
preserve_unknown_sections ||= !updating_major && (Bundler.frozen_bundle? || !(unlocking? || @unlocking_bundler))
|
|
595
|
-
|
|
596
|
-
if File.exist?(file) && lockfiles_equal?(@lockfile_contents, contents, preserve_unknown_sections)
|
|
597
|
-
return if Bundler.frozen_bundle?
|
|
598
|
-
SharedHelpers.filesystem_access(file) { FileUtils.touch(file) }
|
|
599
|
-
return
|
|
600
|
-
end
|
|
601
|
-
|
|
602
|
-
if Bundler.frozen_bundle?
|
|
603
|
-
Bundler.ui.error "Cannot write a changed lockfile while frozen."
|
|
604
|
-
return
|
|
605
|
-
end
|
|
606
|
-
|
|
607
|
-
begin
|
|
608
|
-
SharedHelpers.filesystem_access(file) do |p|
|
|
609
|
-
File.open(p, "wb") {|f| f.puts(contents) }
|
|
610
|
-
end
|
|
611
|
-
rescue ReadOnlyFileSystemError
|
|
612
|
-
raise ProductionError, lockfile_changes_summary("file system is read-only")
|
|
613
|
-
end
|
|
614
|
-
end
|
|
615
|
-
|
|
616
617
|
def resolver
|
|
617
|
-
@resolver ||=
|
|
618
|
+
@resolver ||= new_resolver(resolution_base)
|
|
618
619
|
end
|
|
619
620
|
|
|
620
621
|
def expanded_dependencies
|
|
@@ -632,8 +633,7 @@ module Bundler
|
|
|
632
633
|
@resolution_base ||= begin
|
|
633
634
|
last_resolve = converge_locked_specs
|
|
634
635
|
remove_invalid_platforms!
|
|
635
|
-
|
|
636
|
-
base = Resolver::Base.new(source_requirements, expanded_dependencies, last_resolve, @platforms, locked_specs: @originally_locked_specs, unlock: @unlocking_all || @gems_to_unlock, prerelease: gem_version_promoter.pre?, prefer_local: @prefer_local, new_platforms: new_resolution_platforms)
|
|
636
|
+
base = new_resolution_base(last_resolve: last_resolve, unlock: @unlocking_all || @gems_to_unlock)
|
|
637
637
|
base = additional_base_requirements_to_prevent_downgrades(base)
|
|
638
638
|
base = additional_base_requirements_to_force_updates(base)
|
|
639
639
|
base
|
|
@@ -738,9 +738,8 @@ module Bundler
|
|
|
738
738
|
end
|
|
739
739
|
|
|
740
740
|
def start_resolution
|
|
741
|
-
local_platform_needed_for_resolvability = @most_specific_non_local_locked_platform && !@platforms.include?(local_platform)
|
|
742
|
-
@platforms << local_platform if local_platform_needed_for_resolvability
|
|
743
|
-
add_platform(Gem::Platform::RUBY) if RUBY_ENGINE == "truffleruby"
|
|
741
|
+
local_platform_needed_for_resolvability = @most_specific_non_local_locked_platform && !@platforms.include?(Bundler.local_platform)
|
|
742
|
+
@platforms << Bundler.local_platform if local_platform_needed_for_resolvability
|
|
744
743
|
|
|
745
744
|
result = SpecSet.new(resolver.start)
|
|
746
745
|
|
|
@@ -758,7 +757,7 @@ module Bundler
|
|
|
758
757
|
if result.incomplete_for_platform?(current_dependencies, @most_specific_non_local_locked_platform)
|
|
759
758
|
@platforms.delete(@most_specific_non_local_locked_platform)
|
|
760
759
|
elsif local_platform_needed_for_resolvability
|
|
761
|
-
@platforms.delete(local_platform)
|
|
760
|
+
@platforms.delete(Bundler.local_platform)
|
|
762
761
|
end
|
|
763
762
|
end
|
|
764
763
|
|
|
@@ -777,17 +776,17 @@ module Bundler
|
|
|
777
776
|
|
|
778
777
|
def current_platform_locked?
|
|
779
778
|
@platforms.any? do |bundle_platform|
|
|
780
|
-
generic_local_platform == bundle_platform || local_platform === bundle_platform
|
|
779
|
+
Bundler.generic_local_platform == bundle_platform || Bundler.local_platform === bundle_platform
|
|
781
780
|
end
|
|
782
781
|
end
|
|
783
782
|
|
|
784
783
|
def add_current_platform
|
|
785
|
-
return if @platforms.include?(local_platform)
|
|
784
|
+
return if @platforms.include?(Bundler.local_platform)
|
|
786
785
|
|
|
787
786
|
@most_specific_non_local_locked_platform = find_most_specific_locked_platform
|
|
788
787
|
return if @most_specific_non_local_locked_platform
|
|
789
788
|
|
|
790
|
-
@platforms << local_platform
|
|
789
|
+
@platforms << Bundler.local_platform
|
|
791
790
|
true
|
|
792
791
|
end
|
|
793
792
|
|
|
@@ -848,6 +847,7 @@ module Bundler
|
|
|
848
847
|
[@missing_lockfile_dep, "your lockfile is missing \"#{@missing_lockfile_dep}\""],
|
|
849
848
|
[@unlocking_bundler, "an update to the version of Bundler itself was requested"],
|
|
850
849
|
[@locked_spec_with_missing_checksums, "your lockfile is missing a CHECKSUMS entry for \"#{@locked_spec_with_missing_checksums}\""],
|
|
850
|
+
[@locked_spec_with_empty_checksums, "your lockfile has an empty CHECKSUMS entry for \"#{@locked_spec_with_empty_checksums}\""],
|
|
851
851
|
[@locked_spec_with_missing_deps, "your lockfile includes \"#{@locked_spec_with_missing_deps}\" but not some of its dependencies"],
|
|
852
852
|
[@locked_spec_with_invalid_deps, "your lockfile does not satisfy dependencies of \"#{@locked_spec_with_invalid_deps}\""],
|
|
853
853
|
].select(&:first).map(&:last).join(", ")
|
|
@@ -907,13 +907,23 @@ module Bundler
|
|
|
907
907
|
@locked_spec_with_invalid_deps = nil
|
|
908
908
|
@locked_spec_with_missing_deps = nil
|
|
909
909
|
@locked_spec_with_missing_checksums = nil
|
|
910
|
+
@locked_spec_with_empty_checksums = nil
|
|
910
911
|
|
|
911
912
|
missing_deps = []
|
|
912
913
|
missing_checksums = []
|
|
914
|
+
empty_checksums = []
|
|
913
915
|
invalid = []
|
|
914
916
|
|
|
915
917
|
@locked_specs.each do |s|
|
|
916
|
-
|
|
918
|
+
if @locked_checksums
|
|
919
|
+
checksum_store = s.source.checksum_store
|
|
920
|
+
|
|
921
|
+
if checksum_store.missing?(s)
|
|
922
|
+
missing_checksums << s
|
|
923
|
+
elsif checksum_store.empty?(s)
|
|
924
|
+
empty_checksums << s
|
|
925
|
+
end
|
|
926
|
+
end
|
|
917
927
|
|
|
918
928
|
validation = @locked_specs.validate_deps(s)
|
|
919
929
|
|
|
@@ -922,6 +932,7 @@ module Bundler
|
|
|
922
932
|
end
|
|
923
933
|
|
|
924
934
|
@locked_spec_with_missing_checksums = missing_checksums.first.name if missing_checksums.any?
|
|
935
|
+
@locked_spec_with_empty_checksums = empty_checksums.first.name if empty_checksums.any?
|
|
925
936
|
|
|
926
937
|
if missing_deps.any?
|
|
927
938
|
@locked_specs.delete(missing_deps)
|
|
@@ -1037,17 +1048,16 @@ module Bundler
|
|
|
1037
1048
|
lockfile_source = s.source
|
|
1038
1049
|
|
|
1039
1050
|
if dep
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
deps << dep if !dep.source || lockfile_source.include?(dep.source) || new_deps.include?(dep)
|
|
1051
|
+
replacement_source = dep.source
|
|
1043
1052
|
|
|
1044
|
-
|
|
1045
|
-
s.source = gemfile_source
|
|
1053
|
+
deps << dep if !replacement_source || lockfile_source.include?(replacement_source) || new_deps.include?(dep)
|
|
1046
1054
|
else
|
|
1047
|
-
|
|
1048
|
-
s.source = default_source unless sources.get(lockfile_source)
|
|
1055
|
+
replacement_source = sources.get(lockfile_source)
|
|
1049
1056
|
end
|
|
1050
1057
|
|
|
1058
|
+
# Replace the locked dependency's source with the equivalent source from the Gemfile
|
|
1059
|
+
s.source = replacement_source || default_source
|
|
1060
|
+
|
|
1051
1061
|
source = s.source
|
|
1052
1062
|
next if @sources_to_unlock.include?(source.name)
|
|
1053
1063
|
|
|
@@ -1146,7 +1156,7 @@ module Bundler
|
|
|
1146
1156
|
|
|
1147
1157
|
def additional_base_requirements_to_force_updates(resolution_base)
|
|
1148
1158
|
return resolution_base if @explicit_unlocks.empty?
|
|
1149
|
-
full_update =
|
|
1159
|
+
full_update = SpecSet.new(new_resolver_for_full_update.start)
|
|
1150
1160
|
@explicit_unlocks.each do |name|
|
|
1151
1161
|
version = full_update.version_for(name)
|
|
1152
1162
|
resolution_base.base_requirements[name] = Gem::Requirement.new("= #{version}") if version
|
|
@@ -1154,21 +1164,10 @@ module Bundler
|
|
|
1154
1164
|
resolution_base
|
|
1155
1165
|
end
|
|
1156
1166
|
|
|
1157
|
-
def dup_for_full_unlock
|
|
1158
|
-
unlocked_definition = self.class.new(@lockfile, @dependencies, @sources, true, @ruby_version, @optional_groups, @gemfiles)
|
|
1159
|
-
unlocked_definition.source_requirements = source_requirements
|
|
1160
|
-
unlocked_definition.gem_version_promoter.tap do |gvp|
|
|
1161
|
-
gvp.level = gem_version_promoter.level
|
|
1162
|
-
gvp.strict = gem_version_promoter.strict
|
|
1163
|
-
gvp.pre = gem_version_promoter.pre
|
|
1164
|
-
end
|
|
1165
|
-
unlocked_definition
|
|
1166
|
-
end
|
|
1167
|
-
|
|
1168
1167
|
def remove_invalid_platforms!
|
|
1169
1168
|
return if Bundler.frozen_bundle?
|
|
1170
1169
|
|
|
1171
|
-
skips = (@new_platforms + [local_platform]).uniq
|
|
1170
|
+
skips = (@new_platforms + [Bundler.local_platform]).uniq
|
|
1172
1171
|
|
|
1173
1172
|
# We should probably avoid removing non-ruby platforms, since that means
|
|
1174
1173
|
# lockfile will no longer install on those platforms, so a error to give
|
|
@@ -1183,5 +1182,22 @@ module Bundler
|
|
|
1183
1182
|
def source_map
|
|
1184
1183
|
@source_map ||= SourceMap.new(sources, dependencies, @locked_specs)
|
|
1185
1184
|
end
|
|
1185
|
+
|
|
1186
|
+
def new_resolver_for_full_update
|
|
1187
|
+
new_resolver(unlocked_resolution_base)
|
|
1188
|
+
end
|
|
1189
|
+
|
|
1190
|
+
def unlocked_resolution_base
|
|
1191
|
+
new_resolution_base(last_resolve: SpecSet.new([]), unlock: true)
|
|
1192
|
+
end
|
|
1193
|
+
|
|
1194
|
+
def new_resolution_base(last_resolve:, unlock:)
|
|
1195
|
+
new_resolution_platforms = @current_platform_missing ? @new_platforms + [Bundler.local_platform] : @new_platforms
|
|
1196
|
+
Resolver::Base.new(source_requirements, expanded_dependencies, last_resolve, @platforms, locked_specs: @originally_locked_specs, unlock: unlock, prerelease: gem_version_promoter.pre?, prefer_local: @prefer_local, new_platforms: new_resolution_platforms)
|
|
1197
|
+
end
|
|
1198
|
+
|
|
1199
|
+
def new_resolver(base)
|
|
1200
|
+
Resolver.new(base, gem_version_promoter, @most_specific_locked_platform)
|
|
1201
|
+
end
|
|
1186
1202
|
end
|
|
1187
1203
|
end
|
data/lib/bundler/dependency.rb
CHANGED
|
@@ -99,7 +99,7 @@ module Bundler
|
|
|
99
99
|
return RUBY_PLATFORM_ARRAY if force_ruby_platform
|
|
100
100
|
return valid_platforms if platforms.empty?
|
|
101
101
|
|
|
102
|
-
valid_platforms.select {|p| expanded_platforms.include?(
|
|
102
|
+
valid_platforms.select {|p| expanded_platforms.include?(Gem::Platform.generic(p)) }
|
|
103
103
|
end
|
|
104
104
|
|
|
105
105
|
def expanded_platforms
|