bundler 2.2.0 → 2.2.1

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: 0af01fdf441e83df2f02f7e0028ca485d12bb37986101861fa498f0768763708
4
- data.tar.gz: 319299292a4a3b6e295e8d28bd6c9c7f2f478d686ff6ea733f31271c4f574512
3
+ metadata.gz: 828d688b53800760eabd11c4c520dbff151ef88b6029ee4368ed7b47bb9c9bc5
4
+ data.tar.gz: 76b9369b4bd4d2ad94a993f38032154072382cf6a60b30d37b64e170af46de7e
5
5
  SHA512:
6
- metadata.gz: cc0d1557b038284fb34953722569b55cfd4541f172a099583d12b53eed299768664df54e032bc9ad7f1c7b379e069ccd2a9e1ad85a7c6bc9afa5087c03da986c
7
- data.tar.gz: de013b518986f6a7fcb8a5e36541e33dfd574aabd662a71f506bf4099c9fc690aeeed6a07b36aee698cac464cf5070b603da1aca3fbe96d796ec59e907d4e5ae
6
+ metadata.gz: 4eef0f08b20de1250d50239fbf189b222452199ee28a9056ecc31a320c983b532213c1e3f6d5df54b719fcb88ac6f97d6dec161a64f36c78223edb38708d8bad
7
+ data.tar.gz: b771b91e794af665a128a62cc7f30130ff4dd3a3ad38bb49ef51d4dddaf1d6d875561e84a229ccea03ef8a2cab5c268bb4d7bbbd93ef8a855c74fb7c181bd4bf
@@ -1,3 +1,14 @@
1
+ # 2.2.1 (December 14, 2020)
2
+
3
+ ## Bug fixes:
4
+
5
+ - Ad-hoc fix for platform regression [#4127](https://github.com/rubygems/rubygems/pull/4127)
6
+ - Workaround JRuby + Windows issue with net-http-persistent vendored code [#4138](https://github.com/rubygems/rubygems/pull/4138)
7
+ - Reset also root when in a nested invocation [#4140](https://github.com/rubygems/rubygems/pull/4140)
8
+ - Restore 2.1.4 resolution times [#4134](https://github.com/rubygems/rubygems/pull/4134)
9
+ - Fix `bundle outdated --strict` crash [#4133](https://github.com/rubygems/rubygems/pull/4133)
10
+ - Autoload `Bundler::RemoteSpecification` to workaround crash on jruby [#4114](https://github.com/rubygems/rubygems/pull/4114)
11
+
1
12
  # 2.2.0 (December 7, 2020)
2
13
 
3
14
  ## Enhancements:
@@ -34,7 +45,11 @@
34
45
 
35
46
  # 2.2.0.rc.2 (October 6, 2020)
36
47
 
37
- ## Minor enhancements:
48
+ ## Features:
49
+
50
+ - Add `bundle fund` command [#3390](https://github.com/rubygems/rubygems/pull/3390)
51
+
52
+ ## Enhancements:
38
53
 
39
54
  - Fix ls-files matching regexp [#3845](https://github.com/rubygems/rubygems/pull/3845)
40
55
  - Remove redundant `bundler/setup` require from `spec_helper.rb` generated by `bundle gem` [#3791](https://github.com/rubygems/rubygems/pull/3791)
@@ -67,10 +82,6 @@
67
82
 
68
83
  - Deprecate `bundle cache --all` flag [#3932](https://github.com/rubygems/rubygems/pull/3932)
69
84
 
70
- ## Features:
71
-
72
- - Add `bundle fund` command [#3390](https://github.com/rubygems/rubygems/pull/3390)
73
-
74
85
  ## Documentation:
75
86
 
76
87
  - Correct grammar in Gemfile docs [#3990](https://github.com/rubygems/rubygems/pull/3990)
@@ -81,12 +92,12 @@
81
92
 
82
93
  # 2.2.0.rc.1 (July 2, 2020)
83
94
 
84
- ## Major enhancements:
95
+ ## Features:
85
96
 
86
97
  - Windows support. There's still gotchas and unimplemented features, but a Windows CI is now enforced.
87
98
  - Full multiplatform support. Bundler should now seamlessly handle multiplatform `Gemfile` or `gems.rb` files.
88
99
 
89
- ## Features:
100
+ ## Enhancements:
90
101
 
91
102
  - `bundle info` now includes gem metadata [#7376](https://github.com/rubygems/bundler/pull/7376)
92
103
  - `bundle list --without-group` and `bundle list --only-group` now support space separated list of groups in addition to single groups [#7404](https://github.com/rubygems/bundler/pull/7404)
@@ -97,9 +108,6 @@
97
108
  - Add `bundle plugin uninstall` [#3482](https://github.com/rubygems/rubygems/pull/3482)
98
109
  - `bundle gem` now supports a `--ci` flag and a `gem.ci` configuration that adds CI config files for the main CI providers to the generated gem skeleton [#3667](https://github.com/rubygems/rubygems/pull/3667)
99
110
  - Allow setting a tag prefix to be used by release tasks [#3766](https://github.com/rubygems/rubygems/pull/3766)
100
-
101
- ## Minor enhancements:
102
-
103
111
  - `bundle outdated` now prints output in columns for better readability [#4474](https://github.com/rubygems/bundler/pull/4474)
104
112
  - bundler's `release` rake task now prints a better message when not being logged in and trying to push a gem [#7513](https://github.com/rubygems/bundler/pull/7513)
105
113
  - `BUNDLE_APP_CONFIG` environment variable is now documented [#7563](https://github.com/rubygems/bundler/pull/7563)
@@ -192,7 +200,7 @@
192
200
  - Restore previous `BUNDLE_GEMFILE` in `bundler/inline` [#7418](https://github.com/rubygems/bundler/pull/7418)
193
201
  - Fix error when using `gem` DSL's `:glob` option for selecting gemspecs from a specific source [#7419](https://github.com/rubygems/bundler/pull/7419)
194
202
 
195
- ## Minor enhancements:
203
+ ## Enhancements:
196
204
 
197
205
  - `bundle config` no longer warns when using "old interface" (might be deprecated again in the future) [#7475](https://github.com/rubygems/bundler/pull/7475)
198
206
  - `bundle update` no longer warns when used without arguments (might be deprecated again in the future) [#7475](https://github.com/rubygems/bundler/pull/7475)
@@ -321,7 +329,7 @@
321
329
 
322
330
  # 2.0.2 (June 13, 2019)
323
331
 
324
- ## Minor enhancements:
332
+ ## Enhancements:
325
333
 
326
334
  - Fixes for Bundler integration with ruby-src ([#6941](https://github.com/rubygems/bundler/pull/6941), [#6973](https://github.com/bundler/bundler/pull/6973), [#6977](https://github.com/bundler/bundler/pull/6977), [#6315](https://github.com/bundler/bundler/pull/6315), [#7061](https://github.com/bundler/bundler/pull/7061))
327
335
  - Use `__dir__` instead of `__FILE__` when generating a gem with `bundle gem` ([#6503](https://github.com/rubygems/bundler/pull/6503))
@@ -365,7 +373,7 @@
365
373
 
366
374
  - Ruby 2.6 compatibility fixes (@segiddins)
367
375
 
368
- ## Minor enhancements:
376
+ ## Enhancements:
369
377
 
370
378
  - Import changes from Bundler 1.17.3 release
371
379
 
@@ -460,7 +468,7 @@ Changes
460
468
 
461
469
  # 1.16.6 (October 5, 2018)
462
470
 
463
- ## Minor enhancements:
471
+ ## Enhancements:
464
472
 
465
473
  - Add an error message when adding a gem with `bundle add` that's already in the bundle ([#6341](https://github.com/rubygems/bundler/issues/6341), @agrim123)
466
474
  - Add Homepage, Source Code and Changelog URI metadata fields to the `bundle gem` gemspec template (@walf443)
@@ -482,7 +490,7 @@ Changes
482
490
 
483
491
  # 1.16.5 (September 18, 2018)
484
492
 
485
- ## Minor enhancements:
493
+ ## Enhancements:
486
494
 
487
495
  - Add support for TruffleRuby (@eregon)
488
496
 
@@ -498,7 +506,7 @@ Changes
498
506
 
499
507
  # 1.16.4 (August 17, 2018)
500
508
 
501
- ## Minor enhancements:
509
+ ## Enhancements:
502
510
 
503
511
  - Welcome new members to the Bundler core team (@indirect)
504
512
  - Don't mutate original error trees when determining version_conflict_message (@greysteil)
@@ -540,7 +548,7 @@ Changes
540
548
 
541
549
  # 1.16.2 (April 20, 2018)
542
550
 
543
- ## Minor enhancements:
551
+ ## Enhancements:
544
552
 
545
553
  - Include the gem's source in the gem install error message when available (@papanikge)
546
554
  - Remove unnecessary executable bit from gem template (@voxik)
@@ -1519,7 +1527,7 @@ Changes
1519
1527
  - prefer gemspecs closest to the directory root ([#3428](https://github.com/rubygems/bundler/issues/3428), @segiddins)
1520
1528
  - debug log for API request limits ([#3452](https://github.com/rubygems/bundler/issues/3452), @neerfri)
1521
1529
 
1522
- ## Minor enhancements:
1530
+ ## Enhancements:
1523
1531
 
1524
1532
  - Molinillo resolver, shared with CocoaPods (@segiddins)
1525
1533
  - updated Thor to v0.19.1 (@segiddins)
@@ -212,6 +212,15 @@ module Bundler
212
212
  end
213
213
  end
214
214
 
215
+ def locked_bundler_version
216
+ return nil unless defined?(@definition) && @definition
217
+
218
+ locked_gems = definition.locked_gems
219
+ return nil unless locked_gems
220
+
221
+ locked_gems.bundler_version
222
+ end
223
+
215
224
  def ruby_scope
216
225
  "#{Bundler.rubygems.ruby_engine}/#{RbConfig::CONFIG["ruby_version"]}"
217
226
  end
@@ -602,8 +611,9 @@ EOF
602
611
  reset_rubygems!
603
612
  end
604
613
 
605
- def reset_settings!
614
+ def reset_settings_and_root!
606
615
  @settings = nil
616
+ @root = nil
607
617
  end
608
618
 
609
619
  def reset_paths!
@@ -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 = "2020-12-10".freeze
8
- @git_commit_sha = "d3628e5019".freeze
7
+ @built_at = "2020-12-14".freeze
8
+ @git_commit_sha = "b98d6b2035".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -57,7 +57,7 @@ module Bundler
57
57
  custom_gemfile = options[:gemfile] || Bundler.settings[:gemfile]
58
58
  if custom_gemfile && !custom_gemfile.empty?
59
59
  Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", File.expand_path(custom_gemfile)
60
- Bundler.reset_settings!
60
+ Bundler.reset_settings_and_root!
61
61
  end
62
62
 
63
63
  Bundler.settings.set_command_option_if_given :retry, options[:retry]
@@ -76,6 +76,8 @@ module Bundler
76
76
  next unless gems.empty? || gems.include?(current_spec.name)
77
77
 
78
78
  active_spec = retrieve_active_spec(definition, current_spec)
79
+ next unless active_spec
80
+
79
81
  next unless filter_options_patch.empty? || update_present_via_semver_portions(current_spec, active_spec, options)
80
82
 
81
83
  gem_outdated = Gem::Version.new(active_spec.version) > Gem::Version.new(current_spec.version)
@@ -229,8 +231,6 @@ module Bundler
229
231
  end
230
232
 
231
233
  def update_present_via_semver_portions(current_spec, active_spec, options)
232
- return false if active_spec.nil?
233
-
234
234
  current_major = current_spec.version.segments.first
235
235
  active_major = active_spec.version.segments.first
236
236
 
@@ -269,7 +269,9 @@ module Bundler
269
269
  else
270
270
  # Run a resolve against the locally available gems
271
271
  Bundler.ui.debug("Found changes from the lockfile, re-resolving dependencies because #{change_reason}")
272
- last_resolve.merge Resolver.resolve(expanded_dependencies, index, source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms)
272
+ platforms_for_resolve = platforms.one? {|p| generic(p) == Gem::Platform::RUBY } ? platforms : platforms.reject{|p| p == Gem::Platform::RUBY }
273
+ expanded_dependencies = expand_dependencies(dependencies + metadata_dependencies, @remote, platforms_for_resolve.map {|p| generic(p) })
274
+ last_resolve.merge Resolver.resolve(expanded_dependencies, index, source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms_for_resolve)
273
275
  end
274
276
 
275
277
  # filter out gems that _can_ be installed on multiple platforms, but don't need
@@ -548,11 +550,7 @@ module Bundler
548
550
  private
549
551
 
550
552
  def add_current_platform
551
- current_platforms.each {|platform| add_platform(platform) }
552
- end
553
-
554
- def current_platforms
555
- [local_platform, generic_local_platform].uniq
553
+ add_platform(local_platform)
556
554
  end
557
555
 
558
556
  def change_reason
@@ -847,14 +845,6 @@ module Bundler
847
845
  @locked_specs[dep].any? {|s| s.satisfies?(dep) && (!dep.source || s.source.include?(dep.source)) }
848
846
  end
849
847
 
850
- # This list of dependencies is only used in #resolve, so it's OK to add
851
- # the metadata dependencies here
852
- def expanded_dependencies
853
- @expanded_dependencies ||= begin
854
- expand_dependencies(dependencies + metadata_dependencies, @remote)
855
- end
856
- end
857
-
858
848
  def metadata_dependencies
859
849
  @metadata_dependencies ||= begin
860
850
  ruby_versions = ruby_version_requirements(@ruby_version)
@@ -881,7 +871,8 @@ module Bundler
881
871
  end
882
872
  end
883
873
 
884
- def expand_dependencies(dependencies, remote = false)
874
+ def expand_dependencies(dependencies, remote = false, platforms = nil)
875
+ platforms ||= @platforms
885
876
  deps = []
886
877
  dependencies.each do |dep|
887
878
  dep = Dependency.new(dep, ">= 0") unless dep.respond_to?(:name)
@@ -96,9 +96,11 @@ module Bundler
96
96
  def gem_platforms(valid_platforms)
97
97
  return valid_platforms if @platforms.empty?
98
98
 
99
+ valid_generic_platforms = valid_platforms.map {|p| [p, GemHelpers.generic(p)] }.to_h
99
100
  @gem_platforms ||= expanded_platforms.compact.uniq
100
101
 
101
- valid_platforms & @gem_platforms
102
+ filtered_generic_platforms = valid_generic_platforms.values & @gem_platforms
103
+ valid_generic_platforms.select {|_, v| filtered_generic_platforms.include?(v) }.keys
102
104
  end
103
105
 
104
106
  def expanded_platforms
@@ -82,7 +82,7 @@ module Bundler
82
82
  search_object = if source.is_a?(Source::Path)
83
83
  Dependency.new(name, version)
84
84
  else
85
- self
85
+ ruby_platform_materializes_to_ruby_platform? ? self : Dependency.new(name, version)
86
86
  end
87
87
  platform_object = Gem::Platform.new(platform)
88
88
  candidates = source.specs.search(search_object)
@@ -129,5 +129,19 @@ module Bundler
129
129
 
130
130
  @specification.send(method, *args, &blk)
131
131
  end
132
+
133
+ #
134
+ # Bundler 2.2.0 was the first version that records the full resolution
135
+ # including platform specific gems in the lockfile, which means that if a
136
+ # gem with RUBY platform is recorded, the RUBY platform version of the gem
137
+ # should be installed. Previously bundler would record only generic versions
138
+ # in the lockfile and then install the most specific platform variant if
139
+ # available.
140
+ #
141
+ def ruby_platform_materializes_to_ruby_platform?
142
+ locked_bundler_version = Bundler.locked_bundler_version
143
+
144
+ locked_bundler_version.nil? || Gem::Version.new(locked_bundler_version) >= Gem::Version.new("2.2.0")
145
+ end
132
146
  end
133
147
  end
@@ -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
- warn debug_info.split("\n").map {|s| "BUNDLER: " + " " * depth + s }
78
+ puts debug_info.split("\n").map {|s| "BUNDLER: " + " " * depth + s }
79
79
  end
80
80
 
81
81
  def debug?
@@ -106,18 +106,19 @@ module Bundler
106
106
  specification.dependencies_for_activated_platforms
107
107
  end
108
108
 
109
- def search_for(dependency)
110
- platform = dependency.__platform
111
- dependency = dependency.dep unless dependency.is_a? Gem::Dependency
112
- search = @search_for[dependency] ||= begin
109
+ def search_for(dependency_proxy)
110
+ platform = dependency_proxy.__platform
111
+ dependency = dependency_proxy.dep
112
+ @search_for[dependency_proxy] ||= begin
113
+ name = dependency.name
113
114
  index = index_for(dependency)
114
- results = index.search(dependency, @base[dependency.name])
115
+ results = index.search(dependency, @base[name])
115
116
 
116
- if vertex = @base_dg.vertex_named(dependency.name)
117
+ if vertex = @base_dg.vertex_named(name)
117
118
  locked_requirement = vertex.payload.requirement
118
119
  end
119
120
 
120
- if !@prerelease_specified[dependency.name] && (!@use_gvp || locked_requirement.nil?)
121
+ if !@prerelease_specified[name] && (!@use_gvp || locked_requirement.nil?)
121
122
  # Move prereleases to the beginning of the list, so they're considered
122
123
  # last during resolution.
123
124
  pre, results = results.partition {|spec| spec.version.prerelease? }
@@ -145,31 +146,25 @@ module Bundler
145
146
  end
146
147
  # GVP handles major itself, but it's still a bit risky to trust it with it
147
148
  # until we get it settled with new behavior. For 2.x it can take over all cases.
148
- if !@use_gvp
149
+ search = if !@use_gvp
149
150
  spec_groups
150
151
  else
151
152
  @gem_version_promoter.sort_versions(dependency, spec_groups)
152
153
  end
153
- end
154
- selected_sgs = []
155
- search.each do |sg|
156
- next unless sg.for?(platform)
157
- # Add a spec group for "non platform specific spec" as the fallback
158
- # spec group.
159
- sg_ruby = sg.copy_for(Gem::Platform::RUBY)
160
- selected_sgs << sg_ruby if sg_ruby
161
- sg_all_platforms = nil
162
- all_platforms = @platforms + [platform]
163
- self.class.sort_platforms(all_platforms).reverse_each do |other_platform|
164
- if sg_all_platforms.nil?
165
- sg_all_platforms = sg.copy_for(other_platform)
166
- else
167
- sg_all_platforms.activate_platform!(other_platform)
168
- end
154
+ selected_sgs = []
155
+ search.each do |sg|
156
+ next unless sg.for?(platform)
157
+ sg_all_platforms = sg.copy_for(self.class.sort_platforms(@platforms).reverse)
158
+ selected_sgs << sg_all_platforms
159
+
160
+ next if sg_all_platforms.activated_platforms == [Gem::Platform::RUBY]
161
+ # Add a spec group for "non platform specific spec" as the fallback
162
+ # spec group.
163
+ sg_ruby = sg.copy_for([Gem::Platform::RUBY])
164
+ selected_sgs.insert(-2, sg_ruby) if sg_ruby
169
165
  end
170
- selected_sgs << sg_all_platforms
166
+ selected_sgs
171
167
  end
172
- selected_sgs
173
168
  end
174
169
 
175
170
  def index_for(dependency)
@@ -6,7 +6,7 @@ module Bundler
6
6
  include GemHelpers
7
7
 
8
8
  attr_accessor :name, :version, :source
9
- attr_accessor :ignores_bundler_dependencies
9
+ attr_accessor :ignores_bundler_dependencies, :activated_platforms
10
10
 
11
11
  def initialize(all_specs)
12
12
  @all_specs = all_specs
@@ -32,17 +32,13 @@ module Bundler
32
32
  end.compact.uniq
33
33
  end
34
34
 
35
- def activate_platform!(platform)
36
- return unless for?(platform)
37
- return if @activated_platforms.include?(platform)
38
- @activated_platforms << platform
39
- end
35
+ def copy_for(platforms)
36
+ platforms.select! {|p| for?(p) }
37
+ return unless platforms.any?
40
38
 
41
- def copy_for(platform)
42
39
  copied_sg = self.class.new(@all_specs)
43
40
  copied_sg.ignores_bundler_dependencies = @ignores_bundler_dependencies
44
- return nil unless copied_sg.for?(platform)
45
- copied_sg.activate_platform!(platform)
41
+ copied_sg.activated_platforms = platforms
46
42
  copied_sg
47
43
  end
48
44
 
@@ -565,7 +565,6 @@ module Bundler
565
565
  end
566
566
 
567
567
  def all_specs
568
- require_relative "remote_specification"
569
568
  Gem::Specification.stubs.map do |stub|
570
569
  StubSpecification.from_stub(stub)
571
570
  end
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "remote_specification"
4
-
5
3
  module Bundler
6
4
  class StubSpecification < RemoteSpecification
7
5
  def self.from_stub(stub)
@@ -159,7 +159,14 @@ class Bundler::Persistent::Net::HTTP::Persistent
159
159
  # limits (typically windows).
160
160
 
161
161
  if Process.const_defined? :RLIMIT_NOFILE
162
- DEFAULT_POOL_SIZE = Process.getrlimit(Process::RLIMIT_NOFILE).first / 4
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
163
170
  else
164
171
  DEFAULT_POOL_SIZE = 256
165
172
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.2.0".freeze
4
+ VERSION = "2.2.1".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.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Arko
@@ -19,10 +19,10 @@ authors:
19
19
  - Terence Lee
20
20
  - Carl Lerche
21
21
  - Yehuda Katz
22
- autorequire:
22
+ autorequire:
23
23
  bindir: exe
24
24
  cert_chain: []
25
- date: 2020-12-10 00:00:00.000000000 Z
25
+ date: 2020-12-14 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
@@ -335,7 +335,7 @@ metadata:
335
335
  changelog_uri: https://github.com/rubygems/rubygems/blob/master/bundler/CHANGELOG.md
336
336
  homepage_uri: https://bundler.io/
337
337
  source_code_uri: https://github.com/rubygems/rubygems/
338
- post_install_message:
338
+ post_install_message:
339
339
  rdoc_options: []
340
340
  require_paths:
341
341
  - lib
@@ -351,7 +351,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
351
351
  version: 2.5.2
352
352
  requirements: []
353
353
  rubygems_version: 3.2.0
354
- signing_key:
354
+ signing_key:
355
355
  specification_version: 4
356
356
  summary: The best way to manage your application's dependencies
357
357
  test_files: []