bundler 2.5.16 → 2.5.17

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: 736fcd6d7bb9c8f0aaa8187d662846d4a17dc827b580d7912350e1e11f7b8c2a
4
- data.tar.gz: 793b6ad42430c89e42202dc735637373f7e7e780e286c63ca603e05712cd4bc1
3
+ metadata.gz: 60cb5ee8526a6f8eb3c413e7d3d2ae8c9b32315685862943fc2a956f2fdcd5a1
4
+ data.tar.gz: 52aa4c3a435ed97c8dbc2adcfa51dc6d2113fefcb5020df0a5b0be3b605cc49f
5
5
  SHA512:
6
- metadata.gz: 9246f1b4a399b0f70fc9309365922cd4759dab87cce71f1048c36c50ec5ebc2563c5942c72bf9815a1b9fe13656d3e59b9fd1b490b1f8e32db8f24769b5bdd02
7
- data.tar.gz: d18554604463d8c50739086ee2c9587ca13d44fc24171ed8f4e4759be9a8f71902026a942cf7dcc6ecec74943f6b2c901d71c5455a152a21d5c304ccec87f70d
6
+ metadata.gz: afafe4e932d1840de3938e609f45555b1fbdf3fea481ee6d395a1f1458d579606d2f5ac64edc90d74799d9b117aae3fd1028b6d3a660df97e087bb9f6475d583
7
+ data.tar.gz: fd8907298e40c98124857ea7bf2594953d962946b66da695ce929db2623e67dacbee7dec6500a3dfb89cb6308377a26c305a25cd28a7083432ec10baf0d59810
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ # 2.5.17 (August 1, 2024)
2
+
3
+ ## Enhancements:
4
+
5
+ - Print better log message when current platform is not present in the lockfile [#7891](https://github.com/rubygems/rubygems/pull/7891)
6
+ - Explicitly encode `Gem::Dependency` to yaml [#7867](https://github.com/rubygems/rubygems/pull/7867)
7
+ - Enable lockfile checksums on future Bundler 3 when there's no previous lockfile [#7805](https://github.com/rubygems/rubygems/pull/7805)
8
+
9
+ ## Bug fixes:
10
+
11
+ - Fix truffleruby removing gems from lockfile [#7795](https://github.com/rubygems/rubygems/pull/7795)
12
+ - Fix `bundle check` exit code when gem git source is not checked out [#7894](https://github.com/rubygems/rubygems/pull/7894)
13
+ - Generate gems.rb from Gemfile.tt template for `bundle-gem` [#7853](https://github.com/rubygems/rubygems/pull/7853)
14
+ - Fix git source cache being used as the install location [#4469](https://github.com/rubygems/rubygems/pull/4469)
15
+ - Fix `bundle exec gem uninstall` [#7886](https://github.com/rubygems/rubygems/pull/7886)
16
+
1
17
  # 2.5.16 (July 18, 2024)
2
18
 
3
19
  ## 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 = "2024-07-18".freeze
8
- @git_commit_sha = "f49d3d48c9".freeze
7
+ @built_at = "2024-08-01".freeze
8
+ @git_commit_sha = "74d92b2502".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -17,7 +17,7 @@ module Bundler
17
17
  begin
18
18
  definition.resolve_only_locally!
19
19
  not_installed = definition.missing_specs
20
- rescue GemNotFound, SolveFailure
20
+ rescue GemNotFound, GitError, SolveFailure
21
21
  Bundler.ui.error "Bundler can't satisfy your Gemfile's dependencies."
22
22
  Bundler.ui.warn "Install missing gems with `bundle install`."
23
23
  exit 1
@@ -79,7 +79,7 @@ module Bundler
79
79
  ensure_safe_gem_name(name, constant_array)
80
80
 
81
81
  templates = {
82
- "#{Bundler.preferred_gemfile_name}.tt" => Bundler.preferred_gemfile_name,
82
+ "Gemfile.tt" => Bundler.preferred_gemfile_name,
83
83
  "lib/newgem.rb.tt" => "lib/#{namespaced_path}.rb",
84
84
  "lib/newgem/version.rb.tt" => "lib/#{namespaced_path}/version.rb",
85
85
  "sig/newgem.rbs.tt" => "sig/#{namespaced_path}.rbs",
data/lib/bundler/cli.rb CHANGED
@@ -110,8 +110,8 @@ module Bundler
110
110
  default_task(Bundler.feature_flag.default_cli_command)
111
111
 
112
112
  class_option "no-color", type: :boolean, desc: "Disable colorization in output"
113
- class_option "retry", type: :numeric, aliases: "-r", banner: "NUM",
114
- desc: "Specify the number of times you wish to attempt network commands"
113
+ class_option "retry", type: :numeric, aliases: "-r", banner: "NUM",
114
+ desc: "Specify the number of times you wish to attempt network commands"
115
115
  class_option "verbose", type: :boolean, desc: "Enable verbose output mode", aliases: "-V"
116
116
 
117
117
  def help(cli = nil)
@@ -260,15 +260,15 @@ module Bundler
260
260
  method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
261
261
  method_option "group", aliases: "-g", type: :array, banner: "Update a specific group"
262
262
  method_option "jobs", aliases: "-j", type: :numeric, banner: "Specify the number of jobs to run in parallel"
263
- method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
264
- method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
263
+ method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
264
+ method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
265
265
  method_option "source", type: :array, banner: "Update a specific source (and all gems associated with it)"
266
266
  method_option "redownload", type: :boolean, aliases: "--force", banner: "Force downloading every gem."
267
267
  method_option "ruby", type: :boolean, banner: "Update ruby specified in Gemfile.lock"
268
268
  method_option "bundler", type: :string, lazy_default: "> 0.a", banner: "Update the locked version of bundler"
269
- method_option "patch", type: :boolean, banner: "Prefer updating only to next patch version"
270
- method_option "minor", type: :boolean, banner: "Prefer updating only to next minor version"
271
- method_option "major", type: :boolean, banner: "Prefer updating to next major version (default)"
269
+ method_option "patch", type: :boolean, banner: "Prefer updating only to next patch version"
270
+ method_option "minor", type: :boolean, banner: "Prefer updating only to next minor version"
271
+ method_option "major", type: :boolean, banner: "Prefer updating to next major version (default)"
272
272
  method_option "pre", type: :boolean, banner: "Always choose the highest allowed version when updating gems, regardless of prerelease status"
273
273
  method_option "strict", type: :boolean, banner: "Do not allow any gem to be updated past latest --patch | --minor | --major"
274
274
  method_option "conservative", type: :boolean, banner: "Use bundle install conservative update behavior and do not allow shared dependencies to be updated."
@@ -397,11 +397,11 @@ module Bundler
397
397
  end
398
398
 
399
399
  desc "cache [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
400
- method_option "all", type: :boolean,
401
- default: Bundler.feature_flag.cache_all?,
402
- banner: "Include all sources (including path and git)."
400
+ method_option "all", type: :boolean,
401
+ default: Bundler.feature_flag.cache_all?,
402
+ banner: "Include all sources (including path and git)."
403
403
  method_option "all-platforms", type: :boolean, banner: "Include gems for all platforms present in the lockfile, not only the current one"
404
- method_option "cache-path", type: :string, banner: "Specify a different cache path than the default (vendor/cache)."
404
+ method_option "cache-path", type: :string, banner: "Specify a different cache path than the default (vendor/cache)."
405
405
  method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
406
406
  method_option "no-install", type: :boolean, banner: "Don't install the gems, only update the cache."
407
407
  method_option "no-prune", type: :boolean, banner: "Don't remove stale gems from the cache."
@@ -605,7 +605,7 @@ module Bundler
605
605
  end
606
606
 
607
607
  desc "inject GEM VERSION", "Add the named gem, with version requirements, to the resolved Gemfile", hide: true
608
- method_option "source", type: :string, banner: "Install gem from the given source"
608
+ method_option "source", type: :string, banner: "Install gem from the given source"
609
609
  method_option "group", type: :string, banner: "Install gem into a bundler group"
610
610
  def inject(name, version)
611
611
  SharedHelpers.major_deprecation 2, "The `inject` command has been replaced by the `add` command"
@@ -615,16 +615,16 @@ module Bundler
615
615
 
616
616
  desc "lock", "Creates a lockfile without installing"
617
617
  method_option "update", type: :array, lazy_default: true, banner: "ignore the existing lockfile, update all gems by default, or update list of given gems"
618
- method_option "local", type: :boolean, default: false, banner: "do not attempt to fetch remote gemspecs and use the local gem cache only"
619
- method_option "print", type: :boolean, default: false, banner: "print the lockfile to STDOUT instead of writing to the file system"
618
+ method_option "local", type: :boolean, default: false, banner: "do not attempt to fetch remote gemspecs and use the local gem cache only"
619
+ method_option "print", type: :boolean, default: false, banner: "print the lockfile to STDOUT instead of writing to the file system"
620
620
  method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
621
621
  method_option "lockfile", type: :string, default: nil, banner: "the path the lockfile should be written to"
622
622
  method_option "full-index", type: :boolean, default: false, banner: "Fall back to using the single-file index of all gems"
623
623
  method_option "add-platform", type: :array, default: [], banner: "Add a new platform to the lockfile"
624
- method_option "remove-platform", type: :array, default: [], banner: "Remove a platform from the lockfile"
625
- method_option "patch", type: :boolean, banner: "If updating, prefer updating only to next patch version"
626
- method_option "minor", type: :boolean, banner: "If updating, prefer updating only to next minor version"
627
- method_option "major", type: :boolean, banner: "If updating, prefer updating to next major version (default)"
624
+ method_option "remove-platform", type: :array, default: [], banner: "Remove a platform from the lockfile"
625
+ method_option "patch", type: :boolean, banner: "If updating, prefer updating only to next patch version"
626
+ method_option "minor", type: :boolean, banner: "If updating, prefer updating only to next minor version"
627
+ method_option "major", type: :boolean, banner: "If updating, prefer updating to next major version (default)"
628
628
  method_option "pre", type: :boolean, banner: "If updating, always choose the highest allowed version, regardless of prerelease status"
629
629
  method_option "strict", type: :boolean, banner: "If updating, do not allow any gem to be updated past latest --patch | --minor | --major"
630
630
  method_option "conservative", type: :boolean, banner: "If updating, use bundle install conservative update behavior and do not allow shared dependencies to be updated"
@@ -115,7 +115,7 @@ module Bundler
115
115
  @originally_locked_specs = @locked_specs
116
116
  @locked_sources = []
117
117
  @locked_platforms = []
118
- @locked_checksums = nil
118
+ @locked_checksums = Bundler.feature_flag.bundler_3_mode?
119
119
  end
120
120
 
121
121
  locked_gem_sources = @locked_sources.select {|s| s.is_a?(Source::Rubygems) }
@@ -137,7 +137,7 @@ module Bundler
137
137
  end
138
138
  @unlocking ||= @unlock[:ruby] ||= (!@locked_ruby_version ^ !@ruby_version)
139
139
 
140
- add_current_platform unless Bundler.frozen_bundle?
140
+ @current_platform_missing = add_current_platform unless Bundler.frozen_bundle?
141
141
 
142
142
  converge_path_sources_to_gemspec_sources
143
143
  @path_changes = converge_paths
@@ -484,6 +484,7 @@ module Bundler
484
484
 
485
485
  !@source_changes &&
486
486
  !@dependency_changes &&
487
+ !@current_platform_missing &&
487
488
  @new_platforms.empty? &&
488
489
  !@path_changes &&
489
490
  !@local_changes &&
@@ -629,6 +630,7 @@ module Bundler
629
630
  def start_resolution
630
631
  local_platform_needed_for_resolvability = @most_specific_non_local_locked_ruby_platform && !@platforms.include?(local_platform)
631
632
  @platforms << local_platform if local_platform_needed_for_resolvability
633
+ add_platform(Gem::Platform::RUBY) if RUBY_ENGINE == "truffleruby"
632
634
 
633
635
  result = SpecSet.new(resolver.start)
634
636
 
@@ -671,19 +673,19 @@ module Bundler
671
673
  end
672
674
 
673
675
  def add_current_platform
674
- @most_specific_non_local_locked_ruby_platform = find_most_specific_non_local_locked_ruby_platform
676
+ return if @platforms.include?(local_platform)
677
+
678
+ @most_specific_non_local_locked_ruby_platform = find_most_specific_locked_ruby_platform
675
679
  return if @most_specific_non_local_locked_ruby_platform
676
680
 
677
- add_platform(local_platform)
681
+ @platforms << local_platform
682
+ true
678
683
  end
679
684
 
680
- def find_most_specific_non_local_locked_ruby_platform
685
+ def find_most_specific_locked_ruby_platform
681
686
  return unless generic_local_platform_is_ruby? && current_platform_locked?
682
687
 
683
- most_specific_locked_ruby_platform = most_specific_locked_platform
684
- return unless most_specific_locked_ruby_platform != local_platform
685
-
686
- most_specific_locked_ruby_platform
688
+ most_specific_locked_platform
687
689
  end
688
690
 
689
691
  def change_reason
@@ -705,6 +707,7 @@ module Bundler
705
707
  [
706
708
  [@source_changes, "the list of sources changed"],
707
709
  [@dependency_changes, "the dependencies in your gemfile changed"],
710
+ [@current_platform_missing, "your lockfile does not include the current platform"],
708
711
  [@new_platforms.any?, "you added a new platform to your gemfile"],
709
712
  [@path_changes, "the gemspecs for path gems changed"],
710
713
  [@local_changes, "the gemspecs for git local gems changed"],
@@ -2,8 +2,6 @@
2
2
 
3
3
  module Bundler
4
4
  module ForcePlatform
5
- private
6
-
7
5
  # The `:force_ruby_platform` value used by dependencies for resolution, and
8
6
  # by locked specifications for materialization is `false` by default, except
9
7
  # for TruffleRuby. TruffleRuby generally needs to force the RUBY platform
@@ -196,6 +196,7 @@ module Bundler
196
196
 
197
197
  FileUtils.rm_rf(new_cache_path)
198
198
  FileUtils.cp_r(install_path, new_cache_path)
199
+ FileUtils.rm_rf(app_cache_path.join(".git"))
199
200
  FileUtils.touch(app_cache_path.join(".bundlecache"))
200
201
  end
201
202
 
@@ -237,26 +237,20 @@ module Gem
237
237
 
238
238
  include ::Bundler::ForcePlatform
239
239
 
240
+ attr_reader :force_ruby_platform
241
+
240
242
  attr_accessor :source, :groups
241
243
 
242
244
  alias_method :eql?, :==
243
245
 
244
- def force_ruby_platform
245
- return @force_ruby_platform if defined?(@force_ruby_platform) && !@force_ruby_platform.nil?
246
-
247
- @force_ruby_platform = default_force_ruby_platform
248
- end
249
-
250
- def encode_with(coder)
251
- to_yaml_properties.each do |ivar|
252
- coder[ivar.to_s.sub(/^@/, "")] = instance_variable_get(ivar)
246
+ unless method_defined?(:encode_with, false)
247
+ def encode_with(coder)
248
+ [:@name, :@requirement, :@type, :@prerelease, :@version_requirements].each do |ivar|
249
+ coder[ivar.to_s.sub(/^@/, "")] = instance_variable_get(ivar)
250
+ end
253
251
  end
254
252
  end
255
253
 
256
- def to_yaml_properties
257
- instance_variables.reject {|p| ["@source", "@groups"].include?(p.to_s) }
258
- end
259
-
260
254
  def to_lock
261
255
  out = String.new(" #{name}")
262
256
  unless requirement.none?
@@ -128,11 +128,6 @@ module Bundler
128
128
  spec.source.cache(spec, custom_path) if spec.source.respond_to?(:cache)
129
129
  end
130
130
 
131
- Dir[cache_path.join("*/.git")].each do |git_dir|
132
- FileUtils.rm_rf(git_dir)
133
- FileUtils.touch(File.expand_path("../.bundlecache", git_dir))
134
- end
135
-
136
131
  prune_cache(cache_path) unless Bundler.settings[:no_prune]
137
132
  end
138
133
 
@@ -164,7 +164,8 @@ module Bundler
164
164
  "does not exist. Run `bundle config unset local.#{override_for(original_path)}` to remove the local override"
165
165
  end
166
166
 
167
- set_local!(path)
167
+ @local = true
168
+ set_paths!(path)
168
169
 
169
170
  # Create a new git proxy without the cached revision
170
171
  # so the Gemfile.lock always picks up the new revision.
@@ -187,13 +188,11 @@ module Bundler
187
188
  end
188
189
 
189
190
  def specs(*)
190
- set_local!(app_cache_path) if has_app_cache? && !local?
191
+ set_cache_path!(app_cache_path) if has_app_cache? && !local?
191
192
 
192
193
  if requires_checkout? && !@copied
193
194
  fetch
194
- git_proxy.copy_to(install_path, submodules)
195
- serialize_gemspecs_in(install_path)
196
- @copied = true
195
+ checkout
197
196
  end
198
197
 
199
198
  local_specs
@@ -206,10 +205,7 @@ module Bundler
206
205
  print_using_message "Using #{version_message(spec, options[:previous_spec])} from #{self}"
207
206
 
208
207
  if (requires_checkout? && !@copied) || force
209
- Bundler.ui.debug " * Checking out revision: #{ref}"
210
- git_proxy.copy_to(install_path, submodules)
211
- serialize_gemspecs_in(install_path)
212
- @copied = true
208
+ checkout
213
209
  end
214
210
 
215
211
  generate_bin_options = { disable_extensions: !Bundler.rubygems.spec_missing_extensions?(spec), build_args: options[:build_args] }
@@ -221,12 +217,13 @@ module Bundler
221
217
  def cache(spec, custom_path = nil)
222
218
  app_cache_path = app_cache_path(custom_path)
223
219
  return unless Bundler.feature_flag.cache_all?
224
- return if path == app_cache_path
220
+ return if install_path == app_cache_path
221
+ return if cache_path == app_cache_path
225
222
  cached!
226
223
  FileUtils.rm_rf(app_cache_path)
227
224
  git_proxy.checkout if requires_checkout?
228
- git_proxy.copy_to(app_cache_path, @submodules)
229
- serialize_gemspecs_in(app_cache_path)
225
+ FileUtils.cp_r("#{cache_path}/.", app_cache_path)
226
+ FileUtils.touch(app_cache_path.join(".bundlecache"))
230
227
  end
231
228
 
232
229
  def load_spec_files
@@ -270,6 +267,13 @@ module Bundler
270
267
 
271
268
  private
272
269
 
270
+ def checkout
271
+ Bundler.ui.debug " * Checking out revision: #{ref}"
272
+ git_proxy.copy_to(install_path, submodules)
273
+ serialize_gemspecs_in(install_path)
274
+ @copied = true
275
+ end
276
+
273
277
  def humanized_ref
274
278
  if local?
275
279
  path
@@ -298,10 +302,19 @@ module Bundler
298
302
  end
299
303
  end
300
304
 
301
- def set_local!(path)
302
- @local = true
303
- @local_specs = @git_proxy = nil
304
- @cache_path = @install_path = path
305
+ def set_paths!(path)
306
+ set_cache_path!(path)
307
+ set_install_path!(path)
308
+ end
309
+
310
+ def set_cache_path!(path)
311
+ @git_proxy = nil
312
+ @cache_path = path
313
+ end
314
+
315
+ def set_install_path!(path)
316
+ @local_specs = nil
317
+ @install_path = path
305
318
  end
306
319
 
307
320
  def has_app_cache?
@@ -94,7 +94,7 @@ module Bundler
94
94
  end
95
95
 
96
96
  def delete(specs)
97
- specs.each {|spec| @specs.delete(spec) }
97
+ Array(specs).each {|spec| @specs.delete(spec) }
98
98
 
99
99
  reset!
100
100
  end
@@ -280,7 +280,7 @@ module Bundler
280
280
  if platform
281
281
  GemHelpers.select_best_platform_match(specs_for_name, platform, force_ruby: dep.force_ruby_platform)
282
282
  else
283
- GemHelpers.select_best_local_platform_match(specs_for_name, force_ruby: dep.force_ruby_platform)
283
+ GemHelpers.select_best_local_platform_match(specs_for_name, force_ruby: dep.force_ruby_platform || dep.default_force_ruby_platform)
284
284
  end
285
285
  end
286
286
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.5.16".freeze
4
+ VERSION = "2.5.17".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
@@ -41,7 +41,7 @@ module Bundler
41
41
  HASH_REGEX = /
42
42
  ^
43
43
  ([ ]*) # indentations
44
- (.+) # key
44
+ ([^#]+) # key excludes comment char '#'
45
45
  (?::(?=(?:\s|$))) # : (without the lookahead the #key includes this when : is present in value)
46
46
  [ ]?
47
47
  (['"]?) # optional opening quote
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.16
4
+ version: 2.5.17
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: 2024-07-18 00:00:00.000000000 Z
25
+ date: 2024-08-01 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
@@ -400,7 +400,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
400
400
  - !ruby/object:Gem::Version
401
401
  version: 3.2.3
402
402
  requirements: []
403
- rubygems_version: 3.5.16
403
+ rubygems_version: 3.5.17
404
404
  signing_key:
405
405
  specification_version: 4
406
406
  summary: The best way to manage your application's dependencies