rubygems-update 3.2.0.rc.2 → 3.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{History.txt → CHANGELOG.md} +520 -501
- data/Manifest.txt +62 -55
- data/POLICIES.md +4 -3
- data/Rakefile +23 -7
- data/bundler/CHANGELOG.md +84 -19
- data/bundler/UPGRADING.md +1 -1
- data/bundler/bundler.gemspec +1 -1
- data/bundler/lib/bundler.rb +11 -0
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli.rb +5 -5
- data/bundler/lib/bundler/cli/binstubs.rb +6 -2
- data/bundler/lib/bundler/cli/exec.rb +3 -3
- data/bundler/lib/bundler/cli/install.rb +14 -5
- data/bundler/lib/bundler/cli/outdated.rb +0 -2
- data/bundler/lib/bundler/cli/update.rb +1 -1
- data/bundler/lib/bundler/compact_index_client/cache.rb +5 -13
- data/bundler/lib/bundler/compact_index_client/gem_parser.rb +28 -0
- data/bundler/lib/bundler/compact_index_client/updater.rb +5 -5
- data/bundler/lib/bundler/definition.rb +23 -25
- data/bundler/lib/bundler/dependency.rb +3 -1
- data/bundler/lib/bundler/env.rb +1 -1
- data/bundler/lib/bundler/feature_flag.rb +0 -1
- data/bundler/lib/bundler/fetcher/index.rb +2 -3
- data/bundler/lib/bundler/friendly_errors.rb +15 -0
- data/bundler/lib/bundler/gem_helpers.rb +30 -24
- data/bundler/lib/bundler/index.rb +5 -1
- data/bundler/lib/bundler/injector.rb +9 -2
- data/bundler/lib/bundler/installer.rb +7 -5
- data/bundler/lib/bundler/lazy_specification.rb +20 -9
- data/bundler/lib/bundler/man/.document +1 -0
- data/bundler/{man → lib/bundler/man}/bundle-add.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-add.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-binstubs.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-binstubs.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-cache.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-cache.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-check.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-check.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-clean.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-clean.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-config.1 +2 -5
- data/bundler/{man → lib/bundler/man}/bundle-config.1.ronn +1 -9
- data/bundler/{man → lib/bundler/man}/bundle-doctor.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-doctor.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-exec.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-exec.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-gem.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-gem.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-info.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-info.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-init.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-init.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-inject.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-inject.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-install.1 +2 -2
- data/bundler/{man → lib/bundler/man}/bundle-install.1.ronn +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-list.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-list.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-lock.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-lock.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-open.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-open.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-outdated.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-outdated.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-platform.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-platform.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-pristine.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-pristine.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-remove.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-remove.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-show.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-show.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-update.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-update.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-viz.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-viz.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/gemfile.5 +1 -1
- data/bundler/{man → lib/bundler/man}/gemfile.5.ronn +0 -0
- data/bundler/lib/bundler/man/index.txt +25 -0
- data/bundler/lib/bundler/plugin/api/source.rb +1 -1
- data/bundler/lib/bundler/plugin/dsl.rb +1 -1
- data/bundler/lib/bundler/resolver.rb +25 -29
- data/bundler/lib/bundler/resolver/spec_group.rb +19 -25
- data/bundler/lib/bundler/rubygems_integration.rb +4 -6
- data/bundler/lib/bundler/settings.rb +0 -1
- data/bundler/lib/bundler/source/git/git_proxy.rb +28 -41
- data/bundler/lib/bundler/spec_set.rb +6 -8
- data/bundler/lib/bundler/stub_specification.rb +0 -2
- data/bundler/lib/bundler/templates/newgem/README.md.tt +0 -1
- data/bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt +2 -2
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +6 -0
- data/bundler/lib/bundler/uri_credentials_filter.rb +2 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +34 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +2 -2
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +1 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +38 -40
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +12 -8
- data/bundler/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +154 -0
- data/bundler/lib/bundler/vendored_tmpdir.rb +4 -0
- data/bundler/lib/bundler/version.rb +1 -1
- data/lib/rubygems.rb +6 -2
- data/lib/rubygems/available_set.rb +1 -1
- data/lib/rubygems/command_manager.rb +2 -2
- data/lib/rubygems/commands/build_command.rb +37 -20
- data/lib/rubygems/commands/cert_command.rb +1 -1
- data/lib/rubygems/commands/help_command.rb +2 -0
- data/lib/rubygems/commands/owner_command.rb +10 -3
- data/lib/rubygems/commands/pristine_command.rb +1 -1
- data/lib/rubygems/commands/push_command.rb +7 -4
- data/lib/rubygems/commands/query_command.rb +17 -0
- data/lib/rubygems/commands/server_command.rb +4 -0
- data/lib/rubygems/commands/setup_command.rb +26 -90
- data/lib/rubygems/commands/sources_command.rb +6 -2
- data/lib/rubygems/commands/specification_command.rb +6 -0
- data/lib/rubygems/commands/yank_command.rb +4 -5
- data/lib/rubygems/core_ext/kernel_require.rb +3 -0
- data/lib/rubygems/core_ext/kernel_warn.rb +6 -7
- data/lib/rubygems/defaults.rb +2 -2
- data/lib/rubygems/dependency.rb +1 -1
- data/lib/rubygems/dependency_installer.rb +5 -3
- data/lib/rubygems/ext/builder.rb +16 -35
- data/lib/rubygems/ext/cmake_builder.rb +5 -6
- data/lib/rubygems/ext/configure_builder.rb +5 -6
- data/lib/rubygems/ext/ext_conf_builder.rb +19 -14
- data/lib/rubygems/ext/rake_builder.rb +4 -4
- data/lib/rubygems/gemcutter_utilities.rb +101 -20
- data/lib/rubygems/indexer.rb +0 -1
- data/lib/rubygems/install_update_options.rb +2 -2
- data/lib/rubygems/installer.rb +12 -32
- data/lib/rubygems/installer_test_case.rb +7 -6
- data/lib/rubygems/name_tuple.rb +1 -1
- data/lib/rubygems/openssl.rb +4 -4
- data/lib/rubygems/package.rb +3 -2
- data/lib/rubygems/package/tar_header.rb +1 -1
- data/lib/rubygems/package/tar_test_case.rb +1 -1
- data/lib/rubygems/platform.rb +18 -7
- data/lib/rubygems/query_utils.rb +0 -9
- data/lib/rubygems/remote_fetcher.rb +5 -4
- data/lib/rubygems/request.rb +4 -3
- data/lib/rubygems/request_set.rb +2 -13
- data/lib/rubygems/request_set/gem_dependency_api.rb +4 -4
- data/lib/rubygems/requirement.rb +1 -1
- data/lib/rubygems/resolver.rb +7 -2
- data/lib/rubygems/resolver/activation_request.rb +9 -1
- data/lib/rubygems/resolver/api_set.rb +29 -20
- data/lib/rubygems/resolver/api_set/gem_parser.rb +20 -0
- data/lib/rubygems/resolver/api_specification.rb +8 -3
- data/lib/rubygems/resolver/best_set.rb +2 -2
- data/lib/rubygems/resolver/conflict.rb +1 -1
- data/lib/rubygems/resolver/dependency_request.rb +1 -1
- data/lib/rubygems/resolver/index_specification.rb +29 -0
- data/lib/rubygems/resolver/installer_set.rb +58 -9
- data/lib/rubygems/resolver/lock_set.rb +1 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo.rb +6 -5
- data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/resolution_state.rb +7 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb +1 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +39 -5
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/action.rb +1 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +2 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +2 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +2 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +2 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/log.rb +7 -6
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/set_payload.rb +2 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/tag.rb +4 -3
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex.rb +43 -10
- data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +75 -7
- data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +2 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider.rb +1 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb +3 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb +506 -165
- data/lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb +3 -2
- data/lib/rubygems/resolver/molinillo/lib/molinillo/state.rb +8 -4
- data/lib/rubygems/resolver/spec_specification.rb +14 -0
- data/lib/rubygems/resolver/specification.rb +13 -1
- data/lib/rubygems/s3_uri_signer.rb +1 -1
- data/lib/rubygems/security.rb +1 -2
- data/lib/rubygems/security/policy.rb +1 -1
- data/lib/rubygems/security/signer.rb +1 -1
- data/lib/rubygems/server.rb +7 -2
- data/lib/rubygems/source.rb +20 -9
- data/lib/rubygems/spec_fetcher.rb +1 -1
- data/lib/rubygems/specification.rb +8 -8
- data/lib/rubygems/ssl_certs/{index.rubygems.org → rubygems.org}/GlobalSignRootCA.pem +0 -0
- data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA_R3.pem +21 -0
- data/lib/rubygems/stub_specification.rb +1 -1
- data/lib/rubygems/test_case.rb +14 -27
- data/lib/rubygems/test_utilities.rb +6 -5
- data/lib/rubygems/uri_formatter.rb +2 -1
- data/lib/rubygems/version_option.rb +6 -0
- data/rubygems-update.gemspec +2 -2
- data/test/rubygems/data/null-required-rubygems-version.gemspec.rz +0 -0
- data/test/rubygems/test_bundled_ca.rb +9 -5
- data/test/rubygems/test_gem.rb +3 -3
- data/test/rubygems/test_gem_commands_build_command.rb +197 -5
- data/test/rubygems/test_gem_commands_cert_command.rb +2 -2
- data/test/rubygems/test_gem_commands_cleanup_command.rb +1 -1
- data/test/rubygems/test_gem_commands_contents_command.rb +2 -2
- data/test/rubygems/test_gem_commands_help_command.rb +15 -2
- data/test/rubygems/test_gem_commands_install_command.rb +132 -1
- data/test/rubygems/test_gem_commands_owner_command.rb +49 -1
- data/test/rubygems/test_gem_commands_pristine_command.rb +2 -2
- data/test/rubygems/test_gem_commands_push_command.rb +70 -5
- data/test/rubygems/test_gem_commands_query_command.rb +3 -3
- data/test/rubygems/test_gem_commands_setup_command.rb +20 -48
- data/test/rubygems/test_gem_commands_signin_command.rb +27 -3
- data/test/rubygems/test_gem_commands_sources_command.rb +60 -0
- data/test/rubygems/test_gem_commands_specification_command.rb +28 -0
- data/test/rubygems/test_gem_commands_update_command.rb +2 -2
- data/test/rubygems/test_gem_commands_yank_command.rb +31 -1
- data/test/rubygems/test_gem_dependency_installer.rb +63 -49
- data/test/rubygems/test_gem_dependency_list.rb +2 -2
- data/test/rubygems/test_gem_ext_builder.rb +16 -20
- data/test/rubygems/test_gem_ext_cmake_builder.rb +5 -13
- data/test/rubygems/test_gem_ext_configure_builder.rb +5 -11
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +9 -26
- data/test/rubygems/test_gem_ext_rake_builder.rb +30 -13
- data/test/rubygems/test_gem_gem_runner.rb +5 -4
- data/test/rubygems/test_gem_gemcutter_utilities.rb +3 -3
- data/test/rubygems/test_gem_install_update_options.rb +15 -3
- data/test/rubygems/test_gem_installer.rb +80 -71
- data/test/rubygems/test_gem_package.rb +8 -8
- data/test/rubygems/test_gem_package_old.rb +4 -4
- data/test/rubygems/test_gem_package_tar_writer.rb +1 -1
- data/test/rubygems/test_gem_platform.rb +63 -4
- data/test/rubygems/test_gem_remote_fetcher.rb +15 -19
- data/test/rubygems/test_gem_request.rb +2 -2
- data/test/rubygems/test_gem_request_set_lockfile.rb +4 -4
- data/test/rubygems/test_gem_resolver_api_set.rb +58 -55
- data/test/rubygems/test_gem_resolver_api_specification.rb +3 -3
- data/test/rubygems/test_gem_resolver_best_set.rb +26 -3
- data/test/rubygems/test_gem_resolver_conflict.rb +1 -1
- data/test/rubygems/test_gem_resolver_vendor_set.rb +1 -1
- data/test/rubygems/test_gem_security.rb +2 -2
- data/test/rubygems/test_gem_security_policy.rb +2 -2
- data/test/rubygems/test_gem_security_signer.rb +2 -2
- data/test/rubygems/test_gem_security_trust_dir.rb +2 -2
- data/test/rubygems/test_gem_source.rb +7 -2
- data/test/rubygems/test_gem_source_subpath_problem.rb +49 -0
- data/test/rubygems/test_gem_specification.rb +6 -7
- data/test/rubygems/test_gem_uninstaller.rb +7 -7
- data/test/rubygems/test_gem_validator.rb +1 -1
- data/test/rubygems/test_gem_version_option.rb +1 -1
- data/test/rubygems/test_require.rb +50 -9
- data/test/test_changelog_generator.rb +17 -0
- metadata +69 -86
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +0 -26
- data/lib/rubygems/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +0 -23
- data/lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +0 -25
@@ -22,10 +22,11 @@ module Bundler
|
|
22
22
|
break unless dep = deps.shift
|
23
23
|
next if !handled.add?(dep) || skip.include?(dep.name)
|
24
24
|
|
25
|
-
|
26
|
-
|
25
|
+
specs_for_dep = spec_for_dependency(dep, match_current_platform)
|
26
|
+
if specs_for_dep.any?
|
27
|
+
specs += specs_for_dep
|
27
28
|
|
28
|
-
|
29
|
+
specs_for_dep.first.dependencies.each do |d|
|
29
30
|
next if d.type == :development
|
30
31
|
d = DepProxy.new(d, dep.__platform) unless match_current_platform
|
31
32
|
deps << d
|
@@ -100,6 +101,7 @@ module Bundler
|
|
100
101
|
@specs.map do |s|
|
101
102
|
next s unless s.is_a?(LazySpecification)
|
102
103
|
s.source.dependency_names = names if s.source.respond_to?(:dependency_names=)
|
104
|
+
s.source.remote!
|
103
105
|
spec = s.__materialize__
|
104
106
|
raise GemNotFound, "Could not find #{s.full_name} in any of the sources" unless spec
|
105
107
|
spec
|
@@ -183,11 +185,7 @@ module Bundler
|
|
183
185
|
def spec_for_dependency(dep, match_current_platform)
|
184
186
|
specs_for_platforms = lookup[dep.name]
|
185
187
|
if match_current_platform
|
186
|
-
Bundler.
|
187
|
-
match = GemHelpers.select_best_platform_match(specs_for_platforms, pl)
|
188
|
-
return match if match
|
189
|
-
end
|
190
|
-
nil
|
188
|
+
GemHelpers.select_best_platform_match(specs_for_platforms, Bundler.local_platform)
|
191
189
|
else
|
192
190
|
GemHelpers.select_best_platform_match(specs_for_platforms, dep.__platform)
|
193
191
|
end
|
@@ -33,7 +33,6 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
33
33
|
## Contributing
|
34
34
|
|
35
35
|
Bug reports and pull requests are welcome on GitHub at https://github.com/<%= config[:github_username] %>/<%= config[:name] %>.<% if config[:coc] %> This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/<%= config[:github_username] %>/<%= config[:name] %>/blob/master/CODE_OF_CONDUCT.md).<% end %>
|
36
|
-
|
37
36
|
<% if config[:mit] -%>
|
38
37
|
|
39
38
|
## License
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative "<%= File.basename(config[:namespaced_path]) %>/version"
|
4
4
|
<%- if config[:ext] -%>
|
5
|
-
|
5
|
+
require_relative "<%= File.basename(config[:namespaced_path]) %>/<%= config[:underscored_name] %>"
|
6
6
|
<%- end -%>
|
7
7
|
|
8
8
|
<%- config[:constant_array].each_with_index do |c, i| -%>
|
@@ -33,4 +33,10 @@ Gem::Specification.new do |spec|
|
|
33
33
|
<%- if config[:ext] -%>
|
34
34
|
spec.extensions = ["ext/<%= config[:underscored_name] %>/extconf.rb"]
|
35
35
|
<%- end -%>
|
36
|
+
|
37
|
+
# Uncomment to register a new dependency of your gem
|
38
|
+
# spec.add_dependency "example-gem", "~> 1.0"
|
39
|
+
|
40
|
+
# For more information and examples about making a new gem, checkout our
|
41
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
36
42
|
end
|
@@ -124,6 +124,7 @@ module Bundler::Molinillo
|
|
124
124
|
dot.join("\n")
|
125
125
|
end
|
126
126
|
|
127
|
+
# @param [DependencyGraph] other
|
127
128
|
# @return [Boolean] whether the two dependency graphs are equal, determined
|
128
129
|
# by a recursive traversal of each {#root_vertices} and its
|
129
130
|
# {Vertex#successors}
|
@@ -190,7 +191,7 @@ module Bundler::Molinillo
|
|
190
191
|
# @return [Edge] the added edge
|
191
192
|
def add_edge(origin, destination, requirement)
|
192
193
|
if destination.path_to?(origin)
|
193
|
-
raise CircularDependencyError.new(
|
194
|
+
raise CircularDependencyError.new(path(destination, origin))
|
194
195
|
end
|
195
196
|
add_edge_no_circular(origin, destination, requirement)
|
196
197
|
end
|
@@ -219,5 +220,37 @@ module Bundler::Molinillo
|
|
219
220
|
def add_edge_no_circular(origin, destination, requirement)
|
220
221
|
log.add_edge_no_circular(self, origin.name, destination.name, requirement)
|
221
222
|
end
|
223
|
+
|
224
|
+
# Returns the path between two vertices
|
225
|
+
# @raise [ArgumentError] if there is no path between the vertices
|
226
|
+
# @param [Vertex] from
|
227
|
+
# @param [Vertex] to
|
228
|
+
# @return [Array<Vertex>] the shortest path from `from` to `to`
|
229
|
+
def path(from, to)
|
230
|
+
distances = Hash.new(vertices.size + 1)
|
231
|
+
distances[from.name] = 0
|
232
|
+
predecessors = {}
|
233
|
+
each do |vertex|
|
234
|
+
vertex.successors.each do |successor|
|
235
|
+
if distances[successor.name] > distances[vertex.name] + 1
|
236
|
+
distances[successor.name] = distances[vertex.name] + 1
|
237
|
+
predecessors[successor] = vertex
|
238
|
+
end
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
242
|
+
path = [to]
|
243
|
+
while before = predecessors[to]
|
244
|
+
path << before
|
245
|
+
to = before
|
246
|
+
break if to == from
|
247
|
+
end
|
248
|
+
|
249
|
+
unless path.last.equal?(from)
|
250
|
+
raise ArgumentError, "There is no path from #{from.name} to #{to.name}"
|
251
|
+
end
|
252
|
+
|
253
|
+
path.reverse
|
254
|
+
end
|
222
255
|
end
|
223
256
|
end
|
@@ -65,7 +65,7 @@ module Bundler::Molinillo
|
|
65
65
|
# @param [SpecificationProvider] specification_provider see {#specification_provider}
|
66
66
|
def initialize(conflicts, specification_provider)
|
67
67
|
pairs = []
|
68
|
-
|
68
|
+
conflicts.values.flat_map(&:requirements).each do |conflicting|
|
69
69
|
conflicting.each do |source, conflict_requirements|
|
70
70
|
conflict_requirements.each do |c|
|
71
71
|
pairs << [c, source]
|
@@ -207,7 +207,7 @@ module Bundler::Molinillo
|
|
207
207
|
def start_resolution
|
208
208
|
@started_at = Time.now
|
209
209
|
|
210
|
-
|
210
|
+
push_initial_state
|
211
211
|
|
212
212
|
debug { "Starting resolution (#{@started_at})\nUser-requested dependencies: #{original_requested}" }
|
213
213
|
resolver_ui.before_resolution
|
@@ -273,10 +273,10 @@ module Bundler::Molinillo
|
|
273
273
|
states.last
|
274
274
|
end
|
275
275
|
|
276
|
-
# Creates the initial state for the resolution, based upon the
|
276
|
+
# Creates and pushes the initial state for the resolution, based upon the
|
277
277
|
# {#requested} dependencies
|
278
|
-
# @return [
|
279
|
-
def
|
278
|
+
# @return [void]
|
279
|
+
def push_initial_state
|
280
280
|
graph = DependencyGraph.new.tap do |dg|
|
281
281
|
original_requested.each do |requested|
|
282
282
|
vertex = dg.add_vertex(name_for(requested), nil, true)
|
@@ -285,18 +285,7 @@ module Bundler::Molinillo
|
|
285
285
|
dg.tag(:initial_state)
|
286
286
|
end
|
287
287
|
|
288
|
-
|
289
|
-
initial_requirement = requirements.shift
|
290
|
-
DependencyState.new(
|
291
|
-
initial_requirement && name_for(initial_requirement),
|
292
|
-
requirements,
|
293
|
-
graph,
|
294
|
-
initial_requirement,
|
295
|
-
possibilities_for_requirement(initial_requirement, graph),
|
296
|
-
0,
|
297
|
-
{},
|
298
|
-
[]
|
299
|
-
)
|
288
|
+
push_state_for_requirements(original_requested, true, graph)
|
300
289
|
end
|
301
290
|
|
302
291
|
# Unwinds the states stack because a conflict has been encountered
|
@@ -361,7 +350,7 @@ module Bundler::Molinillo
|
|
361
350
|
current_detail
|
362
351
|
end
|
363
352
|
|
364
|
-
# @param [Array<Object>] array of requirements that combine to create a conflict
|
353
|
+
# @param [Array<Object>] binding_requirements array of requirements that combine to create a conflict
|
365
354
|
# @return [Array<UnwindDetails>] array of UnwindDetails that have a chance
|
366
355
|
# of resolving the passed requirements
|
367
356
|
def unwind_options_for_requirements(binding_requirements)
|
@@ -429,7 +418,7 @@ module Bundler::Molinillo
|
|
429
418
|
end
|
430
419
|
|
431
420
|
# @param [DependencyState] state
|
432
|
-
# @param [Array] array of requirements
|
421
|
+
# @param [Array] binding_requirements array of requirements
|
433
422
|
# @return [Boolean] whether or not the given state has any possibilities
|
434
423
|
# that could satisfy the given requirements
|
435
424
|
def conflict_fixing_possibilities?(state, binding_requirements)
|
@@ -444,7 +433,8 @@ module Bundler::Molinillo
|
|
444
433
|
|
445
434
|
# Filter's a state's possibilities to remove any that would not fix the
|
446
435
|
# conflict we've just rewound from
|
447
|
-
# @param [UnwindDetails] details of the conflict just
|
436
|
+
# @param [UnwindDetails] unwind_details details of the conflict just
|
437
|
+
# unwound from
|
448
438
|
# @return [void]
|
449
439
|
def filter_possibilities_after_unwind(unwind_details)
|
450
440
|
return unless state && !state.possibilities.empty?
|
@@ -458,7 +448,7 @@ module Bundler::Molinillo
|
|
458
448
|
|
459
449
|
# Filter's a state's possibilities to remove any that would not satisfy
|
460
450
|
# the requirements in the conflict we've just rewound from
|
461
|
-
# @param [UnwindDetails] details of the conflict just unwound from
|
451
|
+
# @param [UnwindDetails] unwind_details details of the conflict just unwound from
|
462
452
|
# @return [void]
|
463
453
|
def filter_possibilities_for_primary_unwind(unwind_details)
|
464
454
|
unwinds_to_state = unused_unwind_options.select { |uw| uw.state_index == unwind_details.state_index }
|
@@ -491,7 +481,7 @@ module Bundler::Molinillo
|
|
491
481
|
|
492
482
|
# Filter's a state's possibilities to remove any that would (eventually)
|
493
483
|
# create a requirement in the conflict we've just rewound from
|
494
|
-
# @param [UnwindDetails] details of the conflict just unwound from
|
484
|
+
# @param [UnwindDetails] unwind_details details of the conflict just unwound from
|
495
485
|
# @return [void]
|
496
486
|
def filter_possibilities_for_parent_unwind(unwind_details)
|
497
487
|
unwinds_to_state = unused_unwind_options.select { |uw| uw.state_index == unwind_details.state_index }
|
@@ -500,7 +490,7 @@ module Bundler::Molinillo
|
|
500
490
|
primary_unwinds = unwinds_to_state.select(&:unwinding_to_primary_requirement?).uniq
|
501
491
|
parent_unwinds = unwinds_to_state.uniq - primary_unwinds
|
502
492
|
|
503
|
-
allowed_possibility_sets =
|
493
|
+
allowed_possibility_sets = primary_unwinds.flat_map do |unwind|
|
504
494
|
states[unwind.state_index].possibilities.select do |possibility_set|
|
505
495
|
possibility_set.possibilities.any? do |poss|
|
506
496
|
possibility_satisfies_requirements?(poss, unwind.conflicting_requirements)
|
@@ -508,7 +498,7 @@ module Bundler::Molinillo
|
|
508
498
|
end
|
509
499
|
end
|
510
500
|
|
511
|
-
requirements_to_avoid =
|
501
|
+
requirements_to_avoid = parent_unwinds.flat_map(&:sub_dependencies_to_avoid)
|
512
502
|
|
513
503
|
state.possibilities.reject! do |possibility_set|
|
514
504
|
!allowed_possibility_sets.include?(possibility_set) &&
|
@@ -524,12 +514,12 @@ module Bundler::Molinillo
|
|
524
514
|
|
525
515
|
possible_binding_requirements = conflict.requirements.values.flatten(1).uniq
|
526
516
|
|
527
|
-
# When there
|
528
|
-
# (the one causing the circular) won
|
529
|
-
# (which won
|
530
|
-
# because it
|
531
|
-
# We need to make sure we have that requirement in the conflict
|
532
|
-
# otherwise we won
|
517
|
+
# When there's a `CircularDependency` error the conflicting requirement
|
518
|
+
# (the one causing the circular) won't be `conflict.requirement`
|
519
|
+
# (which won't be for the right state, because we won't have created it,
|
520
|
+
# because it's circular).
|
521
|
+
# We need to make sure we have that requirement in the conflict's list,
|
522
|
+
# otherwise we won't be able to unwind properly, so we just return all
|
533
523
|
# the requirements for the conflict.
|
534
524
|
return possible_binding_requirements if conflict.underlying_error
|
535
525
|
|
@@ -558,8 +548,8 @@ module Bundler::Molinillo
|
|
558
548
|
end
|
559
549
|
|
560
550
|
# @param [Object] requirement we wish to check
|
561
|
-
# @param [Array] array of requirements
|
562
|
-
# @param [Array] array of possibilities the requirements will be used to filter
|
551
|
+
# @param [Array] possible_binding_requirements array of requirements
|
552
|
+
# @param [Array] possibilities array of possibilities the requirements will be used to filter
|
563
553
|
# @return [Boolean] whether or not the given requirement is required to filter
|
564
554
|
# out all elements of the array of possibilities.
|
565
555
|
def binding_requirement_in_set?(requirement, possible_binding_requirements, possibilities)
|
@@ -568,6 +558,7 @@ module Bundler::Molinillo
|
|
568
558
|
end
|
569
559
|
end
|
570
560
|
|
561
|
+
# @param [Object] requirement
|
571
562
|
# @return [Object] the requirement that led to `requirement` being added
|
572
563
|
# to the list of requirements.
|
573
564
|
def parent_of(requirement)
|
@@ -577,6 +568,7 @@ module Bundler::Molinillo
|
|
577
568
|
parent_state.requirement
|
578
569
|
end
|
579
570
|
|
571
|
+
# @param [String] name
|
580
572
|
# @return [Object] the requirement that led to a version of a possibility
|
581
573
|
# with the given name being activated.
|
582
574
|
def requirement_for_existing_name(name)
|
@@ -585,6 +577,7 @@ module Bundler::Molinillo
|
|
585
577
|
states.find { |s| s.name == name }.requirement
|
586
578
|
end
|
587
579
|
|
580
|
+
# @param [Object] requirement
|
588
581
|
# @return [ResolutionState] the state whose `requirement` is the given
|
589
582
|
# `requirement`.
|
590
583
|
def find_state_for(requirement)
|
@@ -592,6 +585,7 @@ module Bundler::Molinillo
|
|
592
585
|
states.find { |i| requirement == i.requirement }
|
593
586
|
end
|
594
587
|
|
588
|
+
# @param [Object] underlying_error
|
595
589
|
# @return [Conflict] a {Conflict} that reflects the failure to activate
|
596
590
|
# the {#possibility} in conjunction with the current {#state}
|
597
591
|
def create_conflict(underlying_error = nil)
|
@@ -628,6 +622,7 @@ module Bundler::Molinillo
|
|
628
622
|
vertex.requirements.map { |r| requirement_tree_for(r) }
|
629
623
|
end
|
630
624
|
|
625
|
+
# @param [Object] requirement
|
631
626
|
# @return [Array<Object>] the list of requirements that led to
|
632
627
|
# `requirement` being required.
|
633
628
|
def requirement_tree_for(requirement)
|
@@ -673,9 +668,8 @@ module Bundler::Molinillo
|
|
673
668
|
attempt_to_filter_existing_spec(existing_vertex)
|
674
669
|
else
|
675
670
|
latest = possibility.latest_version
|
676
|
-
|
677
|
-
|
678
|
-
!requirement_satisfied_by?(requirement, activated, possibility)
|
671
|
+
possibility.possibilities.select! do |possibility|
|
672
|
+
requirement_satisfied_by?(requirement, activated, possibility)
|
679
673
|
end
|
680
674
|
if possibility.latest_version.nil?
|
681
675
|
# ensure there's a possibility for better error messages
|
@@ -705,7 +699,7 @@ module Bundler::Molinillo
|
|
705
699
|
|
706
700
|
# Generates a filtered version of the existing vertex's `PossibilitySet` using the
|
707
701
|
# current state's `requirement`
|
708
|
-
# @param [Object] existing vertex
|
702
|
+
# @param [Object] vertex existing vertex
|
709
703
|
# @return [PossibilitySet] filtered possibility set
|
710
704
|
def filtered_possibility_set(vertex)
|
711
705
|
PossibilitySet.new(vertex.payload.dependencies, vertex.payload.possibilities & possibility.possibilities)
|
@@ -730,7 +724,7 @@ module Bundler::Molinillo
|
|
730
724
|
end
|
731
725
|
|
732
726
|
# Requires the dependencies that the recently activated spec has
|
733
|
-
# @param [Object]
|
727
|
+
# @param [Object] possibility_set the PossibilitySet that has just been
|
734
728
|
# activated
|
735
729
|
# @return [void]
|
736
730
|
def require_nested_dependencies_for(possibility_set)
|
@@ -749,6 +743,8 @@ module Bundler::Molinillo
|
|
749
743
|
# Pushes a new {DependencyState} that encapsulates both existing and new
|
750
744
|
# requirements
|
751
745
|
# @param [Array] new_requirements
|
746
|
+
# @param [Boolean] requires_sort
|
747
|
+
# @param [Object] new_activated
|
752
748
|
# @return [void]
|
753
749
|
def push_state_for_requirements(new_requirements, requires_sort = true, new_activated = activated)
|
754
750
|
new_requirements = sort_dependencies(new_requirements.uniq, new_activated, conflicts) if requires_sort
|
@@ -767,7 +763,8 @@ module Bundler::Molinillo
|
|
767
763
|
|
768
764
|
# Checks a proposed requirement with any existing locked requirement
|
769
765
|
# before generating an array of possibilities for it.
|
770
|
-
# @param [Object] the proposed requirement
|
766
|
+
# @param [Object] requirement the proposed requirement
|
767
|
+
# @param [Object] activated
|
771
768
|
# @return [Array] possibilities
|
772
769
|
def possibilities_for_requirement(requirement, activated = self.activated)
|
773
770
|
return [] unless requirement
|
@@ -778,7 +775,8 @@ module Bundler::Molinillo
|
|
778
775
|
group_possibilities(search_for(requirement))
|
779
776
|
end
|
780
777
|
|
781
|
-
# @param [Object] the proposed requirement
|
778
|
+
# @param [Object] requirement the proposed requirement
|
779
|
+
# @param [Object] activated
|
782
780
|
# @return [Array] possibility set containing only the locked requirement, if any
|
783
781
|
def locked_requirement_possibility_set(requirement, activated = self.activated)
|
784
782
|
all_possibilities = search_for(requirement)
|
@@ -797,8 +795,8 @@ module Bundler::Molinillo
|
|
797
795
|
# Build an array of PossibilitySets, with each element representing a group of
|
798
796
|
# dependency versions that all have the same sub-dependency version constraints
|
799
797
|
# and are contiguous.
|
800
|
-
# @param [Array] an array of possibilities
|
801
|
-
# @return [Array] an array of possibility sets
|
798
|
+
# @param [Array] possibilities an array of possibilities
|
799
|
+
# @return [Array<PossibilitySet>] an array of possibility sets
|
802
800
|
def group_possibilities(possibilities)
|
803
801
|
possibility_sets = []
|
804
802
|
current_possibility_set = nil
|
@@ -3,6 +3,8 @@ require_relative '../../../../uri/lib/uri'
|
|
3
3
|
require 'cgi' # for escaping
|
4
4
|
require_relative '../../../../connection_pool/lib/connection_pool'
|
5
5
|
|
6
|
+
autoload :OpenSSL, 'openssl'
|
7
|
+
|
6
8
|
##
|
7
9
|
# Persistent connections for Net::HTTP
|
8
10
|
#
|
@@ -147,14 +149,9 @@ class Bundler::Persistent::Net::HTTP::Persistent
|
|
147
149
|
EPOCH = Time.at 0 # :nodoc:
|
148
150
|
|
149
151
|
##
|
150
|
-
# Is OpenSSL available?
|
152
|
+
# Is OpenSSL available? This test works with autoload
|
151
153
|
|
152
|
-
HAVE_OPENSSL =
|
153
|
-
require 'openssl'
|
154
|
-
true
|
155
|
-
rescue LoadError
|
156
|
-
false
|
157
|
-
end
|
154
|
+
HAVE_OPENSSL = defined? OpenSSL::SSL # :nodoc:
|
158
155
|
|
159
156
|
##
|
160
157
|
# The default connection pool size is 1/4 the allowed open files
|
@@ -162,7 +159,14 @@ class Bundler::Persistent::Net::HTTP::Persistent
|
|
162
159
|
# limits (typically windows).
|
163
160
|
|
164
161
|
if Process.const_defined? :RLIMIT_NOFILE
|
165
|
-
|
162
|
+
open_file_limits = Process.getrlimit(Process::RLIMIT_NOFILE)
|
163
|
+
|
164
|
+
# Under JRuby on Windows Process responds to `getrlimit` but returns something that does not match docs
|
165
|
+
if open_file_limits.respond_to?(:first)
|
166
|
+
DEFAULT_POOL_SIZE = open_file_limits.first / 4
|
167
|
+
else
|
168
|
+
DEFAULT_POOL_SIZE = 256
|
169
|
+
end
|
166
170
|
else
|
167
171
|
DEFAULT_POOL_SIZE = 256
|
168
172
|
end
|