bundler 4.0.9 → 4.0.10

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff315eb3319300026b3ab3422e82399e6b0ce63ef727f94e125a226623101c27
4
- data.tar.gz: 00bb903a5564f2565ebcbc350837283f724d1ef42d4f586b37a972fe568015da
3
+ metadata.gz: 54c40beb5b2e8ef4f0a575b9d408fe571ef2b1089099fc09d4b46a6adc4307ea
4
+ data.tar.gz: 591339a1a0a4512ae8c386c24b98f09ca48ed571a011141dee4874ead6555a2e
5
5
  SHA512:
6
- metadata.gz: c6a4c93541bd76ee07370d4995487fe663f10d8aa021f1d9104d6adfeb373a36bbc47fd3498094da011c561702d7a84ebb1854c80c99176578b0fbc666e2dba2
7
- data.tar.gz: 29943339931f1e5b37c836346171c51f2a00a2cadbd7d7b5f30da5dd5bacb1f1024b7601ded1e1d895a3da4e11cf1d6ea35768a7196b351e237179d63759cd13
6
+ metadata.gz: 15c2b8ba181ff0f418ce40b488b3d148e661992058ed0f1af8a58c3adb774b00fc39e29211c0abd22f51b85098840514fbf35dbb8c5d0c0773f0e4cf22facb8c
7
+ data.tar.gz: bf33570321010bd7e2283384c1331ee13bc1f3176de52c16c34a2e56b461c625fc955dfef9ba0d9b157ff0f11591892832eea06621a88facd7e187e85bd8c468
data/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.0.10 / 2026-04-08
4
+
5
+ ### Enhancements:
6
+
7
+ * Ignore warnings with spec different platforms. Pull request [#8508](https://github.com/ruby/rubygems/pull/8508) by hsbt
8
+ * Improve error message when current platform is not in lockfile. Pull request [#9439](https://github.com/ruby/rubygems/pull/9439) by 55728
9
+ * Cache package version selection. Pull request [#9410](https://github.com/ruby/rubygems/pull/9410) by Edouard-chin
10
+ * Check happy path first when comparing gem version. Pull request [#9417](https://github.com/ruby/rubygems/pull/9417) by Edouard-chin
11
+ * [feature] default_cli_command for config what command bundler runs when no specific command is provided. Pull request [#8886](https://github.com/ruby/rubygems/pull/8886) by jonbarlo
12
+ * Introduce a fast path for comparing Gem::Version. Pull request [#9414](https://github.com/ruby/rubygems/pull/9414) by Edouard-chin
13
+
14
+ ### Bug fixes:
15
+
16
+ * Restore rb_sys dependency for Rust. Pull request [#9416](https://github.com/ruby/rubygems/pull/9416) by bangseongbeom
17
+
3
18
  ## 4.0.9 / 2026-03-25
4
19
 
5
20
  ### Enhancements:
@@ -5,7 +5,7 @@ module Bundler
5
5
  module BuildMetadata
6
6
  # begin ivars
7
7
  @built_at = nil
8
- @git_commit_sha = "3ce4a32411".freeze
8
+ @git_commit_sha = "1c1d885018".freeze
9
9
  # end ivars
10
10
 
11
11
  # A hash representation of the build metadata.
@@ -80,11 +80,10 @@ module Bundler
80
80
  def conservative_version(spec)
81
81
  version = spec.version
82
82
  return ">= 0" if version.nil?
83
- segments = version.segments
84
83
  seg_end_index = version >= Gem::Version.new("1.0") ? 1 : 2
85
84
 
86
85
  prerelease_suffix = version.to_s.delete_prefix(version.release.to_s) if version.prerelease?
87
- "#{version_prefix}#{segments[0..seg_end_index].join(".")}#{prerelease_suffix}"
86
+ "#{version_prefix}#{version.segments[0..seg_end_index].join(".")}#{prerelease_suffix}"
88
87
  end
89
88
 
90
89
  def version_prefix
@@ -5,6 +5,7 @@ module Bundler
5
5
  class Strategy
6
6
  def initialize(source)
7
7
  @source = source
8
+ @package_priority_cache = {}
8
9
  end
9
10
 
10
11
  def next_package_and_version(unsatisfied)
@@ -17,10 +18,12 @@ module Bundler
17
18
 
18
19
  def next_term_to_try_from(unsatisfied)
19
20
  unsatisfied.min_by do |package, range|
20
- matching_versions = @source.versions_for(package, range)
21
- higher_versions = @source.versions_for(package, range.upper_invert)
21
+ @package_priority_cache[[package, range]] ||= begin
22
+ matching_versions = @source.versions_for(package, range)
23
+ higher_versions = @source.versions_for(package, range.upper_invert)
22
24
 
23
- [matching_versions.count <= 1 ? 0 : 1, higher_versions.count]
25
+ [matching_versions.count <= 1 ? 0 : 1, higher_versions.count]
26
+ end
24
27
  end
25
28
  end
26
29
 
@@ -353,9 +353,27 @@ module Bundler
353
353
  message << "\n#{other_specs_matching_message(specs, matching_part)}"
354
354
  end
355
355
 
356
+ if specs_matching_requirement.any? && (hint = platform_mismatch_hint)
357
+ message << "\n\n#{hint}"
358
+ end
359
+
356
360
  raise GemNotFound, message
357
361
  end
358
362
 
363
+ def platform_mismatch_hint
364
+ locked_platforms = Bundler.locked_gems&.platforms
365
+ return unless locked_platforms
366
+
367
+ local_platform = Bundler.local_platform
368
+ return if locked_platforms.include?(local_platform)
369
+ return if locked_platforms.any? {|p| p == Gem::Platform::RUBY }
370
+
371
+ "Your current platform (#{local_platform}) is not included in the lockfile's platforms (#{locked_platforms.join(", ")}). " \
372
+ "Add the current platform to the lockfile with\n`bundle lock --add-platform #{local_platform}` and try again."
373
+ rescue GemfileNotFound
374
+ nil
375
+ end
376
+
359
377
  def filtered_versions_for(package)
360
378
  @gem_version_promoter.filter_versions(package, @all_versions[package])
361
379
  end
@@ -74,6 +74,13 @@ module Bundler
74
74
  fail!(key, value, "`#{other_key}` is current set to #{other_setting.inspect}", "the `#{conflicting.join("`, `")}` groups conflict")
75
75
  end
76
76
  end
77
+
78
+ rule %w[default_cli_command], "default_cli_command must be either 'install' or 'cli_help'" do |key, value, _settings|
79
+ valid_values = %w[install cli_help]
80
+ if !value.nil? && !valid_values.include?(value.to_s)
81
+ fail!(key, value, "must be one of: #{valid_values.join(", ")}")
82
+ end
83
+ end
77
84
  end
78
85
  end
79
86
  end
@@ -59,6 +59,7 @@ module Bundler
59
59
  bin
60
60
  cache_path
61
61
  console
62
+ default_cli_command
62
63
  gem.ci
63
64
  gem.github_username
64
65
  gem.linter
@@ -52,6 +52,7 @@ module Bundler
52
52
 
53
53
  # This is defined directly to avoid having to loading the full spec
54
54
  def missing_extensions?
55
+ return false if RUBY_ENGINE == "jruby"
55
56
  return false if default_gem?
56
57
  return false if extensions.empty?
57
58
  return false if File.exist? gem_build_complete_path
@@ -40,6 +40,9 @@ Gem::Specification.new do |spec|
40
40
 
41
41
  # Uncomment to register a new dependency of your gem
42
42
  # spec.add_dependency "example-gem", "~> 1.0"
43
+ <%- if config[:ext] == 'rust' -%>
44
+ spec.add_dependency "rb_sys", "~> 0.9.91"
45
+ <%- end -%>
43
46
  <%- if config[:ext] == 'go' -%>
44
47
  spec.add_dependency "go_gem", "~> 0.2"
45
48
  <%- end -%>
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "4.0.9".freeze
4
+ VERSION = "4.0.10".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= gem_version.segments.first
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: 4.0.9
4
+ version: 4.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Arko