rubygems-update 4.0.17 → 4.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +30 -0
  3. data/bundler/CHANGELOG.md +45 -0
  4. data/bundler/lib/bundler/build_metadata.rb +1 -1
  5. data/bundler/lib/bundler/cli/check.rb +1 -3
  6. data/bundler/lib/bundler/cli/common.rb +11 -0
  7. data/bundler/lib/bundler/cli/install.rb +1 -0
  8. data/bundler/lib/bundler/cli/issue.rb +2 -2
  9. data/bundler/lib/bundler/cli/lock.rb +10 -2
  10. data/bundler/lib/bundler/cli/update.rb +1 -0
  11. data/bundler/lib/bundler/cli.rb +5 -3
  12. data/bundler/lib/bundler/compact_index_client/cache.rb +11 -0
  13. data/bundler/lib/bundler/definition.rb +13 -3
  14. data/bundler/lib/bundler/endpoint_specification.rb +19 -1
  15. data/bundler/lib/bundler/fetcher.rb +7 -1
  16. data/bundler/lib/bundler/installer/parallel_installer.rb +9 -1
  17. data/bundler/lib/bundler/installer.rb +6 -0
  18. data/bundler/lib/bundler/lockfile_generator.rb +16 -0
  19. data/bundler/lib/bundler/man/bundle-add.1 +1 -1
  20. data/bundler/lib/bundler/man/bundle-add.1.ronn +1 -1
  21. data/bundler/lib/bundler/man/bundle-cache.1 +3 -0
  22. data/bundler/lib/bundler/man/bundle-cache.1.ronn +6 -0
  23. data/bundler/lib/bundler/man/bundle-config.1 +3 -3
  24. data/bundler/lib/bundler/man/bundle-config.1.ronn +7 -5
  25. data/bundler/lib/bundler/man/bundle-console.1 +2 -2
  26. data/bundler/lib/bundler/man/bundle-console.1.ronn +2 -2
  27. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  28. data/bundler/lib/bundler/man/bundle-init.1.ronn +1 -1
  29. data/bundler/lib/bundler/man/bundle-lock.1 +4 -1
  30. data/bundler/lib/bundler/man/bundle-lock.1.ronn +6 -0
  31. data/bundler/lib/bundler/man/bundle-plugin.1 +1 -1
  32. data/bundler/lib/bundler/man/bundle-plugin.1.ronn +1 -1
  33. data/bundler/lib/bundler/man/bundle.1 +22 -1
  34. data/bundler/lib/bundler/man/bundle.1.ronn +22 -1
  35. data/bundler/lib/bundler/man/gemfile.5 +12 -1
  36. data/bundler/lib/bundler/man/gemfile.5.ronn +20 -1
  37. data/bundler/lib/bundler/resolver.rb +54 -1
  38. data/bundler/lib/bundler/source/git/git_proxy.rb +6 -5
  39. data/bundler/lib/bundler/source_list.rb +30 -1
  40. data/bundler/lib/bundler/version.rb +1 -1
  41. data/bundler/lib/bundler.rb +1 -1
  42. data/lib/rubygems/commands/help_command.rb +2 -2
  43. data/lib/rubygems/deprecate.rb +1 -1
  44. data/lib/rubygems/installer.rb +1 -1
  45. data/lib/rubygems/package/old.rb +7 -2
  46. data/lib/rubygems/package.rb +15 -4
  47. data/lib/rubygems/requirement.rb +9 -2
  48. data/lib/rubygems/safe_marshal/reader.rb +20 -9
  49. data/lib/rubygems/safe_marshal/visitors/to_ruby.rb +8 -1
  50. data/lib/rubygems/specification.rb +27 -15
  51. data/lib/rubygems/uninstaller.rb +2 -1
  52. data/lib/rubygems/util.rb +4 -1
  53. data/lib/rubygems.rb +6 -1
  54. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6781781dd2ce13c49c2771fe518b3b13116d37285c607368a0e719e538aadd82
4
- data.tar.gz: 0f6eb6c051bf17b55057b7c2e30027dd2119acf2dcabeaab6b70834f5d6a59c6
3
+ metadata.gz: fea8148baa9550b989b52e1b5a5bdd0331ce3f3658acd4e6a8655b4aca669d05
4
+ data.tar.gz: d6873bcf37f0e87a7c35663e446b5a907a833d469270fce61e06e5c384b26b64
5
5
  SHA512:
