bundler 2.3.16 → 2.3.17

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: '0194bb060d38ce7786c704aca693890461b4866ee647d6931a8e3e8f738f4ad6'
4
- data.tar.gz: d6e46c6028248ad29a24bfccd9df89facbcd57186e84be8499ec903f4989b88e
3
+ metadata.gz: 364d4bc2c2c1f342aa034417b9e30074317878931bf34e90ddf6c42d3ae539c2
4
+ data.tar.gz: dad782afd5246e703b67d004c7282a89132f0ebe699d8e8306387fb8db179193
5
5
  SHA512:
6
- metadata.gz: 9bbc74e0583c0117895f09cc1da2ae5dc9592b09b52f70f70c8efba2743bec7449230b9fc8d7210725c804bb761f98bd9a0ec8a8e417bfc2b0573154ffaacab7
7
- data.tar.gz: a27eea8f0ebceb3d0e9e8b413d2c50da519c36e565e08c26f0d22f6298f75515f0d11094da6c510b74805ceae2e18e25cd61eacd40e328b565878f4ad2c66a41
6
+ metadata.gz: 463cc7534f4164ae4d2e4c67d1ed57dcc9a40494c496f0b06e11ac8f2b3599ea0dbc74be8772a98abb2d09c119db2da8f1d85cde6bafe83319051de3e24a46f2
7
+ data.tar.gz: 61b997e77634dc3a7d812adb805f899bb8bbae48bd25aad2884906c818d21853e76fd0db8bfbd95ee79689c25567e346e9c468fbe1321768c2614518f0e78356
data/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ # 2.3.17 (June 29, 2022)
2
+
3
+ ## Enhancements:
4
+
5
+ - Add support for platform `:x64_mingw` to correctly lookup "x64-mingw-ucrt" [#5649](https://github.com/rubygems/rubygems/pull/5649)
6
+ - Fix some errors being printed twice in `--verbose` mode [#5654](https://github.com/rubygems/rubygems/pull/5654)
7
+ - Fix extension paths in generated standalone script [#5632](https://github.com/rubygems/rubygems/pull/5632)
8
+
9
+ ## Bug fixes:
10
+
11
+ - Raise if ruby platform is forced and there are no ruby variants [#5495](https://github.com/rubygems/rubygems/pull/5495)
12
+ - Fix `bundle package --no-install` no longer skipping install [#5639](https://github.com/rubygems/rubygems/pull/5639)
13
+
14
+ ## Performance:
15
+
16
+ - Improve performance of `Bundler::SpecSet#for` by using hash lookup of handled deps [#5537](https://github.com/rubygems/rubygems/pull/5537)
17
+
18
+ ## Documentation:
19
+
20
+ - Fix formatting issue in `bundle add` man page [#5642](https://github.com/rubygems/rubygems/pull/5642)
21
+
1
22
  # 2.3.16 (June 15, 2022)
2
23
 
3
24
  ## Performance:
@@ -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 = "2022-06-15".freeze
8
- @git_commit_sha = "324ee6e542".freeze
7
+ @built_at = "2022-06-29".freeze
8
+ @git_commit_sha = "539b20c172".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -14,7 +14,7 @@ module Bundler
14
14
  Bundler.settings.set_command_option_if_given :cache_path, options["cache-path"]
15
15
 
16
16
  setup_cache_all
17
- install unless Bundler.settings[:no_install]
17
+ install
18
18
 
19
19
  # TODO: move cache contents here now that all bundles are locked
20
20
  custom_path = Bundler.settings[:path] if options[:path]
@@ -161,6 +161,8 @@ module Bundler
161
161
 
162
162
  Bundler.settings.set_command_option_if_given :no_prune, options["no-prune"]
163
163
 
164
+ Bundler.settings.set_command_option_if_given :no_install, options["no-install"]
165
+
164
166
  Bundler.settings.set_command_option_if_given :clean, options["clean"]
165
167
 
166
168
  normalize_groups if options[:without] || options[:with]
data/lib/bundler/cli.rb CHANGED
@@ -251,7 +251,9 @@ module Bundler
251
251
  remembered_negative_flag_deprecation("no-deployment")
252
252
 
253
253
  require_relative "cli/install"
254
- Install.new(options.dup).run
254
+ Bundler.settings.temporary(:no_install => false) do
255
+ Install.new(options.dup).run
256
+ end
255
257
  end
256
258
 
257
259
  map aliases_for("install")
@@ -297,7 +299,9 @@ module Bundler
297
299
  def update(*gems)
298
300
  SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
299
301
  require_relative "cli/update"
300
- Update.new(options, gems).run
302
+ Bundler.settings.temporary(:no_install => false) do
303
+ Update.new(options, gems).run
304
+ end
301
305
  end
302
306
 
303
307
  desc "show GEM [OPTIONS]", "Shows all gems that are part of the bundle, or the path to a given gem"
@@ -78,7 +78,7 @@ module Bundler
78
78
  end
79
79
 
80
80
  def x64_mingw?
81
- Gem.win_platform? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mingw32" && Bundler.local_platform.cpu == "x64"
81
+ Gem.win_platform? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os.start_with?("mingw") && Bundler.local_platform.cpu == "x64"
82
82
  end
83
83
 
84
84
  (KNOWN_MINOR_VERSIONS + KNOWN_MAJOR_VERSIONS).each do |version|
@@ -122,7 +122,7 @@ module Bundler
122
122
  end
123
123
 
124
124
  def expanded_platforms
125
- @expanded_platforms ||= @platforms.map {|pl| PLATFORM_MAP[pl] }.compact.uniq
125
+ @expanded_platforms ||= @platforms.map {|pl| PLATFORM_MAP[pl] }.compact.flatten.uniq
126
126
  end
127
127
 
128
128
  def should_include?
@@ -29,8 +29,11 @@ module Bundler
29
29
  Bundler.ui.error error.message
30
30
  Bundler.ui.trace error.orig_exception
31
31
  when BundlerError
32
- Bundler.ui.error error.message, :wrap => true
33
- Bundler.ui.trace error
32
+ if Bundler.ui.debug?
33
+ Bundler.ui.trace error
34
+ else
35
+ Bundler.ui.error error.message, :wrap => true
36
+ end
34
37
  when Thor::Error
35
38
  Bundler.ui.error error.message
36
39
  when LoadError
@@ -10,6 +10,7 @@ module Bundler
10
10
  [Gem::Platform.new("universal-mingw32"), Gem::Platform.new("universal-mingw32")],
11
11
  [Gem::Platform.new("x64-mingw32"), Gem::Platform.new("x64-mingw32")],
12
12
  [Gem::Platform.new("x86_64-mingw32"), Gem::Platform.new("x64-mingw32")],
13
+ [Gem::Platform.new("x64-mingw-ucrt"), Gem::Platform.new("x64-mingw-ucrt")],
13
14
  [Gem::Platform.new("mingw32"), Gem::Platform.new("x86-mingw32")],
14
15
  ].freeze
15
16
 
data/lib/bundler/index.rb CHANGED
@@ -192,11 +192,7 @@ module Bundler
192
192
  specs += base if base
193
193
  found = specs.select do |spec|
194
194
  next true if spec.source.is_a?(Source::Gemspec)
195
- if base # allow all platforms when searching from a lockfile
196
- dependency.matches_spec?(spec)
197
- else
198
- dependency.matches_spec?(spec) && Gem::Platform.match_spec?(spec)
199
- end
195
+ dependency.matches_spec?(spec)
200
196
  end
201
197
 
202
198
  found
@@ -12,6 +12,7 @@ module Bundler
12
12
  end
13
13
  File.open File.join(bundler_path, "setup.rb"), "w" do |file|
14
14
  file.puts "require 'rbconfig'"
15
+ file.puts define_path_helpers
15
16
  file.puts reverse_rubygems_kernel_mixin
16
17
  paths.each do |path|
17
18
  if Pathname.new(path).absolute?
@@ -29,14 +30,20 @@ module Bundler
29
30
  @specs.map do |spec|
30
31
  next if spec.name == "bundler"
31
32
  Array(spec.require_paths).map do |path|
32
- gem_path(path, spec).sub(version_dir, '#{RUBY_ENGINE}/#{RbConfig::CONFIG["ruby_version"]}')
33
+ gem_path(path, spec).
34
+ sub(version_dir, '#{RUBY_ENGINE}/#{Gem.ruby_api_version}').
35
+ sub(extensions_dir, 'extensions/\k<platform>/#{Gem.extension_api_version}')
33
36
  # This is a static string intentionally. It's interpolated at a later time.
34
37
  end
35
38
  end.flatten.compact
36
39
  end
37
40
 
38
41
  def version_dir
39
- "#{RUBY_ENGINE}/#{RbConfig::CONFIG["ruby_version"]}"
42
+ "#{RUBY_ENGINE}/#{Gem.ruby_api_version}"
43
+ end
44
+
45
+ def extensions_dir
46
+ %r{extensions/(?<platform>[^/]+)/#{Regexp.escape(Gem.extension_api_version)}}
40
47
  end
41
48
 
42
49
  def bundler_path
@@ -55,6 +62,26 @@ module Bundler
55
62
  raise Gem::InvalidSpecificationException.new(error_message)
56
63
  end
57
64
 
65
+ def define_path_helpers
66
+ <<~'END'
67
+ unless defined?(Gem)
68
+ module Gem
69
+ def self.ruby_api_version
70
+ RbConfig::CONFIG["ruby_version"]
71
+ end
72
+
73
+ def self.extension_api_version
74
+ if 'no' == RbConfig::CONFIG['ENABLE_SHARED']
75
+ "#{ruby_api_version}-static"
76
+ else
77
+ ruby_api_version
78
+ end
79
+ end
80
+ end
81
+ end
82
+ END
83
+ end
84
+
58
85
  def reverse_rubygems_kernel_mixin
59
86
  <<~END
60
87
  kernel = (class << ::Kernel; self; end)
@@ -84,7 +84,7 @@ module Bundler
84
84
  else
85
85
  ruby_platform_materializes_to_ruby_platform? ? self : Dependency.new(name, version)
86
86
  end
87
- platform_object = Gem::Platform.new(platform)
87
+ platform_object = ruby_platform_materializes_to_ruby_platform? ? Gem::Platform.new(platform) : Gem::Platform.local
88
88
  candidates = source.specs.search(search_object)
89
89
  same_platform_candidates = candidates.select do |spec|
90
90
  MatchPlatform.platforms_match?(spec.platform, platform_object)
@@ -152,7 +152,7 @@ module Bundler
152
152
  # explicitly add a more specific platform.
153
153
  #
154
154
  def ruby_platform_materializes_to_ruby_platform?
155
- !Bundler.most_specific_locked_platform?(Gem::Platform::RUBY) || Bundler.settings[:force_ruby_platform]
155
+ !Bundler.most_specific_locked_platform?(generic_local_platform) || Bundler.settings[:force_ruby_platform]
156
156
  end
157
157
  end
158
158
  end
@@ -41,7 +41,7 @@ Specify version requirements(s) for the added gem\.
41
41
  Specify the group(s) for the added gem\. Multiple groups should be separated by commas\.
42
42
  .
43
43
  .TP
44
- \fB\-\-source\fR, , \fB\-s\fR
44
+ \fB\-\-source\fR, \fB\-s\fR
45
45
  Specify the source for the added gem\.
46
46
  .
47
47
  .TP
@@ -27,7 +27,7 @@ bundle add rails --group "development, test"
27
27
  * `--group`, `-g`:
28
28
  Specify the group(s) for the added gem. Multiple groups should be separated by commas.
29
29
 
30
- * `--source`, , `-s`:
30
+ * `--source`, `-s`:
31
31
  Specify the source for the added gem.
32
32
 
33
33
  * `--require`, `-r`:
@@ -15,7 +15,6 @@ module Bundler
15
15
  return true if Gem::Platform::RUBY == gemspec_platform
16
16
  return true if local_platform == gemspec_platform
17
17
  gemspec_platform = Gem::Platform.new(gemspec_platform)
18
- return true if GemHelpers.generic(gemspec_platform) === local_platform
19
18
  return true if gemspec_platform === local_platform
20
19
 
21
20
  false
@@ -284,7 +284,7 @@ module Bundler
284
284
  if specs_matching_requirement.any?
285
285
  specs = specs_matching_requirement
286
286
  matching_part = requirement_label
287
- requirement_label = "#{requirement_label} #{requirement.__platform}"
287
+ requirement_label = "#{requirement_label}' with platform '#{requirement.__platform}"
288
288
  end
289
289
 
290
290
  message = String.new("Could not find gem '#{requirement_label}'#{extra_message} in #{source}#{cache_message}.\n")
@@ -216,11 +216,12 @@ module Gem
216
216
  require "rubygems/platform"
217
217
 
218
218
  class Platform
219
- JAVA = Gem::Platform.new("java") unless defined?(JAVA)
220
- MSWIN = Gem::Platform.new("mswin32") unless defined?(MSWIN)
221
- MSWIN64 = Gem::Platform.new("mswin64") unless defined?(MSWIN64)
222
- MINGW = Gem::Platform.new("x86-mingw32") unless defined?(MINGW)
223
- X64_MINGW = Gem::Platform.new("x64-mingw32") unless defined?(X64_MINGW)
219
+ JAVA = Gem::Platform.new("java")
220
+ MSWIN = Gem::Platform.new("mswin32")
221
+ MSWIN64 = Gem::Platform.new("mswin64")
222
+ MINGW = Gem::Platform.new("x86-mingw32")
223
+ X64_MINGW = [Gem::Platform.new("x64-mingw32"),
224
+ Gem::Platform.new("x64-mingw-ucrt")].freeze
224
225
  end
225
226
 
226
227
  Platform.singleton_class.module_eval do
@@ -160,6 +160,8 @@ module Bundler
160
160
  raise GemNotFound, "Could not find #{spec.file_name} for installation" unless path
161
161
  end
162
162
 
163
+ return if Bundler.settings[:no_install]
164
+
163
165
  if requires_sudo?
164
166
  install_path = Bundler.tmp(spec.full_name)
165
167
  bin_path = install_path.join("bin")
@@ -12,17 +12,19 @@ module Bundler
12
12
  end
13
13
 
14
14
  def for(dependencies, check = false, match_current_platform = false)
15
- handled = []
15
+ # dep.name => [list, of, deps]
16
+ handled = Hash.new {|h, k| h[k] = [] }
16
17
  deps = dependencies.dup
17
18
  specs = []
18
19
 
19
20
  loop do
20
21
  break unless dep = deps.shift
21
- next if handled.any? {|d| d.name == dep.name && (match_current_platform || d.__platform == dep.__platform) } || dep.name == "bundler"
22
+ next if handled[dep.name].any? {|d| match_current_platform || d.__platform == dep.__platform } || dep.name == "bundler"
22
23
 
23
- handled << dep
24
+ # use a hash here to ensure constant lookup time in the `any?` call above
25
+ handled[dep.name] << dep
24
26
 
25
- specs_for_dep = spec_for_dependency(dep, match_current_platform)
27
+ specs_for_dep = specs_for_dependency(dep, match_current_platform)
26
28
  if specs_for_dep.any?
27
29
  specs.concat(specs_for_dep)
28
30
 
@@ -171,12 +173,13 @@ module Bundler
171
173
  @specs.sort_by(&:name).each {|s| yield s }
172
174
  end
173
175
 
174
- def spec_for_dependency(dep, match_current_platform)
175
- specs_for_platforms = lookup[dep.name]
176
+ def specs_for_dependency(dep, match_current_platform)
177
+ specs_for_name = lookup[dep.name]
176
178
  if match_current_platform
177
- GemHelpers.select_best_platform_match(specs_for_platforms.select {|s| Gem::Platform.match_spec?(s) }, Bundler.local_platform)
179
+ GemHelpers.select_best_platform_match(specs_for_name.select {|s| Gem::Platform.match_spec?(s) }, Bundler.local_platform)
178
180
  else
179
- GemHelpers.select_best_platform_match(specs_for_platforms, dep.__platform)
181
+ specs_for_name_and_platform = GemHelpers.select_best_platform_match(specs_for_name, dep.__platform)
182
+ specs_for_name_and_platform.any? ? specs_for_name_and_platform : specs_for_name
180
183
  end
181
184
  end
182
185
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.3.16".freeze
4
+ VERSION = "2.3.17".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.3.16
4
+ version: 2.3.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: 2022-06-15 00:00:00.000000000 Z
25
+ date: 2022-06-29 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
@@ -369,7 +369,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
369
369
  - !ruby/object:Gem::Version
370
370
  version: 2.5.2
371
371
  requirements: []
372
- rubygems_version: 3.3.16
372
+ rubygems_version: 3.3.17
373
373
  signing_key:
374
374
  specification_version: 4
375
375
  summary: The best way to manage your application's dependencies