bundler 2.5.3 → 2.5.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b424116a8722a58d7872569da843f8d82e59165e44d7016c9e3160b4e5c7e17
4
- data.tar.gz: e3d151c03cb0b9e31087992dec6cec17d67b4b309019c49d9b44c729fd3bfcf9
3
+ metadata.gz: d1486cdeb45a181fff50c3940e818b84c05507d4e29bfe7b0843b6dc15be6213
4
+ data.tar.gz: 111e63453cbc876227f8e702d6c3921bff91707c8705a56c89b78fed7963f618
5
5
  SHA512:
6
- metadata.gz: 021372d2550752a3c9d097d623ac19d4e825099af77c0eeadd040958ce3ad4746d7766e8cea0e211562df1162b7dc29718a2bc2fa8d19d5b7de3d8e6421bb55e
7
- data.tar.gz: 8f910b4a4404f5bd8e8e222e446277d7943afff9aa756ba5921476e9b3a3f2321ae9998c68c5ad73cf2b96473f12e4e69625f5aa47b0f3fa14f5c4bffad2c58a
6
+ metadata.gz: e5e225950c1192971b49fedab22bd2d1703609df034f0fe3a6f71685f864947ea4583c5e6301ebffd0accc8567232d90da9926b532f1729e20db08c94394406c
7
+ data.tar.gz: dab198d801aef8569466dffbfbafe9bdc0fd781ae6ba610a2be13915b85ea2a40984e90d30bc5635a3a3a786a3d78c50672088e8fd8d5094b2058bf975f292c1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 2.5.4 (January 3, 2024)
2
+
3
+ ## Bug fixes:
4
+
5
+ - Fix resolution when different platform specific gems have different dependencies [#7324](https://github.com/rubygems/rubygems/pull/7324)
6
+
1
7
  # 2.5.3 (December 22, 2023)
2
8
 
3
9
  ## Bug fixes:
@@ -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 = "2023-12-22".freeze
8
- @git_commit_sha = "a04f70b115".freeze
7
+ @built_at = "2024-01-04".freeze
8
+ @git_commit_sha = "7ffda9ba9b".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -312,10 +312,6 @@ module Bundler
312
312
  end
313
313
  end
314
314
 
315
- def should_complete_platforms?
316
- !lockfile_exists? && generic_local_platform_is_ruby? && !Bundler.settings[:force_ruby_platform]
317
- end
318
-
319
315
  def spec_git_paths
320
316
  sources.git_sources.map {|s| File.realpath(s.path) if File.exist?(s.path) }.compact
321
317
  end
@@ -517,6 +513,10 @@ module Bundler
517
513
 
518
514
  private
519
515
 
516
+ def should_add_extra_platforms?
517
+ !lockfile_exists? && generic_local_platform_is_ruby? && !Bundler.settings[:force_ruby_platform]
518
+ end
519
+
520
520
  def lockfile_exists?
521
521
  lockfile && File.exist?(lockfile)
522
522
  end
@@ -600,7 +600,9 @@ module Bundler
600
600
  result = SpecSet.new(resolver.start)
601
601
 
602
602
  @resolved_bundler_version = result.find {|spec| spec.name == "bundler" }&.version
603
- @platforms = result.complete_platforms!(platforms) if should_complete_platforms?
603
+ @platforms = result.add_extra_platforms!(platforms) if should_add_extra_platforms?
604
+
605
+ result.complete_platforms!(platforms)
604
606
 
605
607
  SpecSet.new(result.for(dependencies, false, @platforms))
606
608
  end
@@ -52,32 +52,14 @@ module Bundler
52
52
  specs.uniq
53
53
  end
54
54
 
55
- def complete_platforms!(platforms)
55
+ def add_extra_platforms!(platforms)
56
56
  return platforms.concat([Gem::Platform::RUBY]).uniq if @specs.empty?
57
57
 
58
- new_platforms = @specs.flat_map {|spec| spec.source.specs.search([spec.name, spec.version]).map(&:platform) }.uniq.select do |platform|
58
+ new_platforms = all_platforms.select do |platform|
59
59
  next if platforms.include?(platform)
60
60
  next unless GemHelpers.generic(platform) == Gem::Platform::RUBY
61
61
 
62
- new_specs = []
63
-
64
- valid_platform = lookup.all? do |_, specs|
65
- spec = specs.first
66
- matching_specs = spec.source.specs.search([spec.name, spec.version])
67
- platform_spec = GemHelpers.select_best_platform_match(matching_specs, platform).find do |s|
68
- s.matches_current_metadata? && valid_dependencies?(s)
69
- end
70
-
71
- if platform_spec
72
- new_specs << LazySpecification.from_spec(platform_spec)
73
- true
74
- else
75
- false
76
- end
77
- end
78
- next unless valid_platform
79
-
80
- @specs.concat(new_specs.uniq)
62
+ complete_platform(platform)
81
63
  end
82
64
  return platforms if new_platforms.empty?
83
65
 
@@ -86,12 +68,15 @@ module Bundler
86
68
  less_specific_platform = new_platforms.find {|platform| platform != Gem::Platform::RUBY && platform === Bundler.local_platform }
87
69
  platforms.delete(Bundler.local_platform) if less_specific_platform
88
70
 
89
- @sorted = nil
90
- @lookup = nil
91
-
92
71
  platforms
93
72
  end
94
73
 
74
+ def complete_platforms!(platforms)
75
+ platforms.each do |platform|
76
+ complete_platform(platform)
77
+ end
78
+ end
79
+
95
80
  def validate_deps(s)
96
81
  s.runtime_dependencies.each do |dep|
97
82
  next if dep.name == "bundler"
@@ -110,14 +95,14 @@ module Bundler
110
95
 
111
96
  def []=(key, value)
112
97
  @specs << value
113
- @lookup = nil
114
- @sorted = nil
98
+
99
+ reset!
115
100
  end
116
101
 
117
102
  def delete(specs)
118
103
  specs.each {|spec| @specs.delete(spec) }
119
- @lookup = nil
120
- @sorted = nil
104
+
105
+ reset!
121
106
  end
122
107
 
123
108
  def sort!
@@ -175,8 +160,8 @@ module Bundler
175
160
 
176
161
  def delete_by_name(name)
177
162
  @specs.reject! {|spec| spec.name == name }
178
- @lookup = nil
179
- @sorted = nil
163
+
164
+ reset!
180
165
  end
181
166
 
182
167
  def what_required(spec)
@@ -212,6 +197,42 @@ module Bundler
212
197
 
213
198
  private
214
199
 
200
+ def reset!
201
+ @sorted = nil
202
+ @lookup = nil
203
+ end
204
+
205
+ def complete_platform(platform)
206
+ new_specs = []
207
+
208
+ valid_platform = lookup.all? do |_, specs|
209
+ spec = specs.first
210
+ matching_specs = spec.source.specs.search([spec.name, spec.version])
211
+ platform_spec = GemHelpers.select_best_platform_match(matching_specs, platform).find do |s|
212
+ s.matches_current_metadata? && valid_dependencies?(s)
213
+ end
214
+
215
+ if platform_spec
216
+ new_specs << LazySpecification.from_spec(platform_spec) unless specs.include?(platform_spec)
217
+ true
218
+ else
219
+ false
220
+ end
221
+ end
222
+
223
+ if valid_platform && new_specs.any?
224
+ @specs.concat(new_specs)
225
+
226
+ reset!
227
+ end
228
+
229
+ valid_platform
230
+ end
231
+
232
+ def all_platforms
233
+ @specs.flat_map {|spec| spec.source.specs.search([spec.name, spec.version]).map(&:platform) }.uniq
234
+ end
235
+
215
236
  def valid_dependencies?(s)
216
237
  validate_deps(s) == :valid
217
238
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.5.3".freeze
4
+ VERSION = "2.5.4".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.5.3
4
+ version: 2.5.4
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: 2023-12-22 00:00:00.000000000 Z
25
+ date: 2024-01-04 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
@@ -398,7 +398,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
398
398
  - !ruby/object:Gem::Version
399
399
  version: 3.2.3
400
400
  requirements: []
401
- rubygems_version: 3.5.3
401
+ rubygems_version: 3.5.4
402
402
  signing_key:
403
403
  specification_version: 4
404
404
  summary: The best way to manage your application's dependencies