6
- metadata.gz: c31326c1bcd80727a77f559b5d6c6c0b51ae74529d3c8b31a0768afe798ec906788ad1b91934e5b63770442822e71a8067dddebaa262327cee3ab2e8c71e8dd7
7
- data.tar.gz: 184787705ecd74c6c19fe5382a4103ad69e5179672d5de14c5a84e88170ac97b3ad02c2432ba0f139b337a634a96b5d6b70f6431d757a6c4ab3fbc22702fcc4d
6
+ metadata.gz: 959ce199999beef457228f6ca8ef0d74f6cd19cb433fe5fdf21ec42961df13b81b98209a21bb2c6c298521b201cf2f64161be7efd5a3ac92d155a6c0c17876d0
7
+ data.tar.gz: eb602763996a439e8f8598b14c08ead139b527a814e11c9acdae89c4c1556ede07fed87cdde079509b124510f5f3844e394ef74e69e3a532c1900b271d684b14
data/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.0.19 / 2026-08-20
4
+
5
+ ### Enhancements:
6
+
7
+ * Reject SafeMarshal collection lengths longer than the remaining input. Pull request [#9756](https://github.com/ruby/rubygems/pull/9756) by hsbt
8
+ * Installs bundler 4.0.19 as a default gem.
9
+
10
+ ### Bug fixes:
11
+
12
+ * Fix gem uninstall --user-install crash when GEM_HOME does not exist. Pull request [#9749](https://github.com/ruby/rubygems/pull/9749) by hsbt
13
+
14
+ ### Documentation:
15
+
16
+ * Document SPDX license handling for license= and licenses=. Pull request [#9766](https://github.com/ruby/rubygems/pull/9766) by hsbt
17
+
18
+ ## 4.0.18 / 2026-08-05
19
+
20
+ ### Enhancements:
21
+
22
+ * Check the resolved parent directory before extracting old format gems. Pull request [#9755](https://github.com/ruby/rubygems/pull/9755) by hsbt
23
+ * Installs bundler 4.0.18 as a default gem.
24
+
25
+ ### Bug fixes:
26
+
27
+ * Call Kernel.format explicitly in Gem::Deprecate wrapper. Pull request [#9714](https://github.com/ruby/rubygems/pull/9714) by hsbt
28
+
29
+ ### Documentation:
30
+
31
+ * Point bundler.io URLs at guides.rubygems.org. Pull request [#9737](https://github.com/ruby/rubygems/pull/9737) by hsbt
32
+
3
33
  ## 4.0.17 / 2026-07-22
4
34
 
5
35
  ### Enhancements:
data/bundler/CHANGELOG.md CHANGED
@@ -1,5 +1,50 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.0.19 / 2026-08-20
4
+
5
+ ### Enhancements:
6
+
7
+ * Validate the platform field in Gem::Installer#verify_spec. Pull request [#9780](https://github.com/ruby/rubygems/pull/9780) by hsbt
8
+ * Restrict UserDefined handling to explicit class set for Gem::SafeMashal. Pull request [#9770](https://github.com/ruby/rubygems/pull/9770) by jackorp
9
+ * Filter git command output against the configured URI. Pull request [#9778](https://github.com/ruby/rubygems/pull/9778) by hsbt
10
+ * Summarize cooldown-skipped versions at the end of install, update, and lock. Pull request [#9762](https://github.com/ruby/rubygems/pull/9762) by hsbt
11
+
12
+ ### Bug fixes:
13
+
14
+ * Make repeated bundle lock options accumulate. Pull request [#9748](https://github.com/ruby/rubygems/pull/9748) by hsbt
15
+ * Fail instead of warning when frozen mode can't update the lockfile. Pull request [#9750](https://github.com/ruby/rubygems/pull/9750) by hsbt
16
+ * Fix wrong $LOAD_PATH for gems installed in the same process. Pull request [#9784](https://github.com/ruby/rubygems/pull/9784) by hsbt
17
+
18
+ ### Documentation:
19
+
20
+ * Fix auto-clean default version in bundle config docs. Pull request [#9783](https://github.com/ruby/rubygems/pull/9783) by hsbt
21
+ * Correct Bundler 5 default path documentation. Pull request [#9771](https://github.com/ruby/rubygems/pull/9771) by alloutflo
22
+
23
+ ## 4.0.18 / 2026-08-05
24
+
25
+ ### Enhancements:
26
+
27
+ * Don't mask install errors when no Gemfile can be located. Pull request [#9757](https://github.com/ruby/rubygems/pull/9757) by hsbt
28
+ * Warn when duplicate source declarations conflict on cooldown. Pull request [#9736](https://github.com/ruby/rubygems/pull/9736) by hsbt
29
+ * Redact URI userinfo from settings names in Bundler User-Agent. Pull request [#9716](https://github.com/ruby/rubygems/pull/9716) by hsbt
30
+ * Validate gem name before building compact index cache paths. Pull request [#9717](https://github.com/ruby/rubygems/pull/9717) by hsbt
31
+
32
+ ### Bug fixes:
33
+
34
+ * Fail `bundle check` when frozen mode needs lockfile changes. Pull request [#9715](https://github.com/ruby/rubygems/pull/9715) by hsbt
35
+ * Skip empty checksum values in compact index metadata. Pull request [#9713](https://github.com/ruby/rubygems/pull/9713) by hsbt
36
+
37
+ ### Security:
38
+
39
+ * Add --cooldown flag to bundle lock and bundle cache. Pull request [#9725](https://github.com/ruby/rubygems/pull/9725) by hsbt
40
+
41
+ ### Documentation:
42
+
43
+ * Point bundler.io URLs at guides.rubygems.org. Pull request [#9737](https://github.com/ruby/rubygems/pull/9737) by hsbt
44
+ * Document Bundler checksum behavior for default gems. Pull request [#9735](https://github.com/ruby/rubygems/pull/9735) by p-linnane
45
+ * List missing subcommands in bundle(1) UTILITIES section. Pull request [#9721](https://github.com/ruby/rubygems/pull/9721) by hsbt
46
+ * Document pessimistic operator and eval_gemfile in gemfile(5). Pull request [#9719](https://github.com/ruby/rubygems/pull/9719) by hsbt
47
+
3
48
  ## 4.0.17 / 2026-07-22
4
49
 
5
50
  ### Enhancements:
@@ -5,7 +5,7 @@ module Bundler
5
5
  module BuildMetadata
6
6
  # begin ivars
7
7
  @built_at = nil
8
- @git_commit_sha = "f80cbc4c44".freeze
8
+ @git_commit_sha = "2d0e3df43a".freeze
9
9
  # end ivars
10
10
 
11
11
  # A hash representation of the build metadata.
@@ -12,6 +12,7 @@ module Bundler
12
12
  Bundler.settings.set_command_option_if_given :path, options[:path]
13
13
 
14
14
  definition = Bundler.definition
15
+ definition.ensure_equivalent_gemfile_and_lockfile
15
16
  definition.validate_runtime!
16
17
 
17
18
  begin
@@ -28,9 +29,6 @@ module Bundler
28
29
  not_installed.each {|s| Bundler.ui.error " * #{s.name} (#{s.version})" }
29
30
  Bundler.ui.warn "Install missing gems with `bundle install`"
30
31
  exit 1
31
- elsif !Bundler.default_lockfile.file? && Bundler.frozen_bundle?
32
- Bundler.ui.error "This bundle has been frozen, but there is no #{SharedHelpers.relative_lockfile_path} present"
33
- exit 1
34
32
  else
35
33
  definition.lock(true) unless options[:"dry-run"]
36
34
  Bundler.ui.info "The Gemfile's dependencies are satisfied"
@@ -20,6 +20,17 @@ module Bundler
20
20
  Bundler.ui.info msg
21
21
  end
22
22
 
23
+ def self.output_cooldown_skipped_summary(definition = Bundler.definition)
24
+ skipped = definition.cooldown_skipped
25
+ return if skipped.empty?
26
+
27
+ Bundler.ui.info "The following gem versions were skipped by the cooldown setting:"
28
+ skipped.each do |entry|
29
+ days = entry[:available_in_days]
30
+ Bundler.ui.info " * #{entry[:name]} #{entry[:version]} (available in #{days} #{days == 1 ? "day" : "days"}), resolved #{entry[:resolved]} instead"
31
+ end
32
+ end
33
+
23
34
  def self.output_fund_metadata_summary
24
35
  return if Bundler.settings["ignore_funding_requests"]
25
36
  definition = Bundler.definition
@@ -64,6 +64,7 @@ module Bundler
64
64
  end
65
65
 
66
66
  Bundler::CLI::Common.output_post_install_messages installer.post_install_messages
67
+ Bundler::CLI::Common.output_cooldown_skipped_summary(definition)
67
68
 
68
69
  if CLI::Common.clean_after_install?
69
70
  require_relative "clean"
@@ -13,10 +13,10 @@ module Bundler
13
13
  https://github.com/ruby/rubygems/blob/master/doc/bundler/TROUBLESHOOTING.md
14
14
 
15
15
  2. Instructions for common Bundler uses can be found on the documentation
16
- site: https://bundler.io/
16
+ site: https://guides.rubygems.org/
17
17
 
18
18
  3. Information about each Bundler command can be found in the Bundler
19
- man pages: https://bundler.io/man/bundle.1.html
19
+ man pages: https://guides.rubygems.org/command-reference/bundle/
20
20
 
21
21
  Hopefully the troubleshooting steps above resolved your problem! If things
22
22
  still aren't working the way you expect them to, please let us know so
@@ -16,6 +16,9 @@ module Bundler
16
16
 
17
17
  check_for_conflicting_options
18
18
 
19
+ Bundler::CLI::Common.validate_cooldown!(options[:cooldown])
20
+ Bundler.settings.set_command_option_if_given :cooldown, options[:cooldown]
21
+
19
22
  print = options[:print]
20
23
  previous_output_stream = Bundler.ui.output_stream
21
24
  Bundler.ui.output_stream = :stderr if print
@@ -23,6 +26,9 @@ module Bundler
23
26
  Bundler::Fetcher.disable_endpoint = options["full-index"]
24
27
 
25
28
  update = options[:update]
29
+ # --update is repeatable, so it parses as an array with one entry per
30
+ # occurrence, where a bare `--update` produces a `true` entry
31
+ update = update.include?(true) ? true : update.flatten if update.is_a?(Array)
26
32
  conservative = options[:conservative]
27
33
  bundler = options[:bundler]
28
34
 
@@ -41,12 +47,12 @@ module Bundler
41
47
 
42
48
  Bundler::CLI::Common.configure_gem_version_promoter(definition, options) if options[:update]
43
49
 
44
- options["remove-platform"].each do |platform_string|
50
+ options["remove-platform"].flatten.each do |platform_string|
45
51
  platform = Gem::Platform.new(platform_string)
46
52
  definition.remove_platform(platform)
47
53
  end
48
54
 
49
- options["add-platform"].each do |platform_string|
55
+ options["add-platform"].flatten.each do |platform_string|
50
56
  platform = Gem::Platform.new(platform_string)
51
57
  if platform.to_s == "unknown"
52
58
  Bundler.ui.error "The platform `#{platform_string}` is unknown to RubyGems and can't be added to the lockfile."
@@ -74,6 +80,8 @@ module Bundler
74
80
  puts "Writing lockfile to #{file}"
75
81
  definition.write_lock(file, false)
76
82
  end
83
+
84
+ Bundler::CLI::Common.output_cooldown_skipped_summary(definition)
77
85
  end
78
86
 
79
87
  Bundler.ui.output_stream = previous_output_stream
@@ -118,6 +118,7 @@ module Bundler
118
118
  Bundler.ui.confirm "Bundle updated!"
119
119
  Bundler::CLI::Common.output_without_groups_message(:update)
120
120
  Bundler::CLI::Common.output_post_install_messages installer.post_install_messages
121
+ Bundler::CLI::Common.output_cooldown_skipped_summary
121
122
 
122
123
  Bundler::CLI::Common.output_fund_metadata_summary
123
124
  end
@@ -461,6 +461,7 @@ module Bundler
461
461
  method_option "path", type: :string, banner: "Specify a different path than the system default, namely, $BUNDLE_PATH or $GEM_HOME (removed)."
462
462
  method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
463
463
  method_option "frozen", type: :boolean, banner: "Do not allow the Gemfile.lock to be updated after this bundle cache operation's install (removed)"
464
+ method_option "cooldown", type: :numeric, banner: "Only consider gem versions published at least N days ago. Use 0 to disable."
464
465
  long_desc <<-D
465
466
  The cache command will copy the .gem files for every gem in the bundle into the
466
467
  directory ./vendor/cache. If you then check that directory into your source
@@ -625,15 +626,15 @@ module Bundler
625
626
  end
626
627
 
627
628
  desc "lock", "Creates a lockfile without installing"
628
- method_option "update", type: :array, lazy_default: true, banner: "ignore the existing lockfile, update all gems by default, or update list of given gems"
629
+ method_option "update", type: :array, lazy_default: true, repeatable: true, banner: "ignore the existing lockfile, update all gems by default, or update list of given gems"
629
630
  method_option "local", type: :boolean, default: false, banner: "do not attempt to fetch remote gemspecs and use the local gem cache only"
630
631
  method_option "print", type: :boolean, default: false, banner: "print the lockfile to STDOUT instead of writing to the file system"
631
632
  method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
632
633
  method_option "lockfile", type: :string, default: nil, banner: "the path the lockfile should be written to"
633
634
  method_option "full-index", type: :boolean, default: false, banner: "Fall back to using the single-file index of all gems"
634
635
  method_option "add-checksums", type: :boolean, default: false, banner: "Adds checksums to the lockfile"
635
- method_option "add-platform", type: :array, default: [], banner: "Add a new platform to the lockfile"
636
- method_option "remove-platform", type: :array, default: [], banner: "Remove a platform from the lockfile"
636
+ method_option "add-platform", type: :array, default: [], repeatable: true, banner: "Add a new platform to the lockfile"
637
+ method_option "remove-platform", type: :array, default: [], repeatable: true, banner: "Remove a platform from the lockfile"
637
638
  method_option "normalize-platforms", type: :boolean, default: false, banner: "Normalize lockfile platforms"
638
639
  method_option "patch", type: :boolean, banner: "If updating, prefer updating only to next patch version"
639
640
  method_option "minor", type: :boolean, banner: "If updating, prefer updating only to next minor version"
@@ -642,6 +643,7 @@ module Bundler
642
643
  method_option "strict", type: :boolean, banner: "If updating, do not allow any gem to be updated past latest --patch | --minor | --major"
643
644
  method_option "conservative", type: :boolean, banner: "If updating, use bundle install conservative update behavior and do not allow shared dependencies to be updated"
644
645
  method_option "bundler", type: :string, lazy_default: "> 0.a", banner: "Update the locked version of bundler"
646
+ method_option "cooldown", type: :numeric, banner: "Only consider gem versions published at least N days ago. Use 0 to disable."
645
647
  def lock
646
648
  require_relative "cli/lock"
647
649
  Lock.new(options).run
@@ -50,6 +50,7 @@ module Bundler
50
50
 
51
51
  def info_path(name)
52
52
  name = name.to_s
53
+ validate_name!(name)
53
54
  # TODO: converge this into the info_root by hashing all filenames like info_etag_path
54
55
  if /[^a-z0-9_-]/.match?(name)
55
56
  name += "-#{SharedHelpers.digest(:MD5).hexdigest(name).downcase}"
@@ -61,9 +62,19 @@ module Bundler
61
62
 
62
63
  def info_etag_path(name)
63
64
  name = name.to_s
65
+ validate_name!(name)
64
66
  @info_etag_root.join("#{name}-#{SharedHelpers.digest(:MD5).hexdigest(name).downcase}")
65
67
  end
66
68
 
69
+ # Gem names come from the remote index and are not otherwise
70
+ # validated, so refuse anything that would escape the cache
71
+ # directory when used as a path component.
72
+ def validate_name!(name)
73
+ return if File.basename(name) == name
74
+
75
+ raise SecurityError, "malformed gem name: #{name.inspect}"
76
+ end
77
+
67
78
  def mkdir(name)
68
79
  directory.join(name).tap do |dir|
69
80
  SharedHelpers.filesystem_access(dir) do
@@ -366,6 +366,12 @@ module Bundler
366
366
  sources.git_sources.filter_map {|s| File.realpath(s.path) if File.exist?(s.path) }
367
367
  end
368
368
 
369
+ # Versions excluded by cooldown during the last resolution, one entry per
370
+ # gem with the newest skipped version. Empty when no resolution ran.
371
+ def cooldown_skipped
372
+ @cooldown_skipped || []
373
+ end
374
+
369
375
  def groups
370
376
  dependencies.flat_map(&:groups).uniq
371
377
  end
@@ -404,7 +410,7 @@ module Bundler
404
410
  updating_major = locked_major < current_major
405
411
  end
406
412
 
407
- preserve_unknown_sections ||= !updating_major && (Bundler.frozen_bundle? || !(unlocking? || @unlocking_bundler))
413
+ preserve_unknown_sections ||= Bundler.frozen_bundle? || (!updating_major && !(unlocking? || @unlocking_bundler))
408
414
 
409
415
  if File.exist?(file) && lockfiles_equal?(@lockfile_contents, contents, preserve_unknown_sections)
410
416
  return if Bundler.frozen_bundle?
@@ -413,8 +419,10 @@ module Bundler
413
419
  end
414
420
 
415
421
  if Bundler.frozen_bundle?
416
- Bundler.ui.error "Cannot write a changed lockfile while frozen."
417
- return
422
+ msg = lockfile_changes_summary("frozen mode is set") ||
423
+ "Your lockfile needs to be updated, but it can't be because frozen mode is set.\n\n" \
424
+ "Run `bundle install` elsewhere and add the updated #{SharedHelpers.relative_lockfile_path} to version control."
425
+ raise ProductionError, msg
418
426
  end
419
427
 
420
428
  # Convert to \r\n if the existing lock has them, i.e., Windows with
@@ -770,6 +778,8 @@ module Bundler
770
778
 
771
779
  result = SpecSet.new(resolver.start)
772
780
 
781
+ @cooldown_skipped = resolver.cooldown_skipped
782
+
773
783
  @resolved_bundler_version = result.find {|spec| spec.name == "bundler" }&.version
774
784
 
775
785
  @new_platforms.each do |platform|
@@ -50,6 +50,19 @@ module Bundler
50
50
  end
51
51
  end
52
52
 
53
+ # `require_paths` is overridden above, but `full_require_paths` (and so
54
+ # `load_paths`) is computed from `raw_require_paths`, which would otherwise
55
+ # report the default `lib` for every gem
56
+ def raw_require_paths
57
+ if @remote_specification
58
+ @remote_specification.raw_require_paths
59
+ elsif _local_specification
60
+ _local_specification.raw_require_paths
61
+ else
62
+ super
63
+ end
64
+ end
65
+
53
66
  # needed for inline
54
67
  def load_paths
55
68
  # remote specs aren't installed, and can't have load_paths
@@ -153,8 +166,13 @@ module Bundler
153
166
  next unless v
154
167
  case k.to_s
155
168
  when "checksum"
169
+ # Some registries send empty checksum values, treat them as if the
170
+ # checksum was not included at all
171
+ checksum = v.last
172
+ next unless checksum
173
+
156
174
  begin
157
- @checksum = Checksum.from_api(v.last, @spec_fetcher.uri)
175
+ @checksum = Checksum.from_api(checksum, @spec_fetcher.uri)
158
176
  rescue ArgumentError => e
159
177
  raise ArgumentError, "Invalid checksum for #{full_name}: #{e.message}"
160
178
  end
@@ -215,7 +215,13 @@ module Bundler
215
215
  agent << " #{ruby.engine}/#{ruby.versions_string(engine_version)}"
216
216
  end
217
217
 
218
- agent << " options/#{Bundler.settings.all.join(",")}"
218
+ # Some settings keys embed a URI (e.g. `mirror.<uri>`) whose userinfo can
219
+ # carry credentials. Strip the userinfo before advertising the setting
220
+ # names so we don't leak secrets to every gem source we talk to.
221
+ options = Bundler.settings.all.map do |key|
222
+ key.include?("://") ? key.gsub(%r{//[^/@]+@}, "//") : key
223
+ end
224
+ agent << " options/#{options.join(",")}"
219
225
 
220
226
  agent << " ci/#{cis.join(",")}" if cis.any?
221
227
 
@@ -255,7 +255,15 @@ module Bundler
255
255
 
256
256
  def require_tree_for_spec(spec)
257
257
  tree = @spec_set.what_required(spec)
258
- t = String.new("In #{File.basename(SharedHelpers.default_gemfile)}:\n")
258
+ gemfile_name = begin
259
+ File.basename(SharedHelpers.default_gemfile)
260
+ rescue GemfileNotFound
261
+ # This runs while reporting an install error. When no Gemfile can be
262
+ # located (e.g. Bundler used as a library), raising here would mask
263
+ # the original error, so fall back to a generic header instead.
264
+ "Gemfile"
265
+ end
266
+ t = String.new("In #{gemfile_name}:\n")
259
267
  tree.each_with_index do |s, depth|
260
268
  t << " " * depth.succ << s.name
261
269
  unless tree.last == s
@@ -83,6 +83,12 @@ module Bundler
83
83
  install(options)
84
84
 
85
85
  Gem::Specification.reset # invalidate gem specification cache so that installed gems are immediately available
86
+ # Drop the source caches too, since releasing resolution memory dropped
87
+ # the source indexes. A resolution happening after this point would
88
+ # otherwise rebuild them around a snapshot of installed gems taken
89
+ # before the install, and materialize against remote specs that don't
90
+ # know where the gems they stand for ended up.
91
+ @definition.sources.clear_cache
86
92
 
87
93
  lock
88
94
  Standalone.new(options[:standalone], @definition).generate if options[:standalone]
@@ -103,6 +103,11 @@ module Bundler
103
103
  end
104
104
 
105
105
  def bundler_checksum
106
+ # In frozen mode the lockfile can't change, so reproduce whatever bundler
107
+ # entry is already locked instead of recording one for the running bundler
108
+ # version, which may legitimately differ from the locked one.
109
+ return locked_bundler_checksum if Bundler.frozen_bundle?
110
+
106
111
  # `.dev` versions and `SKIP_BUNDLER_CHECKSUM` are deliberate opt-outs (used
107
112
  # by Bundler/RubyGems' own development and release tasks): never record a
108
113
  # checksum for Bundler itself in those cases.
@@ -138,5 +143,16 @@ module Bundler
138
143
 
139
144
  locked_gems.bundler_version != definition.bundler_version_to_lock
140
145
  end
146
+
147
+ def locked_bundler_checksum
148
+ locked_version = definition.locked_gems&.bundler_version
149
+ return [] unless locked_version
150
+
151
+ metadata_source = definition.sources.metadata_source
152
+ locked_spec = LazySpecification.new("bundler", locked_version, Gem::Platform::RUBY, metadata_source)
153
+ return [] if metadata_source.checksum_store.missing?(locked_spec)
154
+
155
+ [metadata_source.checksum_store.to_lock(locked_spec)]
156
+ end
141
157
  end
142
158
  end
@@ -76,4 +76,4 @@ You can assign the gem to more than one group\.
76
76
  \fBbundle add rails \-\-group "development, test"\fR
77
77
  .IP "" 0
78
78
  .SH "SEE ALSO"
79
- Gemfile(5) \fIhttps://bundler\.io/man/gemfile\.5\.html\fR, bundle\-remove(1) \fIbundle\-remove\.1\.html\fR
79
+ Gemfile(5) \fIhttps://guides\.rubygems\.org/gemfile/\fR, bundle\-remove(1) \fIbundle\-remove\.1\.html\fR
@@ -88,5 +88,5 @@ Adds the named gem to the [`Gemfile(5)`][Gemfile(5)] and run `bundle install`.
88
88
 
89
89
  ## SEE ALSO
90
90
 
91
- [Gemfile(5)](https://bundler.io/man/gemfile.5.html),
91
+ [Gemfile(5)](https://guides.rubygems.org/gemfile/),
92
92
  [bundle-remove(1)](bundle-remove.1.html)
@@ -17,6 +17,9 @@ Include gems for all platforms present in the lockfile, not only the current one
17
17
  \fB\-\-cache\-path=CACHE\-PATH\fR
18
18
  Specify a different cache path than the default (vendor/cache)\.
19
19
  .TP
20
+ \fB\-\-cooldown=<number>\fR
21
+ Only consider gem versions published at least \fInumber\fR days ago when resolving before caching\. Pass \fB0\fR to disable cooldown for this run, overriding any per\-source or global configuration\. See \fBcooldown\fR in bundle\-config(1)\.
22
+ .TP
20
23
  \fB\-\-gemfile=GEMFILE\fR
21
24
  Use the specified gemfile instead of Gemfile\.
22
25
  .TP
@@ -21,6 +21,12 @@ use the gems in the cache in preference to the ones on `rubygems.org`.
21
21
  * `--cache-path=CACHE-PATH`:
22
22
  Specify a different cache path than the default (vendor/cache).
23
23
 
24
+ * `--cooldown=<number>`:
25
+ Only consider gem versions published at least <number> days ago when
26
+ resolving before caching. Pass `0` to disable cooldown for this run,
27
+ overriding any per-source or global configuration. See `cooldown` in
28
+ bundle-config(1).
29
+
24
30
  * `--gemfile=GEMFILE`:
25
31
  Use the specified gemfile instead of Gemfile.
26
32
 
@@ -82,7 +82,7 @@ The following is a list of all configuration keys and their purpose\. You can le
82
82
  .IP "\(bu" 4
83
83
  \fBcache_path\fR (\fBBUNDLE_CACHE_PATH\fR): The directory that bundler will place cached gems in when running \fBbundle package\fR, and that bundler will look in when installing gems\. Defaults to \fBvendor/cache\fR\.
84
84
  .IP "\(bu" 4
85
- \fBclean\fR (\fBBUNDLE_CLEAN\fR): Whether Bundler should run \fBbundle clean\fR automatically after \fBbundle install\fR\. Defaults to \fBtrue\fR in Bundler 4, as long as \fBpath\fR is not explicitly configured\.
85
+ \fBclean\fR (\fBBUNDLE_CLEAN\fR): Whether Bundler should run \fBbundle clean\fR automatically after \fBbundle install\fR\. Defaults to \fBtrue\fR in Bundler 5, as long as \fBpath\fR is not explicitly configured\.
86
86
  .IP "\(bu" 4
87
87
  \fBconsole\fR (\fBBUNDLE_CONSOLE\fR): The console that \fBbundle console\fR starts\. Defaults to \fBirb\fR\.
88
88
  .IP "\(bu" 4
@@ -139,7 +139,7 @@ Cooldown filtering depends on the gem server providing a per\-version \fBcreated
139
139
  .IP "\(bu" 4
140
140
  \fBlockfile\fR (\fBBUNDLE_LOCKFILE\fR): The path to the lockfile that bundler should use\. By default, Bundler adds \fB\.lock\fR to the end of the \fBgemfile\fR entry\. Can be set to \fBfalse\fR in the Gemfile to disable lockfile creation entirely (see gemfile(5))\.
141
141
  .IP "\(bu" 4
142
- \fBlockfile_checksums\fR (\fBBUNDLE_LOCKFILE_CHECKSUMS\fR): Whether Bundler should include a checksums section in new lockfiles, to protect from compromised gem sources\. Defaults to true\.
142
+ \fBlockfile_checksums\fR (\fBBUNDLE_LOCKFILE_CHECKSUMS\fR): Whether Bundler should include a checksums section in new lockfiles, to protect from compromised gem sources\. Defaults to true\. Bundler's own checksum is only included when its \fB\.gem\fR file is cached, which may not be the case when Bundler is installed as a default gem\.
143
143
  .IP "\(bu" 4
144
144
  \fBno_install\fR (\fBBUNDLE_NO_INSTALL\fR): Whether \fBbundle package\fR should skip installing gems\.
145
145
  .IP "\(bu" 4
@@ -147,7 +147,7 @@ Cooldown filtering depends on the gem server providing a per\-version \fBcreated
147
147
  .IP "\(bu" 4
148
148
  \fBonly\fR (\fBBUNDLE_ONLY\fR): A space\-separated list of groups to install only gems of the specified groups\. Please check carefully if you want to install also gems without a group, because they get put inside \fBdefault\fR group\. For example \fBonly test:default\fR will install all gems specified in test group and without one\.
149
149
  .IP "\(bu" 4
150
- \fBpath\fR (\fBBUNDLE_PATH\fR): The location on disk where all gems in your bundle will be located regardless of \fB$GEM_HOME\fR or \fB$GEM_PATH\fR values\. Bundle gems not found in this location will be installed by \fBbundle install\fR\. When not set, Bundler install by default to a \fB\.bundle\fR directory relative to repository root in Bundler 4, and to the default system path (\fBGem\.dir\fR) before Bundler 4\. That means that before Bundler 4, Bundler shares this location with Rubygems, and \fBgem install \|\.\|\.\|\.\fR will have gems installed in the same location and therefore, gems installed without \fBpath\fR set will show up by calling \fBgem list\fR\. This will not be the case in Bundler 4\.
150
+ \fBpath\fR (\fBBUNDLE_PATH\fR): The location on disk where all gems in your bundle will be located regardless of \fB$GEM_HOME\fR or \fB$GEM_PATH\fR values\. Bundle gems not found in this location will be installed by \fBbundle install\fR\. When not set, Bundler install by default to a \fB\.bundle\fR directory relative to repository root in Bundler 5, and to the default system path (\fBGem\.dir\fR) before Bundler 5\. That means that before Bundler 5, Bundler shares this location with Rubygems, and \fBgem install \|\.\|\.\|\.\fR will have gems installed in the same location and therefore, gems installed without \fBpath\fR set will show up by calling \fBgem list\fR\. This will not be the case in Bundler 5\.
151
151
  .IP "\(bu" 4
152
152
  \fBpath\.system\fR (\fBBUNDLE_PATH__SYSTEM\fR): Whether Bundler will install gems into the default system path (\fBGem\.dir\fR)\.
153
153
  .IP "\(bu" 4
@@ -133,7 +133,7 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
133
133
  Defaults to `vendor/cache`.
134
134
  * `clean` (`BUNDLE_CLEAN`):
135
135
  Whether Bundler should run `bundle clean` automatically after
136
- `bundle install`. Defaults to `true` in Bundler 4, as long as `path` is not
136
+ `bundle install`. Defaults to `true` in Bundler 5, as long as `path` is not
137
137
  explicitly configured.
138
138
  * `console` (`BUNDLE_CONSOLE`):
139
139
  The console that `bundle console` starts. Defaults to `irb`.
@@ -230,6 +230,8 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
230
230
  Gemfile to disable lockfile creation entirely (see gemfile(5)).
231
231
  * `lockfile_checksums` (`BUNDLE_LOCKFILE_CHECKSUMS`):
232
232
  Whether Bundler should include a checksums section in new lockfiles, to protect from compromised gem sources. Defaults to true.
233
+ Bundler's own checksum is only included when its `.gem` file is cached, which
234
+ may not be the case when Bundler is installed as a default gem.
233
235
  * `no_install` (`BUNDLE_NO_INSTALL`):
234
236
  Whether `bundle package` should skip installing gems.
235
237
  * `no_prune` (`BUNDLE_NO_PRUNE`):
@@ -243,12 +245,12 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
243
245
  The location on disk where all gems in your bundle will be located regardless
244
246
  of `$GEM_HOME` or `$GEM_PATH` values. Bundle gems not found in this location
245
247
  will be installed by `bundle install`. When not set, Bundler install by
246
- default to a `.bundle` directory relative to repository root in Bundler 4,
247
- and to the default system path (`Gem.dir`) before Bundler 4. That means that
248
- before Bundler 4, Bundler shares this location with Rubygems, and `gem
248
+ default to a `.bundle` directory relative to repository root in Bundler 5,
249
+ and to the default system path (`Gem.dir`) before Bundler 5. That means that
250
+ before Bundler 5, Bundler shares this location with Rubygems, and `gem
249
251
  install ...` will have gems installed in the same location and therefore,
250
252
  gems installed without `path` set will show up by calling `gem list`. This
251
- will not be the case in Bundler 4.
253
+ will not be the case in Bundler 5.
252
254
  * `path.system` (`BUNDLE_PATH__SYSTEM`):
253
255
  Whether Bundler will install gems into the default system path (`Gem.dir`).
254
256
  * `plugins` (`BUNDLE_PLUGINS`):
@@ -8,7 +8,7 @@
8
8
  .SH "DESCRIPTION"
9
9
  Starts an interactive Ruby console session in the context of the current bundle\.
10
10
  .P
11
- If no \fBGROUP\fR is specified, all gems in the \fBdefault\fR group in the Gemfile(5) \fIhttps://bundler\.io/man/gemfile\.5\.html\fR are preliminarily loaded\.
11
+ If no \fBGROUP\fR is specified, all gems in the \fBdefault\fR group in the Gemfile(5) \fIhttps://guides\.rubygems\.org/gemfile/\fR are preliminarily loaded\.
12
12
  .P
13
13
  If \fBGROUP\fR is specified, all gems in the given group in the Gemfile in addition to the gems in \fBdefault\fR group are loaded\. Even if the given group does not exist in the Gemfile, IRB console starts without any warning or error\.
14
14
  .P
@@ -30,4 +30,4 @@ Resolving dependencies\|\.\|\.\|\.
30
30
  [1] pry(main)>
31
31
  .fi
32
32
  .SH "SEE ALSO"
33
- Gemfile(5) \fIhttps://bundler\.io/man/gemfile\.5\.html\fR
33
+ Gemfile(5) \fIhttps://guides\.rubygems\.org/gemfile/\fR
@@ -9,7 +9,7 @@ bundle-console(1) -- Open an IRB session with the bundle pre-loaded
9
9
 
10
10
  Starts an interactive Ruby console session in the context of the current bundle.
11
11
 
12
- If no `GROUP` is specified, all gems in the `default` group in the [Gemfile(5)](https://bundler.io/man/gemfile.5.html) are
12
+ If no `GROUP` is specified, all gems in the `default` group in the [Gemfile(5)](https://guides.rubygems.org/gemfile/) are
13
13
  preliminarily loaded.
14
14
 
15
15
  If `GROUP` is specified, all gems in the given group in the Gemfile in addition
@@ -36,4 +36,4 @@ the shell from the following:
36
36
 
37
37
  ## SEE ALSO
38
38
 
39
- [Gemfile(5)](https://bundler.io/man/gemfile.5.html)
39
+ [Gemfile(5)](https://guides.rubygems.org/gemfile/)
@@ -17,4 +17,4 @@ Use the specified name for the gemfile instead of \fBGemfile\fR
17
17
  .SH "FILES"
18
18
  Included in the default [\fBGemfile(5)\fR][Gemfile(5)] generated is the line \fB# frozen_string_literal: true\fR\. This is a magic comment supported for the first time in Ruby 2\.3\. The presence of this line results in all string literals in the file being implicitly frozen\.
19
19
  .SH "SEE ALSO"
20
- Gemfile(5) \fIhttps://bundler\.io/man/gemfile\.5\.html\fR
20
+ Gemfile(5) \fIhttps://guides\.rubygems\.org/gemfile/\fR
@@ -29,4 +29,4 @@ results in all string literals in the file being implicitly frozen.
29
29
 
30
30
  ## SEE ALSO
31
31
 
32
- [Gemfile(5)](https://bundler.io/man/gemfile.5.html)
32
+ [Gemfile(5)](https://guides.rubygems.org/gemfile/)
@@ -4,7 +4,7 @@
4
4
  .SH "NAME"
5
5
  \fBbundle\-lock\fR \- Creates / Updates a lockfile without installing
6
6
  .SH "SYNOPSIS"
7
- \fBbundle lock\fR [\-\-update] [\-\-bundler[=BUNDLER]] [\-\-local] [\-\-print] [\-\-lockfile=PATH] [\-\-full\-index] [\-\-gemfile=GEMFILE] [\-\-add\-checksums] [\-\-add\-platform] [\-\-remove\-platform] [\-\-normalize\-platforms] [\-\-patch] [\-\-minor] [\-\-major] [\-\-pre] [\-\-strict] [\-\-conservative]
7
+ \fBbundle lock\fR [\-\-update] [\-\-bundler[=BUNDLER]] [\-\-local] [\-\-print] [\-\-lockfile=PATH] [\-\-full\-index] [\-\-gemfile=GEMFILE] [\-\-add\-checksums] [\-\-add\-platform] [\-\-remove\-platform] [\-\-normalize\-platforms] [\-\-patch] [\-\-minor] [\-\-major] [\-\-pre] [\-\-strict] [\-\-conservative] [\-\-cooldown=NUMBER]
8
8
  .SH "DESCRIPTION"
9
9
  Lock the gems specified in Gemfile\.
10
10
  .SH "OPTIONS"
@@ -59,6 +59,9 @@ If updating, do not allow any gem to be updated past latest \-\-patch | \-\-mino
59
59
  .TP
60
60
  \fB\-\-conservative\fR
61
61
  If updating, use bundle install conservative update behavior and do not allow shared dependencies to be updated\.
62
+ .TP
63
+ \fB\-\-cooldown=<number>\fR
64
+ Only consider gem versions published at least \fInumber\fR days ago when resolving\. Pass \fB0\fR to disable cooldown for this run, overriding any per\-source or global configuration\. See \fBcooldown\fR in bundle\-config(1)\.
62
65
  .SH "UPDATING ALL GEMS"
63
66
  If you run \fBbundle lock\fR with \fB\-\-update\fR option without list of gems, bundler will ignore any previously installed gems and resolve all dependencies again based on the latest versions of all gems available in the sources\.
64
67
  .SH "UPDATING A LIST OF GEMS"