bundler 2.4.4 → 2.4.6

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: 3c086402f586de5162fbccb5f97175ef0539debc5010faed4a7cd25b94c9a0c1
4
- data.tar.gz: 5b0c3726de4085c618f785727c4572b70717e390bf7444a07ff44a3b2c46de64
3
+ metadata.gz: faefef03f59dac0ba23f22a7c1a95acbb584930132acf4c5a1f8533030a77906
4
+ data.tar.gz: 51e844daae34fa0bd18652c5c3d45c8bad50da0ae4905107b5fc2f56e9dbd0cb
5
5
  SHA512:
6
- metadata.gz: fee7f484591b307723fad8855c6b76d516648e37a0e51636d67fd642cf65a057a0e48c7ed80588833fb962196694f23644c3965cd5490c6c70f0add41d1d371e
7
- data.tar.gz: 362ccbe671ea531b2e187c468ec6e841fffe3e500d56d3f99e283623b791c62643d8098d0460c77285d09353009bdd135369ce45746a8da368e696e70cafc45b
6
+ metadata.gz: e0252ec1cd2c474804872e1907eb6579c9e23c55ef9127197c201d078f5e80e91030d546dda86a9bca450a49304603b10b290f4245f6ab933c3e81326ffa8f6d
7
+ data.tar.gz: 68d4b915a405c462d21cc4c5db17b4a544f8b838f9ab20b9985d7a2dbe72dba83c1eeb33d84d23f31f4ae98914291d005a1ed86181d41489228ac42bee96e20b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ # 2.4.6 (January 31, 2023)
2
+
3
+ ## Enhancements:
4
+
5
+ - Don't warn on `bundle binstubs --standalone --all` [#6312](https://github.com/rubygems/rubygems/pull/6312)
6
+
7
+ ## Bug fixes:
8
+
9
+ - Don't undo require decorations made by other gems [#6308](https://github.com/rubygems/rubygems/pull/6308)
10
+ - Fix `bundler/inline` not properly installing gems with extensions when used more than once [#6306](https://github.com/rubygems/rubygems/pull/6306)
11
+ - Fix `bundler/inline` not skipping installation when gems already there, when used more than once [#6305](https://github.com/rubygems/rubygems/pull/6305)
12
+
13
+ # 2.4.5 (January 21, 2023)
14
+
15
+ ## Bug fixes:
16
+
17
+ - Fix `bundler/inline` not resolving properly if gems not preinstalled [#6282](https://github.com/rubygems/rubygems/pull/6282)
18
+ - Fix packages for external platforms being introduced in lockfile when Bundler retries resolution [#6285](https://github.com/rubygems/rubygems/pull/6285)
19
+
20
+ ## Documentation:
21
+
22
+ - Update bundle-exec man page to not use deprecated `Bundler.with_clean_env` [#6284](https://github.com/rubygems/rubygems/pull/6284)
23
+
1
24
  # 2.4.4 (January 16, 2023)
2
25
 
3
26
  ## 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 = "2023-01-16".freeze
8
- @git_commit_sha = "e1c0b50e84".freeze
7
+ @built_at = "2023-01-31".freeze
8
+ @git_commit_sha = "598c04d54a".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -40,7 +40,11 @@ module Bundler
40
40
  end
41
41
 
42
42
  if options[:standalone]
43
- next Bundler.ui.warn("Sorry, Bundler can only be run via RubyGems.") if gem_name == "bundler"
43
+ if gem_name == "bundler"
44
+ Bundler.ui.warn("Sorry, Bundler can only be run via RubyGems.") unless options[:all]
45
+ next
46
+ end
47
+
44
48
  Bundler.settings.temporary(:path => (Bundler.settings[:path] || Bundler.root)) do
45
49
  installer.generate_standalone_bundler_executable_stubs(spec, installer_opts)
46
50
  end
@@ -487,7 +487,7 @@ module Bundler
487
487
  end
488
488
 
489
489
  def expanded_dependencies
490
- @expanded_dependencies ||= dependencies + metadata_dependencies
490
+ dependencies + metadata_dependencies
491
491
  end
492
492
 
493
493
  def resolution_packages
@@ -551,13 +551,13 @@ module Bundler
551
551
  end
552
552
 
553
553
  def start_resolution
554
- result = resolver.start(expanded_dependencies)
554
+ result = resolver.start
555
555
 
556
556
  SpecSet.new(SpecSet.new(result).for(dependencies, false, @platforms))
557
557
  end
558
558
 
559
559
  def precompute_source_requirements_for_indirect_dependencies?
560
- @remote && sources.non_global_rubygems_sources.all?(&:dependency_api_available?) && !sources.aggregate_global_source?
560
+ sources.non_global_rubygems_sources.all?(&:dependency_api_available?) && !sources.aggregate_global_source?
561
561
  end
562
562
 
563
563
  def pin_locally_available_names(source_requirements)
@@ -31,6 +31,7 @@
31
31
  #
32
32
  def gemfile(install = false, options = {}, &gemfile)
33
33
  require_relative "../bundler"
34
+ Bundler.reset!
34
35
 
35
36
  opts = options.dup
36
37
  ui = opts.delete(:ui) { Bundler::UI::Shell.new }
@@ -38,9 +39,8 @@ def gemfile(install = false, options = {}, &gemfile)
38
39
  Bundler.ui = ui
39
40
  raise ArgumentError, "Unknown options: #{opts.keys.join(", ")}" unless opts.empty?
40
41
 
41
- begin
42
+ Bundler.with_unbundled_env do
42
43
  Bundler.instance_variable_set(:@bundle_path, Pathname.new(Gem.dir))
43
- old_gemfile = ENV["BUNDLE_GEMFILE"]
44
44
  Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", "Gemfile"
45
45
 
46
46
  Bundler::Plugin.gemfile_install(&gemfile) if Bundler.feature_flag.plugins?
@@ -65,11 +65,9 @@ def gemfile(install = false, options = {}, &gemfile)
65
65
  runtime = Bundler::Runtime.new(nil, definition)
66
66
  runtime.setup.require
67
67
  end
68
- ensure
69
- if old_gemfile
70
- ENV["BUNDLE_GEMFILE"] = old_gemfile
71
- else
72
- ENV["BUNDLE_GEMFILE"] = ""
73
- end
68
+ end
69
+
70
+ if ENV["BUNDLE_GEMFILE"].nil?
71
+ ENV["BUNDLE_GEMFILE"] = ""
74
72
  end
75
73
  end
@@ -84,13 +84,17 @@ module Bundler
84
84
 
85
85
  def reverse_rubygems_kernel_mixin
86
86
  <<~END
87
- kernel = (class << ::Kernel; self; end)
88
- [kernel, ::Kernel].each do |k|
89
- if k.private_method_defined?(:gem_original_require)
90
- private_require = k.private_method_defined?(:require)
91
- k.send(:remove_method, :require)
92
- k.send(:define_method, :require, k.instance_method(:gem_original_require))
93
- k.send(:private, :require) if private_require
87
+ if Gem.respond_to?(:discover_gems_on_require=)
88
+ Gem.discover_gems_on_require = false
89
+ else
90
+ kernel = (class << ::Kernel; self; end)
91
+ [kernel, ::Kernel].each do |k|
92
+ if k.private_method_defined?(:gem_original_require)
93
+ private_require = k.private_method_defined?(:require)
94
+ k.send(:remove_method, :require)
95
+ k.send(:define_method, :require, k.instance_method(:gem_original_require))
96
+ k.send(:private, :require) if private_require
97
+ end
94
98
  end
95
99
  end
96
100
  END
@@ -74,13 +74,13 @@ Finally, \fBbundle exec\fR also implicitly modifies \fBGemfile\.lock\fR if the l
74
74
  By default, when attempting to \fBbundle exec\fR to a file with a ruby shebang, Bundler will \fBKernel\.load\fR that file instead of using \fBKernel\.exec\fR\. For the vast majority of cases, this is a performance improvement\. In a rare few cases, this could cause some subtle side\-effects (such as dependence on the exact contents of \fB$0\fR or \fB__FILE__\fR) and the optimization can be disabled by enabling the \fBdisable_exec_load\fR setting\.
75
75
  .
76
76
  .SS "Shelling out"
77
- Any Ruby code that opens a subshell (like \fBsystem\fR, backticks, or \fB%x{}\fR) will automatically use the current Bundler environment\. If you need to shell out to a Ruby command that is not part of your current bundle, use the \fBwith_clean_env\fR method with a block\. Any subshells created inside the block will be given the environment present before Bundler was activated\. For example, Homebrew commands run Ruby, but don\'t work inside a bundle:
77
+ Any Ruby code that opens a subshell (like \fBsystem\fR, backticks, or \fB%x{}\fR) will automatically use the current Bundler environment\. If you need to shell out to a Ruby command that is not part of your current bundle, use the \fBwith_unbundled_env\fR method with a block\. Any subshells created inside the block will be given the environment present before Bundler was activated\. For example, Homebrew commands run Ruby, but don\'t work inside a bundle:
78
78
  .
79
79
  .IP "" 4
80
80
  .
81
81
  .nf
82
82
 
83
- Bundler\.with_clean_env do
83
+ Bundler\.with_unbundled_env do
84
84
  `brew install wget`
85
85
  end
86
86
  .
@@ -89,13 +89,13 @@ end
89
89
  .IP "" 0
90
90
  .
91
91
  .P
92
- Using \fBwith_clean_env\fR is also necessary if you are shelling out to a different bundle\. Any Bundler commands run in a subshell will inherit the current Gemfile, so commands that need to run in the context of a different bundle also need to use \fBwith_clean_env\fR\.
92
+ Using \fBwith_unbundled_env\fR is also necessary if you are shelling out to a different bundle\. Any Bundler commands run in a subshell will inherit the current Gemfile, so commands that need to run in the context of a different bundle also need to use \fBwith_unbundled_env\fR\.
93
93
  .
94
94
  .IP "" 4
95
95
  .
96
96
  .nf
97
97
 
98
- Bundler\.with_clean_env do
98
+ Bundler\.with_unbundled_env do
99
99
  Dir\.chdir "/other/bundler/project" do
100
100
  `bundle exec \./script`
101
101
  end
@@ -84,20 +84,20 @@ the `disable_exec_load` setting.
84
84
  Any Ruby code that opens a subshell (like `system`, backticks, or `%x{}`) will
85
85
  automatically use the current Bundler environment. If you need to shell out to
86
86
  a Ruby command that is not part of your current bundle, use the
87
- `with_clean_env` method with a block. Any subshells created inside the block
87
+ `with_unbundled_env` method with a block. Any subshells created inside the block
88
88
  will be given the environment present before Bundler was activated. For
89
89
  example, Homebrew commands run Ruby, but don't work inside a bundle:
90
90
 
91
- Bundler.with_clean_env do
91
+ Bundler.with_unbundled_env do
92
92
  `brew install wget`
93
93
  end
94
94
 
95
- Using `with_clean_env` is also necessary if you are shelling out to a different
95
+ Using `with_unbundled_env` is also necessary if you are shelling out to a different
96
96
  bundle. Any Bundler commands run in a subshell will inherit the current
97
97
  Gemfile, so commands that need to run in the context of a different bundle also
98
- need to use `with_clean_env`.
98
+ need to use `with_unbundled_env`.
99
99
 
100
- Bundler.with_clean_env do
100
+ Bundler.with_unbundled_env do
101
101
  Dir.chdir "/other/bundler/project" do
102
102
  `bundle exec ./script`
103
103
  end
@@ -5,7 +5,7 @@ require_relative "package"
5
5
  module Bundler
6
6
  class Resolver
7
7
  class Base
8
- attr_reader :packages, :source_requirements
8
+ attr_reader :packages, :requirements, :source_requirements
9
9
 
10
10
  def initialize(source_requirements, dependencies, base, platforms, options)
11
11
  @source_requirements = source_requirements
@@ -16,11 +16,18 @@ module Bundler
16
16
  hash[name] = Package.new(name, platforms, **options)
17
17
  end
18
18
 
19
- dependencies.each do |dep|
19
+ @requirements = dependencies.map do |dep|
20
+ dep_platforms = dep.gem_platforms(platforms)
21
+
22
+ # Dependencies scoped to external platforms are ignored
23
+ next if dep_platforms.empty?
24
+
20
25
  name = dep.name
21
26
 
22
- @packages[name] = Package.new(name, dep.gem_platforms(platforms), **options.merge(:dependency => dep))
23
- end
27
+ @packages[name] = Package.new(name, dep_platforms, **options.merge(:dependency => dep))
28
+
29
+ dep
30
+ end.compact
24
31
  end
25
32
 
26
33
  def [](name)
@@ -21,8 +21,8 @@ module Bundler
21
21
  @gem_version_promoter = gem_version_promoter
22
22
  end
23
23
 
24
- def start(requirements)
25
- @requirements = requirements
24
+ def start
25
+ @requirements = @base.requirements
26
26
  @packages = @base.packages
27
27
 
28
28
  root, logger = setup_solver
@@ -331,15 +331,6 @@ module Bundler
331
331
  to_dependency_hash(requirements, packages).map do |dep_package, dep_constraint|
332
332
  name = dep_package.name
333
333
 
334
- # If a dependency is scoped to a platform different from the current
335
- # one, we ignore it. However, it may reappear during resolution as a
336
- # transitive dependency of another package, so we need to reset the
337
- # package so the proper versions are considered if reintroduced later.
338
- if dep_package.platforms.empty?
339
- @packages.delete(name)
340
- next
341
- end
342
-
343
334
  next [dep_package, dep_constraint] if name == "bundler"
344
335
 
345
336
  versions = versions_for(dep_package, dep_constraint.range)
@@ -227,10 +227,14 @@ module Bundler
227
227
 
228
228
  def reverse_rubygems_kernel_mixin
229
229
  # Disable rubygems' gem activation system
230
- kernel = (class << ::Kernel; self; end)
231
- [kernel, ::Kernel].each do |k|
232
- if k.private_method_defined?(:gem_original_require)
233
- redefine_method(k, :require, k.instance_method(:gem_original_require))
230
+ if Gem.respond_to?(:discover_gems_on_require=)
231
+ Gem.discover_gems_on_require = false
232
+ else
233
+ kernel = (class << ::Kernel; self; end)
234
+ [kernel, ::Kernel].each do |k|
235
+ if k.private_method_defined?(:gem_original_require)
236
+ redefine_method(k, :require, k.instance_method(:gem_original_require))
237
+ end
234
238
  end
235
239
  end
236
240
  end
@@ -292,7 +292,7 @@ module Bundler
292
292
  end
293
293
 
294
294
  def dependency_api_available?
295
- api_fetchers.any?
295
+ @allow_remote && api_fetchers.any?
296
296
  end
297
297
 
298
298
  protected
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.4.4".freeze
4
+ VERSION = "2.4.6".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.4.4
4
+ version: 2.4.6
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: 2023-01-16 00:00:00.000000000 Z
25
+ date: 2023-01-31 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
@@ -380,7 +380,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
380
380
  - !ruby/object:Gem::Version
381
381
  version: 3.0.1
382
382
  requirements: []
383
- rubygems_version: 3.4.4
383
+ rubygems_version: 3.4.6
384
384
  signing_key:
385
385
  specification_version: 4
386
386
  summary: The best way to manage your application's dependencies