rubygems-update 3.3.19 → 3.3.22
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 +41 -0
- data/Manifest.txt +11 -1
- data/bin/update_rubygems +1 -1
- data/bundler/CHANGELOG.md +71 -0
- data/bundler/UPGRADING.md +11 -4
- data/bundler/bundler.gemspec +6 -8
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli/install.rb +5 -2
- data/bundler/lib/bundler/cli/outdated.rb +12 -3
- data/bundler/lib/bundler/cli/platform.rb +1 -1
- data/bundler/lib/bundler/cli.rb +7 -4
- data/bundler/lib/bundler/current_ruby.rb +14 -5
- data/bundler/lib/bundler/definition.rb +85 -33
- data/bundler/lib/bundler/dependency.rb +18 -85
- data/bundler/lib/bundler/endpoint_specification.rb +2 -13
- data/bundler/lib/bundler/feature_flag.rb +0 -1
- data/bundler/lib/bundler/fetcher.rb +6 -6
- data/bundler/lib/bundler/gem_helpers.rb +7 -1
- data/bundler/lib/bundler/gem_version_promoter.rb +8 -18
- data/bundler/lib/bundler/injector.rb +2 -1
- data/bundler/lib/bundler/inline.rb +1 -1
- data/bundler/lib/bundler/installer/standalone.rb +1 -1
- data/bundler/lib/bundler/installer.rb +14 -12
- data/bundler/lib/bundler/lazy_specification.rb +23 -25
- data/bundler/lib/bundler/lockfile_generator.rb +1 -1
- data/bundler/lib/bundler/man/bundle-add.1 +6 -2
- data/bundler/lib/bundler/man/bundle-add.1.ronn +4 -1
- data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/bundler/lib/bundler/man/bundle-cache.1 +7 -1
- data/bundler/lib/bundler/man/bundle-cache.1.ronn +7 -0
- data/bundler/lib/bundler/man/bundle-check.1 +1 -1
- data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
- data/bundler/lib/bundler/man/bundle-config.1 +13 -4
- data/bundler/lib/bundler/man/bundle-config.1.ronn +7 -4
- data/bundler/lib/bundler/man/bundle-console.1 +53 -0
- data/bundler/lib/bundler/man/bundle-console.1.ronn +44 -0
- data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
- data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
- data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
- data/bundler/lib/bundler/man/bundle-help.1 +13 -0
- data/bundler/lib/bundler/man/bundle-help.1.ronn +12 -0
- data/bundler/lib/bundler/man/bundle-info.1 +1 -1
- data/bundler/lib/bundler/man/bundle-init.1 +1 -1
- data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
- data/bundler/lib/bundler/man/bundle-install.1 +5 -1
- data/bundler/lib/bundler/man/bundle-install.1.ronn +6 -0
- data/bundler/lib/bundler/man/bundle-list.1 +1 -1
- data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
- data/bundler/lib/bundler/man/bundle-open.1 +1 -1
- data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
- data/bundler/lib/bundler/man/bundle-platform.1 +16 -6
- data/bundler/lib/bundler/man/bundle-platform.1.ronn +14 -7
- data/bundler/lib/bundler/man/bundle-plugin.1 +81 -0
- data/bundler/lib/bundler/man/bundle-plugin.1.ronn +59 -0
- data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
- data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
- data/bundler/lib/bundler/man/bundle-show.1 +1 -1
- data/bundler/lib/bundler/man/bundle-update.1 +1 -1
- data/bundler/lib/bundler/man/bundle-version.1 +35 -0
- data/bundler/lib/bundler/man/bundle-version.1.ronn +24 -0
- data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
- data/bundler/lib/bundler/man/bundle.1 +13 -8
- data/bundler/lib/bundler/man/bundle.1.ronn +10 -5
- data/bundler/lib/bundler/man/gemfile.5 +8 -38
- data/bundler/lib/bundler/man/gemfile.5.ronn +9 -27
- data/bundler/lib/bundler/man/index.txt +4 -0
- data/bundler/lib/bundler/match_metadata.rb +13 -0
- data/bundler/lib/bundler/match_remote_metadata.rb +29 -0
- data/bundler/lib/bundler/plugin.rb +2 -0
- data/bundler/lib/bundler/remote_specification.rb +1 -7
- data/bundler/lib/bundler/resolver/base.rb +50 -0
- data/bundler/lib/bundler/resolver/spec_group.rb +11 -8
- data/bundler/lib/bundler/resolver.rb +94 -88
- data/bundler/lib/bundler/ruby_dsl.rb +1 -1
- data/bundler/lib/bundler/ruby_version.rb +5 -5
- data/bundler/lib/bundler/rubygems_ext.rb +52 -1
- data/bundler/lib/bundler/settings.rb +0 -1
- data/bundler/lib/bundler/source/metadata.rb +1 -1
- data/bundler/lib/bundler/source_list.rb +4 -0
- data/bundler/lib/bundler/spec_set.rb +41 -34
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/lib/bundler.rb +3 -4
- data/lib/rubygems/available_set.rb +3 -3
- data/lib/rubygems/basic_specification.rb +2 -2
- data/lib/rubygems/command.rb +6 -6
- data/lib/rubygems/commands/cert_command.rb +1 -1
- data/lib/rubygems/commands/cleanup_command.rb +1 -1
- data/lib/rubygems/commands/contents_command.rb +1 -1
- data/lib/rubygems/commands/dependency_command.rb +4 -4
- data/lib/rubygems/commands/fetch_command.rb +2 -2
- data/lib/rubygems/commands/generate_index_command.rb +2 -2
- data/lib/rubygems/commands/install_command.rb +7 -7
- data/lib/rubygems/commands/pristine_command.rb +5 -5
- data/lib/rubygems/commands/setup_command.rb +4 -4
- data/lib/rubygems/commands/sources_command.rb +3 -3
- data/lib/rubygems/commands/specification_command.rb +2 -2
- data/lib/rubygems/commands/uninstall_command.rb +4 -4
- data/lib/rubygems/commands/update_command.rb +5 -5
- data/lib/rubygems/commands/which_command.rb +1 -1
- data/lib/rubygems/config_file.rb +7 -7
- data/lib/rubygems/core_ext/kernel_warn.rb +1 -1
- data/lib/rubygems/defaults.rb +1 -1
- data/lib/rubygems/dependency.rb +5 -5
- data/lib/rubygems/dependency_installer.rb +5 -5
- data/lib/rubygems/dependency_list.rb +4 -4
- data/lib/rubygems/doctor.rb +4 -4
- data/lib/rubygems/exceptions.rb +1 -1
- data/lib/rubygems/ext/ext_conf_builder.rb +2 -2
- data/lib/rubygems/gemcutter_utilities.rb +1 -1
- data/lib/rubygems/indexer.rb +3 -3
- data/lib/rubygems/installer.rb +5 -13
- data/lib/rubygems/name_tuple.rb +3 -3
- data/lib/rubygems/package/tar_header.rb +17 -17
- data/lib/rubygems/package/tar_writer.rb +1 -1
- data/lib/rubygems/package.rb +19 -8
- data/lib/rubygems/platform.rb +30 -19
- data/lib/rubygems/query_utils.rb +8 -8
- data/lib/rubygems/remote_fetcher.rb +3 -3
- data/lib/rubygems/request/connection_pools.rb +2 -2
- data/lib/rubygems/request/http_pool.rb +1 -1
- data/lib/rubygems/request.rb +1 -1
- data/lib/rubygems/request_set/gem_dependency_api.rb +3 -3
- data/lib/rubygems/request_set/lockfile/parser.rb +12 -12
- data/lib/rubygems/request_set/lockfile/tokenizer.rb +2 -2
- data/lib/rubygems/request_set.rb +3 -3
- data/lib/rubygems/requirement.rb +1 -1
- data/lib/rubygems/resolver/api_specification.rb +4 -4
- data/lib/rubygems/resolver/best_set.rb +3 -3
- data/lib/rubygems/resolver/conflict.rb +3 -3
- data/lib/rubygems/resolver/git_specification.rb +3 -3
- data/lib/rubygems/resolver/index_specification.rb +3 -2
- data/lib/rubygems/resolver/installed_specification.rb +2 -2
- data/lib/rubygems/resolver/installer_set.rb +7 -12
- data/lib/rubygems/resolver/lock_set.rb +1 -1
- data/lib/rubygems/resolver/lock_specification.rb +1 -1
- data/lib/rubygems/resolver/vendor_specification.rb +3 -3
- data/lib/rubygems/resolver.rb +4 -4
- data/lib/rubygems/security/policy.rb +6 -6
- data/lib/rubygems/security/signer.rb +1 -1
- data/lib/rubygems/security.rb +1 -1
- data/lib/rubygems/source/git.rb +4 -4
- data/lib/rubygems/source.rb +1 -1
- data/lib/rubygems/spec_fetcher.rb +1 -1
- data/lib/rubygems/specification.rb +26 -24
- data/lib/rubygems/specification_policy.rb +4 -4
- data/lib/rubygems/uninstaller.rb +4 -4
- data/lib/rubygems/user_interaction.rb +2 -2
- data/lib/rubygems/version.rb +12 -4
- data/lib/rubygems.rb +8 -8
- data/rubygems-update.gemspec +1 -1
- data/setup.rb +1 -1
- data/test/rubygems/helper.rb +5 -7
- data/test/rubygems/test_gem_commands_info_command.rb +26 -0
- data/test/rubygems/test_gem_config_file.rb +17 -5
- data/test/rubygems/test_gem_dependency_installer.rb +2 -2
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.lock +4 -4
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.toml +1 -1
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/build.rb +1 -1
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.lock +4 -4
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.toml +1 -1
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/build.rb +1 -1
- data/test/rubygems/test_gem_installer.rb +6 -3
- data/test/rubygems/test_gem_package.rb +22 -0
- data/test/rubygems/test_gem_package_tar_reader.rb +1 -1
- data/test/rubygems/test_gem_platform.rb +73 -2
- data/test/rubygems/test_gem_requirement.rb +9 -3
- data/test/rubygems/test_gem_resolver.rb +37 -3
- data/test/rubygems/test_gem_resolver_index_specification.rb +1 -1
- data/test/rubygems/test_gem_resolver_installer_set.rb +44 -0
- data/test/rubygems/test_gem_specification.rb +11 -2
- data/test/rubygems/test_gem_version.rb +9 -2
- data/test/rubygems/test_require.rb +1 -1
- data/test/rubygems/utilities.rb +4 -4
- metadata +14 -4
- data/bundler/lib/bundler/incomplete_specification.rb +0 -12
|
@@ -70,6 +70,7 @@ module Bundler
|
|
|
70
70
|
@unlock = unlock
|
|
71
71
|
@optional_groups = optional_groups
|
|
72
72
|
@remote = false
|
|
73
|
+
@prefer_local = false
|
|
73
74
|
@specs = nil
|
|
74
75
|
@ruby_version = ruby_version
|
|
75
76
|
@gemfiles = gemfiles
|
|
@@ -144,8 +145,6 @@ module Bundler
|
|
|
144
145
|
@dependency_changes = converge_dependencies
|
|
145
146
|
@local_changes = converge_locals
|
|
146
147
|
|
|
147
|
-
@reresolve = nil
|
|
148
|
-
|
|
149
148
|
@requires = compute_requires
|
|
150
149
|
end
|
|
151
150
|
|
|
@@ -170,6 +169,13 @@ module Bundler
|
|
|
170
169
|
resolve
|
|
171
170
|
end
|
|
172
171
|
|
|
172
|
+
def resolve_prefering_local!
|
|
173
|
+
@prefer_local = true
|
|
174
|
+
@remote = true
|
|
175
|
+
sources.remote!
|
|
176
|
+
resolve
|
|
177
|
+
end
|
|
178
|
+
|
|
173
179
|
def resolve_with_cache!
|
|
174
180
|
sources.cached!
|
|
175
181
|
resolve
|
|
@@ -210,6 +216,7 @@ module Bundler
|
|
|
210
216
|
true
|
|
211
217
|
rescue BundlerError => e
|
|
212
218
|
@resolve = nil
|
|
219
|
+
@resolver = nil
|
|
213
220
|
@specs = nil
|
|
214
221
|
@gem_version_promoter = nil
|
|
215
222
|
|
|
@@ -280,7 +287,7 @@ module Bundler
|
|
|
280
287
|
end
|
|
281
288
|
else
|
|
282
289
|
Bundler.ui.debug("Found changes from the lockfile, re-resolving dependencies because #{change_reason}")
|
|
283
|
-
|
|
290
|
+
resolver.start(expanded_dependencies)
|
|
284
291
|
end
|
|
285
292
|
end
|
|
286
293
|
|
|
@@ -474,10 +481,16 @@ module Bundler
|
|
|
474
481
|
|
|
475
482
|
private
|
|
476
483
|
|
|
477
|
-
def
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
484
|
+
def resolver
|
|
485
|
+
@resolver ||= begin
|
|
486
|
+
last_resolve = converge_locked_specs
|
|
487
|
+
remove_ruby_from_platforms_if_necessary!(dependencies)
|
|
488
|
+
Resolver.new(source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve(last_resolve), platforms)
|
|
489
|
+
end
|
|
490
|
+
end
|
|
491
|
+
|
|
492
|
+
def expanded_dependencies
|
|
493
|
+
@expanded_dependencies ||= expand_dependencies(dependencies + metadata_dependencies, true)
|
|
481
494
|
end
|
|
482
495
|
|
|
483
496
|
def filter_specs(specs, deps)
|
|
@@ -505,21 +518,17 @@ module Bundler
|
|
|
505
518
|
raise GemNotFound, "Could not find #{missing_specs_list.join(" nor ")}"
|
|
506
519
|
end
|
|
507
520
|
|
|
508
|
-
|
|
521
|
+
loop do
|
|
509
522
|
incomplete_specs = specs.incomplete_specs
|
|
523
|
+
break if incomplete_specs.empty?
|
|
510
524
|
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
@resolve = reresolve
|
|
515
|
-
specs = resolve.materialize(dependencies)
|
|
516
|
-
end
|
|
525
|
+
Bundler.ui.debug("The lockfile does not have all gems needed for the current platform though, Bundler will still re-resolve dependencies")
|
|
526
|
+
@resolve = resolver.start(expanded_dependencies, :exclude_specs => incomplete_specs)
|
|
527
|
+
specs = resolve.materialize(dependencies)
|
|
517
528
|
end
|
|
518
529
|
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
specs["bundler"] = bundler
|
|
522
|
-
end
|
|
530
|
+
bundler = sources.metadata_source.specs.search(Gem::Dependency.new("bundler", VERSION)).last
|
|
531
|
+
specs["bundler"] = bundler
|
|
523
532
|
|
|
524
533
|
specs
|
|
525
534
|
end
|
|
@@ -528,6 +537,19 @@ module Bundler
|
|
|
528
537
|
@remote && sources.non_global_rubygems_sources.all?(&:dependency_api_available?) && !sources.aggregate_global_source?
|
|
529
538
|
end
|
|
530
539
|
|
|
540
|
+
def pin_locally_available_names(source_requirements)
|
|
541
|
+
source_requirements.each_with_object({}) do |(name, original_source), new_source_requirements|
|
|
542
|
+
local_source = original_source.dup
|
|
543
|
+
local_source.local_only!
|
|
544
|
+
|
|
545
|
+
new_source_requirements[name] = if local_source.specs.search(name).any?
|
|
546
|
+
local_source
|
|
547
|
+
else
|
|
548
|
+
original_source
|
|
549
|
+
end
|
|
550
|
+
end
|
|
551
|
+
end
|
|
552
|
+
|
|
531
553
|
def current_ruby_platform_locked?
|
|
532
554
|
return false unless generic_local_platform == Gem::Platform::RUBY
|
|
533
555
|
return false if Bundler.settings[:force_ruby_platform] && !@platforms.include?(Gem::Platform::RUBY)
|
|
@@ -695,7 +717,9 @@ module Bundler
|
|
|
695
717
|
# commonly happen if the Gemfile has changed since the lockfile was last
|
|
696
718
|
# generated
|
|
697
719
|
def converge_locked_specs
|
|
698
|
-
|
|
720
|
+
converged = converge_specs(@locked_specs)
|
|
721
|
+
|
|
722
|
+
resolve = SpecSet.new(converged.reject {|s| @unlock[:gems].include?(s.name) })
|
|
699
723
|
|
|
700
724
|
diff = nil
|
|
701
725
|
|
|
@@ -719,16 +743,24 @@ module Bundler
|
|
|
719
743
|
specs[dep].any? {|s| s.satisfies?(dep) && (!dep.source || s.source.include?(dep.source)) }
|
|
720
744
|
end
|
|
721
745
|
|
|
746
|
+
@specs_that_changed_sources = []
|
|
747
|
+
|
|
722
748
|
specs.each do |s|
|
|
723
|
-
# Replace the locked dependency's source with the equivalent source from the Gemfile
|
|
724
749
|
dep = @dependencies.find {|d| s.satisfies?(d) }
|
|
725
750
|
|
|
726
|
-
s
|
|
751
|
+
# Replace the locked dependency's source with the equivalent source from the Gemfile
|
|
752
|
+
s.source = if dep && dep.source
|
|
753
|
+
gemfile_source = dep.source
|
|
754
|
+
lockfile_source = s.source
|
|
727
755
|
|
|
728
|
-
|
|
756
|
+
@specs_that_changed_sources << s if gemfile_source != lockfile_source
|
|
729
757
|
|
|
730
|
-
|
|
731
|
-
|
|
758
|
+
gemfile_source
|
|
759
|
+
else
|
|
760
|
+
sources.get_with_fallback(s.source)
|
|
761
|
+
end
|
|
762
|
+
|
|
763
|
+
next if @unlock[:sources].include?(s.source.name)
|
|
732
764
|
|
|
733
765
|
# Path sources have special logic
|
|
734
766
|
if s.source.instance_of?(Source::Path) || s.source.instance_of?(Source::Gemspec)
|
|
@@ -760,12 +792,12 @@ module Bundler
|
|
|
760
792
|
end
|
|
761
793
|
end
|
|
762
794
|
|
|
763
|
-
|
|
795
|
+
filter_specs(converged, deps)
|
|
764
796
|
end
|
|
765
797
|
|
|
766
798
|
def metadata_dependencies
|
|
767
799
|
@metadata_dependencies ||= [
|
|
768
|
-
Dependency.new("Ruby\0",
|
|
800
|
+
Dependency.new("Ruby\0", Gem.ruby_version),
|
|
769
801
|
Dependency.new("RubyGems\0", Gem::VERSION),
|
|
770
802
|
]
|
|
771
803
|
end
|
|
@@ -792,7 +824,9 @@ module Bundler
|
|
|
792
824
|
# specs will be available later when the resolver knows where to
|
|
793
825
|
# look for that gemspec (or its dependencies)
|
|
794
826
|
source_requirements = if precompute_source_requirements_for_indirect_dependencies?
|
|
795
|
-
|
|
827
|
+
all_requirements = source_map.all_requirements
|
|
828
|
+
all_requirements = pin_locally_available_names(all_requirements) if @prefer_local
|
|
829
|
+
{ :default => sources.default_source }.merge(all_requirements)
|
|
796
830
|
else
|
|
797
831
|
{ :default => Source::RubygemsAggregate.new(sources, source_map) }.merge(source_map.direct_requirements)
|
|
798
832
|
end
|
|
@@ -802,9 +836,18 @@ module Bundler
|
|
|
802
836
|
end
|
|
803
837
|
source_requirements[:default_bundler] = source_requirements["bundler"] || sources.default_source
|
|
804
838
|
source_requirements["bundler"] = sources.metadata_source # needs to come last to override
|
|
839
|
+
verify_changed_sources!
|
|
805
840
|
source_requirements
|
|
806
841
|
end
|
|
807
842
|
|
|
843
|
+
def verify_changed_sources!
|
|
844
|
+
@specs_that_changed_sources.each do |s|
|
|
845
|
+
if s.source.specs.search(s.name).empty?
|
|
846
|
+
raise GemNotFound, "Could not find gem '#{s.name}' in #{s.source}"
|
|
847
|
+
end
|
|
848
|
+
end
|
|
849
|
+
end
|
|
850
|
+
|
|
808
851
|
def requested_groups
|
|
809
852
|
values = groups - Bundler.settings[:without] - @optional_groups + Bundler.settings[:with]
|
|
810
853
|
values &= Bundler.settings[:only] unless Bundler.settings[:only].empty?
|
|
@@ -835,13 +878,22 @@ module Bundler
|
|
|
835
878
|
end
|
|
836
879
|
end
|
|
837
880
|
|
|
838
|
-
def additional_base_requirements_for_resolve
|
|
881
|
+
def additional_base_requirements_for_resolve(last_resolve)
|
|
839
882
|
return [] unless @locked_gems && unlocking? && !sources.expired_sources?(@locked_gems.sources)
|
|
840
|
-
converge_specs(@originally_locked_specs).map do |locked_spec|
|
|
841
|
-
name
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
883
|
+
converge_specs(@originally_locked_specs - last_resolve).map do |locked_spec|
|
|
884
|
+
Dependency.new(locked_spec.name, ">= #{locked_spec.version}")
|
|
885
|
+
end.uniq
|
|
886
|
+
end
|
|
887
|
+
|
|
888
|
+
def remove_ruby_from_platforms_if_necessary!(dependencies)
|
|
889
|
+
return if Bundler.frozen_bundle? ||
|
|
890
|
+
Bundler.local_platform == Gem::Platform::RUBY ||
|
|
891
|
+
!platforms.include?(Gem::Platform::RUBY) ||
|
|
892
|
+
(@new_platform && platforms.last == Gem::Platform::RUBY) ||
|
|
893
|
+
!@originally_locked_specs.incomplete_ruby_specs?(expand_dependencies(dependencies))
|
|
894
|
+
|
|
895
|
+
remove_platform(Gem::Platform::RUBY)
|
|
896
|
+
add_current_platform
|
|
845
897
|
end
|
|
846
898
|
|
|
847
899
|
def source_map
|
|
@@ -7,92 +7,24 @@ require_relative "rubygems_ext"
|
|
|
7
7
|
module Bundler
|
|
8
8
|
class Dependency < Gem::Dependency
|
|
9
9
|
attr_reader :autorequire
|
|
10
|
-
attr_reader :groups, :platforms, :gemfile, :git, :github, :branch, :ref, :force_ruby_platform
|
|
10
|
+
attr_reader :groups, :platforms, :gemfile, :path, :git, :github, :branch, :ref, :force_ruby_platform
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
ALL_RUBY_VERSIONS = ((18..27).to_a + (30..31).to_a).freeze
|
|
13
13
|
PLATFORM_MAP = {
|
|
14
|
-
:ruby
|
|
15
|
-
:
|
|
16
|
-
:
|
|
17
|
-
:
|
|
18
|
-
:
|
|
19
|
-
:
|
|
20
|
-
:
|
|
21
|
-
:
|
|
22
|
-
:
|
|
23
|
-
:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
:
|
|
27
|
-
|
|
28
|
-
:mri_18 => Gem::Platform::RUBY,
|
|
29
|
-
:mri_19 => Gem::Platform::RUBY,
|
|
30
|
-
:mri_20 => Gem::Platform::RUBY,
|
|
31
|
-
:mri_21 => Gem::Platform::RUBY,
|
|
32
|
-
:mri_22 => Gem::Platform::RUBY,
|
|
33
|
-
:mri_23 => Gem::Platform::RUBY,
|
|
34
|
-
:mri_24 => Gem::Platform::RUBY,
|
|
35
|
-
:mri_25 => Gem::Platform::RUBY,
|
|
36
|
-
:mri_26 => Gem::Platform::RUBY,
|
|
37
|
-
:mri_27 => Gem::Platform::RUBY,
|
|
38
|
-
:mri_30 => Gem::Platform::RUBY,
|
|
39
|
-
:mri_31 => Gem::Platform::RUBY,
|
|
40
|
-
:rbx => Gem::Platform::RUBY,
|
|
41
|
-
:truffleruby => Gem::Platform::RUBY,
|
|
42
|
-
:jruby => Gem::Platform::JAVA,
|
|
43
|
-
:jruby_18 => Gem::Platform::JAVA,
|
|
44
|
-
:jruby_19 => Gem::Platform::JAVA,
|
|
45
|
-
:mswin => Gem::Platform::MSWIN,
|
|
46
|
-
:mswin_18 => Gem::Platform::MSWIN,
|
|
47
|
-
:mswin_19 => Gem::Platform::MSWIN,
|
|
48
|
-
:mswin_20 => Gem::Platform::MSWIN,
|
|
49
|
-
:mswin_21 => Gem::Platform::MSWIN,
|
|
50
|
-
:mswin_22 => Gem::Platform::MSWIN,
|
|
51
|
-
:mswin_23 => Gem::Platform::MSWIN,
|
|
52
|
-
:mswin_24 => Gem::Platform::MSWIN,
|
|
53
|
-
:mswin_25 => Gem::Platform::MSWIN,
|
|
54
|
-
:mswin_26 => Gem::Platform::MSWIN,
|
|
55
|
-
:mswin_27 => Gem::Platform::MSWIN,
|
|
56
|
-
:mswin_30 => Gem::Platform::MSWIN,
|
|
57
|
-
:mswin_31 => Gem::Platform::MSWIN,
|
|
58
|
-
:mswin64 => Gem::Platform::MSWIN64,
|
|
59
|
-
:mswin64_19 => Gem::Platform::MSWIN64,
|
|
60
|
-
:mswin64_20 => Gem::Platform::MSWIN64,
|
|
61
|
-
:mswin64_21 => Gem::Platform::MSWIN64,
|
|
62
|
-
:mswin64_22 => Gem::Platform::MSWIN64,
|
|
63
|
-
:mswin64_23 => Gem::Platform::MSWIN64,
|
|
64
|
-
:mswin64_24 => Gem::Platform::MSWIN64,
|
|
65
|
-
:mswin64_25 => Gem::Platform::MSWIN64,
|
|
66
|
-
:mswin64_26 => Gem::Platform::MSWIN64,
|
|
67
|
-
:mswin64_27 => Gem::Platform::MSWIN64,
|
|
68
|
-
:mswin64_30 => Gem::Platform::MSWIN64,
|
|
69
|
-
:mswin64_31 => Gem::Platform::MSWIN64,
|
|
70
|
-
:mingw => Gem::Platform::MINGW,
|
|
71
|
-
:mingw_18 => Gem::Platform::MINGW,
|
|
72
|
-
:mingw_19 => Gem::Platform::MINGW,
|
|
73
|
-
:mingw_20 => Gem::Platform::MINGW,
|
|
74
|
-
:mingw_21 => Gem::Platform::MINGW,
|
|
75
|
-
:mingw_22 => Gem::Platform::MINGW,
|
|
76
|
-
:mingw_23 => Gem::Platform::MINGW,
|
|
77
|
-
:mingw_24 => Gem::Platform::MINGW,
|
|
78
|
-
:mingw_25 => Gem::Platform::MINGW,
|
|
79
|
-
:mingw_26 => Gem::Platform::MINGW,
|
|
80
|
-
:mingw_27 => Gem::Platform::MINGW,
|
|
81
|
-
:mingw_30 => Gem::Platform::MINGW,
|
|
82
|
-
:mingw_31 => Gem::Platform::MINGW,
|
|
83
|
-
:x64_mingw => Gem::Platform::X64_MINGW,
|
|
84
|
-
:x64_mingw_20 => Gem::Platform::X64_MINGW,
|
|
85
|
-
:x64_mingw_21 => Gem::Platform::X64_MINGW,
|
|
86
|
-
:x64_mingw_22 => Gem::Platform::X64_MINGW,
|
|
87
|
-
:x64_mingw_23 => Gem::Platform::X64_MINGW,
|
|
88
|
-
:x64_mingw_24 => Gem::Platform::X64_MINGW,
|
|
89
|
-
:x64_mingw_25 => Gem::Platform::X64_MINGW,
|
|
90
|
-
:x64_mingw_26 => Gem::Platform::X64_MINGW,
|
|
91
|
-
:x64_mingw_27 => Gem::Platform::X64_MINGW,
|
|
92
|
-
:x64_mingw_30 => Gem::Platform::X64_MINGW,
|
|
93
|
-
:x64_mingw_31 => Gem::Platform::X64_MINGW,
|
|
94
|
-
}.freeze
|
|
95
|
-
# rubocop:enable Naming/VariableNumber
|
|
14
|
+
:ruby => [Gem::Platform::RUBY, ALL_RUBY_VERSIONS],
|
|
15
|
+
:mri => [Gem::Platform::RUBY, ALL_RUBY_VERSIONS],
|
|
16
|
+
:rbx => [Gem::Platform::RUBY],
|
|
17
|
+
:truffleruby => [Gem::Platform::RUBY],
|
|
18
|
+
:jruby => [Gem::Platform::JAVA, [18, 19]],
|
|
19
|
+
:windows => [Gem::Platform::WINDOWS, ALL_RUBY_VERSIONS],
|
|
20
|
+
:mswin => [Gem::Platform::MSWIN, ALL_RUBY_VERSIONS],
|
|
21
|
+
:mswin64 => [Gem::Platform::MSWIN64, ALL_RUBY_VERSIONS - [18]],
|
|
22
|
+
:mingw => [Gem::Platform::MINGW, ALL_RUBY_VERSIONS],
|
|
23
|
+
:x64_mingw => [Gem::Platform::X64_MINGW, ALL_RUBY_VERSIONS - [18, 19]],
|
|
24
|
+
}.each_with_object({}) do |(platform, spec), hash|
|
|
25
|
+
hash[platform] = spec[0]
|
|
26
|
+
spec[1]&.each {|version| hash[:"#{platform}_#{version}"] = spec[0] }
|
|
27
|
+
end.freeze
|
|
96
28
|
|
|
97
29
|
def initialize(name, version, options = {}, &blk)
|
|
98
30
|
type = options["type"] || :runtime
|
|
@@ -101,6 +33,7 @@ module Bundler
|
|
|
101
33
|
@autorequire = nil
|
|
102
34
|
@groups = Array(options["group"] || :default).map(&:to_sym)
|
|
103
35
|
@source = options["source"]
|
|
36
|
+
@path = options["path"]
|
|
104
37
|
@git = options["git"]
|
|
105
38
|
@github = options["github"]
|
|
106
39
|
@branch = options["branch"]
|
|
@@ -151,7 +84,7 @@ module Bundler
|
|
|
151
84
|
def to_lock
|
|
152
85
|
out = super
|
|
153
86
|
out << "!" if source
|
|
154
|
-
out
|
|
87
|
+
out
|
|
155
88
|
end
|
|
156
89
|
|
|
157
90
|
def specific?
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
module Bundler
|
|
4
4
|
# used for Creating Specifications from the Gemcutter Endpoint
|
|
5
5
|
class EndpointSpecification < Gem::Specification
|
|
6
|
-
include
|
|
6
|
+
include MatchRemoteMetadata
|
|
7
7
|
|
|
8
8
|
attr_reader :name, :version, :platform, :checksum
|
|
9
9
|
attr_accessor :source, :remote, :dependencies
|
|
@@ -12,7 +12,7 @@ module Bundler
|
|
|
12
12
|
super()
|
|
13
13
|
@name = name
|
|
14
14
|
@version = Gem::Version.create version
|
|
15
|
-
@platform = platform
|
|
15
|
+
@platform = Gem::Platform.new(platform)
|
|
16
16
|
@spec_fetcher = spec_fetcher
|
|
17
17
|
@dependencies = dependencies.map {|dep, reqs| build_dependency(dep, reqs) }
|
|
18
18
|
|
|
@@ -22,17 +22,6 @@ module Bundler
|
|
|
22
22
|
parse_metadata(metadata)
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
-
def required_ruby_version
|
|
26
|
-
@required_ruby_version ||= _remote_specification.required_ruby_version
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
# A fallback is included because the original version of the specification
|
|
30
|
-
# API didn't include that field, so some marshalled specs in the index have it
|
|
31
|
-
# set to +nil+.
|
|
32
|
-
def required_rubygems_version
|
|
33
|
-
@required_rubygems_version ||= _remote_specification.required_rubygems_version || Gem::Requirement.default
|
|
34
|
-
end
|
|
35
|
-
|
|
36
25
|
def fetch_platform
|
|
37
26
|
@platform
|
|
38
27
|
end
|
|
@@ -39,7 +39,6 @@ module Bundler
|
|
|
39
39
|
settings_flag(:setup_makes_kernel_gem_public) { !bundler_3_mode? }
|
|
40
40
|
settings_flag(:suppress_install_using_messages) { bundler_3_mode? }
|
|
41
41
|
settings_flag(:update_requires_all_flag) { bundler_4_mode? }
|
|
42
|
-
settings_flag(:use_gem_version_promoter_for_major_updates) { bundler_3_mode? }
|
|
43
42
|
|
|
44
43
|
settings_option(:default_cli_command) { bundler_3_mode? ? :cli_help : :install }
|
|
45
44
|
|
|
@@ -240,8 +240,8 @@ module Bundler
|
|
|
240
240
|
def connection
|
|
241
241
|
@connection ||= begin
|
|
242
242
|
needs_ssl = remote_uri.scheme == "https" ||
|
|
243
|
-
|
|
244
|
-
|
|
243
|
+
Bundler.settings[:ssl_verify_mode] ||
|
|
244
|
+
Bundler.settings[:ssl_client_cert]
|
|
245
245
|
raise SSLError if needs_ssl && !defined?(OpenSSL::SSL)
|
|
246
246
|
|
|
247
247
|
con = PersistentHTTP.new :name => "bundler", :proxy => :ENV
|
|
@@ -256,8 +256,8 @@ module Bundler
|
|
|
256
256
|
end
|
|
257
257
|
|
|
258
258
|
ssl_client_cert = Bundler.settings[:ssl_client_cert] ||
|
|
259
|
-
|
|
260
|
-
|
|
259
|
+
(Gem.configuration.ssl_client_cert if
|
|
260
|
+
Gem.configuration.respond_to?(:ssl_client_cert))
|
|
261
261
|
if ssl_client_cert
|
|
262
262
|
pem = File.read(ssl_client_cert)
|
|
263
263
|
con.cert = OpenSSL::X509::Certificate.new(pem)
|
|
@@ -288,8 +288,8 @@ module Bundler
|
|
|
288
288
|
def bundler_cert_store
|
|
289
289
|
store = OpenSSL::X509::Store.new
|
|
290
290
|
ssl_ca_cert = Bundler.settings[:ssl_ca_cert] ||
|
|
291
|
-
|
|
292
|
-
|
|
291
|
+
(Gem.configuration.ssl_ca_cert if
|
|
292
|
+
Gem.configuration.respond_to?(:ssl_ca_cert))
|
|
293
293
|
if ssl_ca_cert
|
|
294
294
|
if File.directory? ssl_ca_cert
|
|
295
295
|
store.add_path ssl_ca_cert
|
|
@@ -44,6 +44,12 @@ module Bundler
|
|
|
44
44
|
|
|
45
45
|
def select_best_platform_match(specs, platform)
|
|
46
46
|
matching = specs.select {|spec| spec.match_platform(platform) }
|
|
47
|
+
|
|
48
|
+
sort_best_platform_match(matching, platform)
|
|
49
|
+
end
|
|
50
|
+
module_function :select_best_platform_match
|
|
51
|
+
|
|
52
|
+
def sort_best_platform_match(matching, platform)
|
|
47
53
|
exact = matching.select {|spec| spec.platform == platform }
|
|
48
54
|
return exact if exact.any?
|
|
49
55
|
|
|
@@ -52,7 +58,7 @@ module Bundler
|
|
|
52
58
|
|
|
53
59
|
sorted_matching.take_while {|spec| same_specificity(platform, spec, exemplary_spec) && same_deps(spec, exemplary_spec) }
|
|
54
60
|
end
|
|
55
|
-
module_function :
|
|
61
|
+
module_function :sort_best_platform_match
|
|
56
62
|
|
|
57
63
|
class PlatformMatch
|
|
58
64
|
def self.specificity_score(spec_platform, user_platform)
|
|
@@ -55,19 +55,17 @@ module Bundler
|
|
|
55
55
|
@level = v
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
-
# Given a Dependency and an Array of
|
|
59
|
-
# gem, this method will return the Array of
|
|
58
|
+
# Given a Dependency and an Array of Specifications of available versions for a
|
|
59
|
+
# gem, this method will return the Array of Specifications sorted (and possibly
|
|
60
60
|
# truncated if strict is true) in an order to give preference to the current
|
|
61
61
|
# level (:major, :minor or :patch) when resolution is deciding what versions
|
|
62
62
|
# best resolve all dependencies in the bundle.
|
|
63
63
|
# @param dep [Dependency] The Dependency of the gem.
|
|
64
|
-
# @param spec_groups [
|
|
64
|
+
# @param spec_groups [Specification] An array of Specifications for the same gem
|
|
65
65
|
# named in the @dep param.
|
|
66
|
-
# @return [
|
|
66
|
+
# @return [Specification] A new instance of the Specification Array sorted and
|
|
67
67
|
# possibly filtered.
|
|
68
68
|
def sort_versions(dep, spec_groups)
|
|
69
|
-
before_result = "before sort_versions: #{debug_format_result(dep, spec_groups).inspect}" if DEBUG
|
|
70
|
-
|
|
71
69
|
@sort_versions[dep] ||= begin
|
|
72
70
|
gem_name = dep.name
|
|
73
71
|
|
|
@@ -79,15 +77,14 @@ module Bundler
|
|
|
79
77
|
filter_dep_specs(spec_groups, locked_spec)
|
|
80
78
|
else
|
|
81
79
|
sort_dep_specs(spec_groups, locked_spec)
|
|
82
|
-
end.tap do |specs|
|
|
83
|
-
if DEBUG
|
|
84
|
-
puts before_result
|
|
85
|
-
puts " after sort_versions: #{debug_format_result(dep, specs).inspect}"
|
|
86
|
-
end
|
|
87
80
|
end
|
|
88
81
|
end
|
|
89
82
|
end
|
|
90
83
|
|
|
84
|
+
def reset
|
|
85
|
+
@sort_versions = {}
|
|
86
|
+
end
|
|
87
|
+
|
|
91
88
|
# @return [bool] Convenience method for testing value of level variable.
|
|
92
89
|
def major?
|
|
93
90
|
level == :major
|
|
@@ -179,12 +176,5 @@ module Bundler
|
|
|
179
176
|
move, keep = result.partition {|s| s.version.to_s == version.to_s }
|
|
180
177
|
keep.concat(move)
|
|
181
178
|
end
|
|
182
|
-
|
|
183
|
-
def debug_format_result(dep, spec_groups)
|
|
184
|
-
a = [dep.to_s,
|
|
185
|
-
spec_groups.map {|sg| [sg.version, sg.dependencies_for_activated_platforms.map {|dp| [dp.name, dp.requirement.to_s] }] }]
|
|
186
|
-
last_map = a.last.map {|sg_data| [sg_data.first.version, sg_data.last.map {|aa| aa.join(" ") }] }
|
|
187
|
-
[a.first, last_map, level, strict ? :strict : :not_strict]
|
|
188
|
-
end
|
|
189
179
|
end
|
|
190
180
|
end
|
|
@@ -115,13 +115,14 @@ module Bundler
|
|
|
115
115
|
end
|
|
116
116
|
|
|
117
117
|
source = ", :source => \"#{d.source}\"" unless d.source.nil?
|
|
118
|
+
path = ", :path => \"#{d.path}\"" unless d.path.nil?
|
|
118
119
|
git = ", :git => \"#{d.git}\"" unless d.git.nil?
|
|
119
120
|
github = ", :github => \"#{d.github}\"" unless d.github.nil?
|
|
120
121
|
branch = ", :branch => \"#{d.branch}\"" unless d.branch.nil?
|
|
121
122
|
ref = ", :ref => \"#{d.ref}\"" unless d.ref.nil?
|
|
122
123
|
require_path = ", :require => #{convert_autorequire(d.autorequire)}" unless d.autorequire.nil?
|
|
123
124
|
|
|
124
|
-
%(gem #{name}#{requirement}#{group}#{source}#{git}#{github}#{branch}#{ref}#{require_path})
|
|
125
|
+
%(gem #{name}#{requirement}#{group}#{source}#{path}#{git}#{github}#{branch}#{ref}#{require_path})
|
|
125
126
|
end.join("\n")
|
|
126
127
|
end
|
|
127
128
|
|
|
@@ -54,7 +54,7 @@ def gemfile(install = false, options = {}, &gemfile)
|
|
|
54
54
|
|
|
55
55
|
Bundler.ui = install ? ui : Bundler::UI::Silent.new
|
|
56
56
|
if install || definition.missing_specs?
|
|
57
|
-
Bundler.settings.temporary(:inline => true) do
|
|
57
|
+
Bundler.settings.temporary(:inline => true, :no_install => false) do
|
|
58
58
|
installer = Bundler::Installer.install(Bundler.root, definition, :system => true)
|
|
59
59
|
installer.post_install_messages.each do |name, message|
|
|
60
60
|
Bundler.ui.info "Post-install message from #{name}:\n#{message}"
|
|
@@ -238,19 +238,14 @@ module Bundler
|
|
|
238
238
|
end
|
|
239
239
|
|
|
240
240
|
def ensure_specs_are_compatible!
|
|
241
|
-
system_ruby = Bundler::RubyVersion.system
|
|
242
|
-
rubygems_version = Bundler.rubygems.version
|
|
243
241
|
@definition.specs.each do |spec|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
"which is incompatible with the current version, #{system_ruby}"
|
|
248
|
-
end
|
|
242
|
+
unless spec.matches_current_ruby?
|
|
243
|
+
raise InstallError, "#{spec.full_name} requires ruby version #{spec.required_ruby_version}, " \
|
|
244
|
+
"which is incompatible with the current version, #{Gem.ruby_version}"
|
|
249
245
|
end
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
"which is incompatible with the current version, #{rubygems_version}"
|
|
246
|
+
unless spec.matches_current_rubygems?
|
|
247
|
+
raise InstallError, "#{spec.full_name} requires rubygems version #{spec.required_rubygems_version}, " \
|
|
248
|
+
"which is incompatible with the current version, #{Gem.rubygems_version}"
|
|
254
249
|
end
|
|
255
250
|
end
|
|
256
251
|
end
|
|
@@ -268,7 +263,14 @@ module Bundler
|
|
|
268
263
|
return false if @definition.nothing_changed? && !@definition.missing_specs?
|
|
269
264
|
end
|
|
270
265
|
|
|
271
|
-
options["local"]
|
|
266
|
+
if options["local"]
|
|
267
|
+
@definition.resolve_with_cache!
|
|
268
|
+
elsif options["prefer-local"]
|
|
269
|
+
@definition.resolve_prefering_local!
|
|
270
|
+
else
|
|
271
|
+
@definition.resolve_remotely!
|
|
272
|
+
end
|
|
273
|
+
|
|
272
274
|
true
|
|
273
275
|
end
|
|
274
276
|
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative "match_platform"
|
|
4
|
-
|
|
5
3
|
module Bundler
|
|
6
4
|
class LazySpecification
|
|
7
5
|
include MatchPlatform
|
|
@@ -76,35 +74,35 @@ module Bundler
|
|
|
76
74
|
end
|
|
77
75
|
|
|
78
76
|
def materialize_for_installation
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
source.local!
|
|
78
|
+
|
|
79
|
+
candidates = if source.is_a?(Source::Path) || !ruby_platform_materializes_to_ruby_platform?
|
|
80
|
+
target_platform = ruby_platform_materializes_to_ruby_platform? ? platform : Bundler.local_platform
|
|
81
|
+
|
|
82
|
+
source.specs.search(Dependency.new(name, version)).select do |spec|
|
|
83
|
+
MatchPlatform.platforms_match?(spec.platform, target_platform)
|
|
84
|
+
end
|
|
85
|
+
else
|
|
86
|
+
source.specs.search(self)
|
|
87
|
+
end
|
|
81
88
|
|
|
82
|
-
|
|
83
|
-
return self unless Gem::Platform.match_spec?(self)
|
|
89
|
+
return self if candidates.empty?
|
|
84
90
|
|
|
85
|
-
__materialize__(
|
|
91
|
+
__materialize__(candidates)
|
|
86
92
|
end
|
|
87
93
|
|
|
88
|
-
def __materialize__(
|
|
89
|
-
@specification =
|
|
90
|
-
|
|
91
|
-
else
|
|
92
|
-
search_object = if source.is_a?(Source::Path)
|
|
93
|
-
Dependency.new(name, version)
|
|
94
|
-
else
|
|
95
|
-
ruby_platform_materializes_to_ruby_platform? ? self : Dependency.new(name, version)
|
|
96
|
-
end
|
|
97
|
-
candidates = source.specs.search(search_object)
|
|
98
|
-
same_platform_candidates = candidates.select do |spec|
|
|
99
|
-
MatchPlatform.platforms_match?(spec.platform, platform)
|
|
100
|
-
end
|
|
101
|
-
installable_candidates = same_platform_candidates.select do |spec|
|
|
94
|
+
def __materialize__(candidates)
|
|
95
|
+
@specification = begin
|
|
96
|
+
search = candidates.reverse.find do |spec|
|
|
102
97
|
spec.is_a?(StubSpecification) ||
|
|
103
|
-
(spec.
|
|
104
|
-
spec.
|
|
98
|
+
(spec.matches_current_ruby? &&
|
|
99
|
+
spec.matches_current_rubygems?)
|
|
100
|
+
end
|
|
101
|
+
if search.nil? && Bundler.frozen_bundle?
|
|
102
|
+
search = candidates.last
|
|
103
|
+
else
|
|
104
|
+
search.dependencies = dependencies if search && search.full_name == full_name && (search.is_a?(RemoteSpecification) || search.is_a?(EndpointSpecification))
|
|
105
105
|
end
|
|
106
|
-
search = installable_candidates.last || same_platform_candidates.last
|
|
107
|
-
search.dependencies = dependencies if search && (search.is_a?(RemoteSpecification) || search.is_a?(EndpointSpecification))
|
|
108
106
|
search
|
|
109
107
|
end
|
|
110
108
|
end
|