bundler 2.2.5 → 2.2.6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bundler might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9014f3bd2d636c4436c097ca7320f15602fe63d151839c3e0304dcd90f28d62f
4
- data.tar.gz: 7eb224ffa516b5f29d11a35de89b64943fb9dea34c60ccdf51fa031ca81d7dbc
3
+ metadata.gz: d650c1a28dea3c6991577a9083a22c1ca1efda7a2eec47d0df598f85830bdadd
4
+ data.tar.gz: 39210bbab39a367d483951a86ae63074b13551c477545bb77c61f6a567a99953
5
5
  SHA512:
6
- metadata.gz: 62c02abf9d6d7b4f5e8e28bbeebc364c1154b48ebcfefa7f7f13a2d16b09fa8c14c8f293fb80887666a9e2533d2effc29d6516c10d7433a92a7a953ec3f5a94b
7
- data.tar.gz: 7db47841661df295e9db0c8861a0fe07129d0e7b5750efd4f987bbe1e223dae8f83733765df2d8f076a18166a624aae1c0361d268a00f9474e81c92c9533e4ac
6
+ metadata.gz: 68a691b5c9a1d46782fef62ebccd13a591db6cf8581ccf1dd652cda62a13f5a537ba4bea07623f475067281d1a7f8f0121888c7693b361dfc7c7b03f9c4c124e
7
+ data.tar.gz: 7cf159707678831e78eaa3ccda37e2433762d39e154b3b42dd3e23531d8caf234eb48b633595aa2b43fe213899fd30691735b1cbd3942afe88bb4ab2d9d39991
@@ -1,3 +1,17 @@
1
+ # 2.2.6 (January 18, 2021)
2
+
3
+ ## Enhancements:
4
+
5
+ - Improve resolver debugging [#4288](https://github.com/rubygems/rubygems/pull/4288)
6
+
7
+ ## Bug fixes:
8
+
9
+ - Fix dependency locking for path source [#4293](https://github.com/rubygems/rubygems/pull/4293)
10
+
11
+ ## Performance:
12
+
13
+ - Speed up complex dependency resolves by creating DepProxy factory and cache [#4216](https://github.com/rubygems/rubygems/pull/4216)
14
+
1
15
  # 2.2.5 (January 11, 2021)
2
16
 
3
17
  ## Enhancements:
@@ -4,8 +4,8 @@ module Bundler
4
4
  # Represents metadata from when the Bundler gem was built.
5
5
  module BuildMetadata
6
6
  # begin ivars
7
- @built_at = "2021-01-11".freeze
8
- @git_commit_sha = "ba867aed7f".freeze
7
+ @built_at = "2021-01-19".freeze
8
+ @git_commit_sha = "e95bea3837".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -818,11 +818,6 @@ module Bundler
818
818
  # commonly happens if the version changed in the gemspec
819
819
  next unless new_spec
820
820
 
821
- new_runtime_deps = new_spec.dependencies.select {|d| d.type != :development }
822
- old_runtime_deps = s.dependencies.select {|d| d.type != :development }
823
- # If the dependencies of the path source have changed and locked spec can't satisfy new dependencies, unlock it
824
- next unless new_runtime_deps.sort == old_runtime_deps.sort || new_runtime_deps.all? {|d| satisfies_locked_spec?(d) }
825
-
826
821
  s.dependencies.replace(new_spec.dependencies)
827
822
  end
828
823
 
@@ -897,7 +892,7 @@ module Bundler
897
892
 
898
893
  def expand_dependency_with_platforms(dep, platforms)
899
894
  platforms.map do |p|
900
- DepProxy.new(dep, p)
895
+ DepProxy.get_proxy(dep, p)
901
896
  end
902
897
  end
903
898
 
@@ -977,7 +972,7 @@ module Bundler
977
972
  next requirements if @locked_gems.dependencies[name] != dependency
978
973
  next requirements if dependency.source.is_a?(Source::Path)
979
974
  dep = Gem::Dependency.new(name, ">= #{locked_spec.version}")
980
- requirements[name] = DepProxy.new(dep, locked_spec.platform)
975
+ requirements[name] = DepProxy.get_proxy(dep, locked_spec.platform)
981
976
  requirements
982
977
  end.values
983
978
  end
@@ -4,19 +4,18 @@ module Bundler
4
4
  class DepProxy
5
5
  attr_reader :__platform, :dep
6
6
 
7
+ @proxies = {}
8
+
9
+ def self.get_proxy(dep, platform)
10
+ @proxies[[dep, platform]] ||= new(dep, platform).freeze
11
+ end
12
+
7
13
  def initialize(dep, platform)
8
14
  @dep = dep
9
15
  @__platform = platform
10
16
  end
11
17
 
12
- def hash
13
- @hash ||= [dep, __platform].hash
14
- end
15
-
16
- def ==(other)
17
- return false if other.class != self.class
18
- dep == other.dep && __platform == other.__platform
19
- end
18
+ private_class_method :new
20
19
 
21
20
  alias_method :eql?, :==
22
21
 
@@ -39,6 +38,14 @@ module Bundler
39
38
  s
40
39
  end
41
40
 
41
+ def dup
42
+ raise NoMethodError.new("DepProxy cannot be duplicated")
43
+ end
44
+
45
+ def clone
46
+ raise NoMethodError.new("DepProxy cannot be cloned")
47
+ end
48
+
42
49
  private
43
50
 
44
51
  def method_missing(*args, &blk)
@@ -81,8 +81,8 @@ module Bundler
81
81
  sort_dep_specs(spec_groups, locked_spec)
82
82
  end.tap do |specs|
83
83
  if DEBUG
84
- warn before_result
85
- warn " after sort_versions: #{debug_format_result(dep, specs).inspect}"
84
+ puts before_result
85
+ puts " after sort_versions: #{debug_format_result(dep, specs).inspect}"
86
86
  end
87
87
  end
88
88
  end
@@ -32,7 +32,7 @@ module Bundler
32
32
  @base_dg = Molinillo::DependencyGraph.new
33
33
  @base.each do |ls|
34
34
  dep = Dependency.new(ls.name, ls.version)
35
- @base_dg.add_vertex(ls.name, DepProxy.new(dep, ls.platform), true)
35
+ @base_dg.add_vertex(ls.name, DepProxy.get_proxy(dep, ls.platform), true)
36
36
  end
37
37
  additional_base_requirements.each {|d| @base_dg.add_vertex(d.name, d) }
38
38
  @platforms = platforms
@@ -75,7 +75,7 @@ module Bundler
75
75
  return unless debug?
76
76
  debug_info = yield
77
77
  debug_info = debug_info.inspect unless debug_info.is_a?(String)
78
- puts debug_info.split("\n").map {|s| "BUNDLER: " + " " * depth + s }
78
+ puts debug_info.split("\n").map {|s| depth == 0 ? "BUNDLER: #{s}" : "BUNDLER(#{depth}): #{s}" }
79
79
  end
80
80
 
81
81
  def debug?
@@ -99,7 +99,7 @@ module Bundler
99
99
  spec.dependencies.each do |dep|
100
100
  next if dep.type == :development
101
101
  next if @ignores_bundler_dependencies && dep.name == "bundler".freeze
102
- dependencies[platform] << DepProxy.new(dep, platform)
102
+ dependencies[platform] << DepProxy.get_proxy(dep, platform)
103
103
  end
104
104
  end
105
105
  dependencies[platform]
@@ -110,10 +110,10 @@ module Bundler
110
110
  return [] unless spec && spec.is_a?(Gem::Specification)
111
111
  dependencies = []
112
112
  if !spec.required_ruby_version.nil? && !spec.required_ruby_version.none?
113
- dependencies << DepProxy.new(Gem::Dependency.new("Ruby\0", spec.required_ruby_version), platform)
113
+ dependencies << DepProxy.get_proxy(Gem::Dependency.new("Ruby\0", spec.required_ruby_version), platform)
114
114
  end
115
115
  if !spec.required_rubygems_version.nil? && !spec.required_rubygems_version.none?
116
- dependencies << DepProxy.new(Gem::Dependency.new("RubyGems\0", spec.required_rubygems_version), platform)
116
+ dependencies << DepProxy.get_proxy(Gem::Dependency.new("RubyGems\0", spec.required_rubygems_version), platform)
117
117
  end
118
118
  dependencies
119
119
  end
@@ -158,6 +158,22 @@ module Gem
158
158
  end
159
159
  end
160
160
 
161
+ if Gem::Requirement.new("~> 2.0").hash == Gem::Requirement.new("~> 2.0.0").hash
162
+ class Requirement
163
+ module CorrectHashForLambdaOperator
164
+ def hash
165
+ if requirements.any? {|r| r.first == "~>" }
166
+ requirements.map {|r| r.first == "~>" ? [r[0], r[1].to_s] : r }.sort.hash
167
+ else
168
+ super
169
+ end
170
+ end
171
+ end
172
+
173
+ prepend CorrectHashForLambdaOperator
174
+ end
175
+ end
176
+
161
177
  class Platform
162
178
  JAVA = Gem::Platform.new("java") unless defined?(JAVA)
163
179
  MSWIN = Gem::Platform.new("mswin32") unless defined?(MSWIN)
@@ -28,7 +28,7 @@ module Bundler
28
28
 
29
29
  specs_for_dep.first.dependencies.each do |d|
30
30
  next if d.type == :development
31
- d = DepProxy.new(d, dep.__platform) unless match_current_platform
31
+ d = DepProxy.get_proxy(d, dep.__platform) unless match_current_platform
32
32
  deps << d
33
33
  end
34
34
  elsif check
@@ -329,11 +329,11 @@ module Bundler::Molinillo
329
329
 
330
330
  # Look for past conflicts that could be unwound to affect the
331
331
  # requirement tree for the current conflict
332
+ all_reqs = last_detail_for_current_unwind.all_requirements
333
+ all_reqs_size = all_reqs.size
332
334
  relevant_unused_unwinds = unused_unwind_options.select do |alternative|
333
- intersecting_requirements =
334
- last_detail_for_current_unwind.all_requirements &
335
- alternative.requirements_unwound_to_instead
336
- next if intersecting_requirements.empty?
335
+ diff_reqs = all_reqs - alternative.requirements_unwound_to_instead
336
+ next if diff_reqs.size == all_reqs_size
337
337
  # Find the highest index unwind whilst looping through
338
338
  current_detail = alternative if alternative > current_detail
339
339
  alternative
@@ -344,8 +344,12 @@ module Bundler::Molinillo
344
344
  state.unused_unwind_options += unwind_details.reject { |detail| detail.state_index == -1 }
345
345
 
346
346
  # Update the requirements_unwound_to_instead on any relevant unused unwinds
347
- relevant_unused_unwinds.each { |d| d.requirements_unwound_to_instead << current_detail.state_requirement }
348
- unwind_details.each { |d| d.requirements_unwound_to_instead << current_detail.state_requirement }
347
+ relevant_unused_unwinds.each do |d|
348
+ (d.requirements_unwound_to_instead << current_detail.state_requirement).uniq!
349
+ end
350
+ unwind_details.each do |d|
351
+ (d.requirements_unwound_to_instead << current_detail.state_requirement).uniq!
352
+ end
349
353
 
350
354
  current_detail
351
355
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.2.5".freeze
4
+ VERSION = "2.2.6".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.5
4
+ version: 2.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Arko
@@ -22,7 +22,7 @@ authors:
22
22
  autorequire:
23
23
  bindir: exe
24
24
  cert_chain: []
25
- date: 2021-01-11 00:00:00.000000000 Z
25
+ date: 2021-01-19 00:00:00.000000000 Z
26
26
  dependencies: []
27
27
  description: Bundler manages an application's dependencies through its entire life,
28
28
  across many machines, systematically and repeatably