bundler 2.4.3 → 2.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/definition.rb +36 -35
- data/lib/bundler/installer.rb +3 -7
- data/lib/bundler/lazy_specification.rb +8 -3
- data/lib/bundler/man/bundle-exec.1 +4 -4
- data/lib/bundler/man/bundle-exec.1.ronn +5 -5
- data/lib/bundler/resolver/base.rb +38 -7
- data/lib/bundler/resolver/candidate.rb +2 -5
- data/lib/bundler/resolver/package.rb +11 -2
- data/lib/bundler/resolver.rb +61 -43
- data/lib/bundler/shared_helpers.rb +1 -1
- data/lib/bundler/source/rubygems.rb +1 -1
- data/lib/bundler/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0ed8153bf4161ce7da774eaa1abd23954e3ca61eb7ba730efcb934a6c13b2fe
|
4
|
+
data.tar.gz: 81f598764da83308327451e2ab17276401b9f89f6cd170f82c540b74e3038b41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 668e10c171354b03ee63547510c0e3cb57caa1146749b9f357ee36d74d9c3bfaa84283dc39d908b91a0e7870ecd673b392f7ea062e7987f9f833b492700f5533
|
7
|
+
data.tar.gz: b498147f45cdd036ba4cb3c8ed03eb6353397a5acbbe76fb0b2729c58a4fc99beb86247b6d410e3e55612b7f950d53bea05f705a8d387ed24ab00c47388e7a4a
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,25 @@
|
|
1
|
+
# 2.4.5 (January 21, 2023)
|
2
|
+
|
3
|
+
## Bug fixes:
|
4
|
+
|
5
|
+
- Fix `bundler/inline` not resolving properly if gems not preinstalled [#6282](https://github.com/rubygems/rubygems/pull/6282)
|
6
|
+
- Fix packages for external platforms being introduced in lockfile when Bundler retries resolution [#6285](https://github.com/rubygems/rubygems/pull/6285)
|
7
|
+
|
8
|
+
## Documentation:
|
9
|
+
|
10
|
+
- Update bundle-exec man page to not use deprecated `Bundler.with_clean_env` [#6284](https://github.com/rubygems/rubygems/pull/6284)
|
11
|
+
|
12
|
+
# 2.4.4 (January 16, 2023)
|
13
|
+
|
14
|
+
## Bug fixes:
|
15
|
+
|
16
|
+
- Fix platform specific gems removed from the lockfile [#6266](https://github.com/rubygems/rubygems/pull/6266)
|
17
|
+
- Properly handle incompatibilities on platform specific gems [#6270](https://github.com/rubygems/rubygems/pull/6270)
|
18
|
+
- Optimistically exclude prereleases from initial resolution [#6246](https://github.com/rubygems/rubygems/pull/6246)
|
19
|
+
- Fix another case of not properly falling back to ruby variant when materializing [#6261](https://github.com/rubygems/rubygems/pull/6261)
|
20
|
+
- Skip setting `BUNDLER_SETUP` on Ruby 2.6 [#6252](https://github.com/rubygems/rubygems/pull/6252)
|
21
|
+
- Let resolver deal with legacy gems with equivalent version and different dependencies [#6219](https://github.com/rubygems/rubygems/pull/6219)
|
22
|
+
|
1
23
|
# 2.4.3 (January 6, 2023)
|
2
24
|
|
3
25
|
## Enhancements:
|
@@ -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-
|
8
|
-
@git_commit_sha = "
|
7
|
+
@built_at = "2023-01-21".freeze
|
8
|
+
@git_commit_sha = "d8ff3b6e4a".freeze
|
9
9
|
@release = true
|
10
10
|
# end ivars
|
11
11
|
|
data/lib/bundler/definition.rb
CHANGED
@@ -159,13 +159,6 @@ module Bundler
|
|
159
159
|
resolve
|
160
160
|
end
|
161
161
|
|
162
|
-
def resolve_prefering_local!
|
163
|
-
@prefer_local = true
|
164
|
-
@remote = true
|
165
|
-
sources.remote!
|
166
|
-
resolve
|
167
|
-
end
|
168
|
-
|
169
162
|
def resolve_with_cache!
|
170
163
|
sources.cached!
|
171
164
|
resolve
|
@@ -177,6 +170,23 @@ module Bundler
|
|
177
170
|
resolve
|
178
171
|
end
|
179
172
|
|
173
|
+
def resolution_mode=(options)
|
174
|
+
if options["local"]
|
175
|
+
@remote = false
|
176
|
+
else
|
177
|
+
@remote = true
|
178
|
+
@prefer_local = options["prefer-local"]
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
def setup_sources_for_resolve
|
183
|
+
if @remote == false
|
184
|
+
sources.cached!
|
185
|
+
else
|
186
|
+
sources.remote!
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
180
190
|
# For given dependency list returns a SpecSet with Gemspec of all the required
|
181
191
|
# dependencies.
|
182
192
|
# 1. The method first resolves the dependencies specified in Gemfile
|
@@ -473,31 +483,19 @@ module Bundler
|
|
473
483
|
private
|
474
484
|
|
475
485
|
def resolver
|
476
|
-
@resolver ||=
|
477
|
-
last_resolve = converge_locked_specs
|
478
|
-
remove_ruby_from_platforms_if_necessary!(current_dependencies)
|
479
|
-
Resolver.new(source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve(last_resolve))
|
480
|
-
end
|
486
|
+
@resolver ||= Resolver.new(resolution_packages, gem_version_promoter)
|
481
487
|
end
|
482
488
|
|
483
489
|
def expanded_dependencies
|
484
|
-
|
490
|
+
dependencies + metadata_dependencies
|
485
491
|
end
|
486
492
|
|
487
493
|
def resolution_packages
|
488
494
|
@resolution_packages ||= begin
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
expanded_dependencies.each do |dep|
|
494
|
-
name = dep.name
|
495
|
-
platforms = dep.gem_platforms(@platforms)
|
496
|
-
|
497
|
-
packages[name] = Resolver::Package.new(name, platforms, @originally_locked_specs, @unlock[:gems], :dependency => dep)
|
498
|
-
end
|
499
|
-
|
500
|
-
packages
|
495
|
+
last_resolve = converge_locked_specs
|
496
|
+
remove_ruby_from_platforms_if_necessary!(current_dependencies)
|
497
|
+
packages = Resolver::Base.new(source_requirements, expanded_dependencies, last_resolve, @platforms, :locked_specs => @originally_locked_specs, :unlock => @unlock[:gems], :prerelease => gem_version_promoter.pre?)
|
498
|
+
additional_base_requirements_for_resolve(packages, last_resolve)
|
501
499
|
end
|
502
500
|
end
|
503
501
|
|
@@ -531,13 +529,15 @@ module Bundler
|
|
531
529
|
break if incomplete_specs.empty?
|
532
530
|
|
533
531
|
Bundler.ui.debug("The lockfile does not have all gems needed for the current platform though, Bundler will still re-resolve dependencies")
|
534
|
-
|
532
|
+
setup_sources_for_resolve
|
533
|
+
resolution_packages.delete(incomplete_specs)
|
534
|
+
@resolve = start_resolution
|
535
535
|
specs = resolve.materialize(dependencies)
|
536
536
|
|
537
537
|
still_incomplete_specs = specs.incomplete_specs
|
538
538
|
|
539
539
|
if still_incomplete_specs == incomplete_specs
|
540
|
-
package = resolution_packages
|
540
|
+
package = resolution_packages.get_package(incomplete_specs.first.name)
|
541
541
|
resolver.raise_not_found! package
|
542
542
|
end
|
543
543
|
|
@@ -550,14 +550,14 @@ module Bundler
|
|
550
550
|
specs
|
551
551
|
end
|
552
552
|
|
553
|
-
def start_resolution
|
554
|
-
result = resolver.start
|
553
|
+
def start_resolution
|
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
|
-
|
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)
|
@@ -885,11 +885,12 @@ module Bundler
|
|
885
885
|
current == proposed
|
886
886
|
end
|
887
887
|
|
888
|
-
def additional_base_requirements_for_resolve(last_resolve)
|
889
|
-
return
|
890
|
-
converge_specs(@originally_locked_specs - last_resolve).
|
891
|
-
|
892
|
-
end
|
888
|
+
def additional_base_requirements_for_resolve(resolution_packages, last_resolve)
|
889
|
+
return resolution_packages unless @locked_gems && unlocking? && !sources.expired_sources?(@locked_gems.sources)
|
890
|
+
converge_specs(@originally_locked_specs - last_resolve).each do |locked_spec|
|
891
|
+
resolution_packages.base_requirements[locked_spec.name] = Gem::Requirement.new(">= #{locked_spec.version}")
|
892
|
+
end
|
893
|
+
resolution_packages
|
893
894
|
end
|
894
895
|
|
895
896
|
def remove_ruby_from_platforms_if_necessary!(dependencies)
|
data/lib/bundler/installer.rb
CHANGED
@@ -249,17 +249,13 @@ module Bundler
|
|
249
249
|
|
250
250
|
# returns whether or not a re-resolve was needed
|
251
251
|
def resolve_if_needed(options)
|
252
|
+
@definition.resolution_mode = options
|
253
|
+
|
252
254
|
if !@definition.unlocking? && !options["force"] && !Bundler.settings[:inline] && Bundler.default_lockfile.file?
|
253
255
|
return false if @definition.nothing_changed? && !@definition.missing_specs?
|
254
256
|
end
|
255
257
|
|
256
|
-
|
257
|
-
@definition.resolve_with_cache!
|
258
|
-
elsif options["prefer-local"]
|
259
|
-
@definition.resolve_prefering_local!
|
260
|
-
else
|
261
|
-
@definition.resolve_remotely!
|
262
|
-
end
|
258
|
+
@definition.setup_sources_for_resolve
|
263
259
|
|
264
260
|
true
|
265
261
|
end
|
@@ -89,7 +89,7 @@ module Bundler
|
|
89
89
|
|
90
90
|
installable_candidates = GemHelpers.select_best_platform_match(matching_specs, target_platform)
|
91
91
|
|
92
|
-
specification = __materialize__(installable_candidates)
|
92
|
+
specification = __materialize__(installable_candidates, :fallback_to_non_installable => false)
|
93
93
|
return specification unless specification.nil?
|
94
94
|
|
95
95
|
if target_platform != platform
|
@@ -102,13 +102,18 @@ module Bundler
|
|
102
102
|
__materialize__(candidates)
|
103
103
|
end
|
104
104
|
|
105
|
-
|
105
|
+
# If in frozen mode, we fallback to a non-installable candidate because by
|
106
|
+
# doing this we avoid re-resolving and potentially end up changing the
|
107
|
+
# lock file, which is not allowed. In that case, we will give a proper error
|
108
|
+
# about the mismatch higher up the stack, right before trying to install the
|
109
|
+
# bad gem.
|
110
|
+
def __materialize__(candidates, fallback_to_non_installable: Bundler.frozen_bundle?)
|
106
111
|
search = candidates.reverse.find do |spec|
|
107
112
|
spec.is_a?(StubSpecification) ||
|
108
113
|
(spec.matches_current_ruby? &&
|
109
114
|
spec.matches_current_rubygems?)
|
110
115
|
end
|
111
|
-
if search.nil? &&
|
116
|
+
if search.nil? && fallback_to_non_installable
|
112
117
|
search = candidates.last
|
113
118
|
else
|
114
119
|
search.dependencies = dependencies if search && search.full_name == full_name && (search.is_a?(RemoteSpecification) || search.is_a?(EndpointSpecification))
|
@@ -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 \
|
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\.
|
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 \
|
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\.
|
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
|
-
`
|
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.
|
91
|
+
Bundler.with_unbundled_env do
|
92
92
|
`brew install wget`
|
93
93
|
end
|
94
94
|
|
95
|
-
Using `
|
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 `
|
98
|
+
need to use `with_unbundled_env`.
|
99
99
|
|
100
|
-
Bundler.
|
100
|
+
Bundler.with_unbundled_env do
|
101
101
|
Dir.chdir "/other/bundler/project" do
|
102
102
|
`bundle exec ./script`
|
103
103
|
end
|
@@ -1,19 +1,47 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative "package"
|
4
|
+
|
3
5
|
module Bundler
|
4
6
|
class Resolver
|
5
7
|
class Base
|
6
|
-
|
8
|
+
attr_reader :packages, :requirements, :source_requirements
|
9
|
+
|
10
|
+
def initialize(source_requirements, dependencies, base, platforms, options)
|
11
|
+
@source_requirements = source_requirements
|
12
|
+
|
7
13
|
@base = base
|
8
|
-
|
14
|
+
|
15
|
+
@packages = Hash.new do |hash, name|
|
16
|
+
hash[name] = Package.new(name, platforms, **options)
|
17
|
+
end
|
18
|
+
|
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
|
+
|
25
|
+
name = dep.name
|
26
|
+
|
27
|
+
@packages[name] = Package.new(name, dep_platforms, **options.merge(:dependency => dep))
|
28
|
+
|
29
|
+
dep
|
30
|
+
end.compact
|
9
31
|
end
|
10
32
|
|
11
33
|
def [](name)
|
12
34
|
@base[name]
|
13
35
|
end
|
14
36
|
|
15
|
-
def delete(
|
16
|
-
|
37
|
+
def delete(specs)
|
38
|
+
specs.each do |spec|
|
39
|
+
@base.delete(spec)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def get_package(name)
|
44
|
+
@packages[name]
|
17
45
|
end
|
18
46
|
|
19
47
|
def base_requirements
|
@@ -24,10 +52,14 @@ module Bundler
|
|
24
52
|
names.each do |name|
|
25
53
|
@base.delete_by_name(name)
|
26
54
|
|
27
|
-
@
|
55
|
+
@base_requirements.delete(name)
|
28
56
|
end
|
57
|
+
end
|
29
58
|
|
30
|
-
|
59
|
+
def include_prereleases(names)
|
60
|
+
names.each do |name|
|
61
|
+
get_package(name).consider_prereleases!
|
62
|
+
end
|
31
63
|
end
|
32
64
|
|
33
65
|
private
|
@@ -38,7 +70,6 @@ module Bundler
|
|
38
70
|
req = Gem::Requirement.new(ls.version)
|
39
71
|
base_requirements[ls.name] = req
|
40
72
|
end
|
41
|
-
@additional_base_requirements.each {|d| base_requirements[d.name] = d.requirement }
|
42
73
|
base_requirements
|
43
74
|
end
|
44
75
|
end
|
@@ -26,9 +26,8 @@ module Bundler
|
|
26
26
|
|
27
27
|
def initialize(version, specs: [])
|
28
28
|
@spec_group = Resolver::SpecGroup.new(specs)
|
29
|
-
@platforms = specs.map(&:platform).sort_by(&:to_s).uniq
|
30
29
|
@version = Gem::Version.new(version)
|
31
|
-
@ruby_only =
|
30
|
+
@ruby_only = specs.map(&:platform).uniq == [Gem::Platform::RUBY]
|
32
31
|
end
|
33
32
|
|
34
33
|
def dependencies
|
@@ -88,9 +87,7 @@ module Bundler
|
|
88
87
|
end
|
89
88
|
|
90
89
|
def to_s
|
91
|
-
|
92
|
-
|
93
|
-
"#{@version} (#{@platforms.join(", ")})"
|
90
|
+
@version.to_s
|
94
91
|
end
|
95
92
|
end
|
96
93
|
end
|
@@ -15,12 +15,13 @@ module Bundler
|
|
15
15
|
class Package
|
16
16
|
attr_reader :name, :platforms, :dependency, :locked_version
|
17
17
|
|
18
|
-
def initialize(name, platforms, locked_specs
|
18
|
+
def initialize(name, platforms, locked_specs:, unlock:, prerelease: false, dependency: nil)
|
19
19
|
@name = name
|
20
20
|
@platforms = platforms
|
21
21
|
@locked_version = locked_specs[name].first&.version
|
22
22
|
@unlock = unlock
|
23
23
|
@dependency = dependency || Dependency.new(name, @locked_version)
|
24
|
+
@prerelease = @dependency.prerelease? || @locked_version&.prerelease? || prerelease ? :consider_first : :ignore
|
24
25
|
end
|
25
26
|
|
26
27
|
def to_s
|
@@ -47,8 +48,16 @@ module Bundler
|
|
47
48
|
@unlock.empty? || @unlock.include?(name)
|
48
49
|
end
|
49
50
|
|
51
|
+
def ignores_prereleases?
|
52
|
+
@prerelease == :ignore
|
53
|
+
end
|
54
|
+
|
50
55
|
def prerelease_specified?
|
51
|
-
@
|
56
|
+
@prerelease == :consider_first
|
57
|
+
end
|
58
|
+
|
59
|
+
def consider_prereleases!
|
60
|
+
@prerelease = :consider_last
|
52
61
|
end
|
53
62
|
|
54
63
|
def force_ruby_platform?
|
data/lib/bundler/resolver.rb
CHANGED
@@ -9,26 +9,21 @@ module Bundler
|
|
9
9
|
class Resolver
|
10
10
|
require_relative "vendored_pub_grub"
|
11
11
|
require_relative "resolver/base"
|
12
|
-
require_relative "resolver/package"
|
13
12
|
require_relative "resolver/candidate"
|
14
13
|
require_relative "resolver/incompatibility"
|
15
14
|
require_relative "resolver/root"
|
16
15
|
|
17
16
|
include GemHelpers
|
18
17
|
|
19
|
-
def initialize(
|
20
|
-
@source_requirements = source_requirements
|
21
|
-
@base =
|
18
|
+
def initialize(base, gem_version_promoter)
|
19
|
+
@source_requirements = base.source_requirements
|
20
|
+
@base = base
|
22
21
|
@gem_version_promoter = gem_version_promoter
|
23
22
|
end
|
24
23
|
|
25
|
-
def start
|
26
|
-
|
27
|
-
|
28
|
-
end
|
29
|
-
|
30
|
-
@requirements = requirements
|
31
|
-
@packages = packages
|
24
|
+
def start
|
25
|
+
@requirements = @base.requirements
|
26
|
+
@packages = @base.packages
|
32
27
|
|
33
28
|
root, logger = setup_solver
|
34
29
|
|
@@ -78,33 +73,26 @@ module Bundler
|
|
78
73
|
rescue PubGrub::SolveFailure => e
|
79
74
|
incompatibility = e.incompatibility
|
80
75
|
|
81
|
-
names_to_unlock =
|
82
|
-
extended_explanation = nil
|
76
|
+
names_to_unlock, names_to_allow_prereleases_for, extended_explanation = find_names_to_relax(incompatibility)
|
83
77
|
|
84
|
-
|
85
|
-
cause = incompatibility.cause
|
86
|
-
incompatibility = cause.incompatibility
|
87
|
-
|
88
|
-
incompatibility.terms.each do |term|
|
89
|
-
name = term.package.name
|
90
|
-
names_to_unlock << name if base_requirements[name]
|
78
|
+
names_to_relax = names_to_unlock + names_to_allow_prereleases_for
|
91
79
|
|
92
|
-
|
93
|
-
|
80
|
+
if names_to_relax.any?
|
81
|
+
if names_to_unlock.any?
|
82
|
+
Bundler.ui.debug "Found conflicts with locked dependencies. Will retry with #{names_to_unlock.join(", ")} unlocked...", true
|
94
83
|
|
95
|
-
|
84
|
+
@base.unlock_names(names_to_unlock)
|
96
85
|
end
|
97
|
-
end
|
98
|
-
|
99
|
-
names_to_unlock.uniq!
|
100
86
|
|
101
|
-
|
102
|
-
|
87
|
+
if names_to_allow_prereleases_for.any?
|
88
|
+
Bundler.ui.debug "Found conflicts with dependencies with prereleases. Will retrying considering prereleases for #{names_to_allow_prereleases_for.join(", ")}...", true
|
103
89
|
|
104
|
-
|
90
|
+
@base.include_prereleases(names_to_allow_prereleases_for)
|
91
|
+
end
|
105
92
|
|
106
93
|
root, logger = setup_solver
|
107
94
|
|
95
|
+
Bundler.ui.debug "Retrying resolution...", true
|
108
96
|
retry
|
109
97
|
end
|
110
98
|
|
@@ -118,6 +106,35 @@ module Bundler
|
|
118
106
|
raise SolveFailure.new(explanation)
|
119
107
|
end
|
120
108
|
|
109
|
+
def find_names_to_relax(incompatibility)
|
110
|
+
names_to_unlock = []
|
111
|
+
names_to_allow_prereleases_for = []
|
112
|
+
extended_explanation = nil
|
113
|
+
|
114
|
+
while incompatibility.conflict?
|
115
|
+
cause = incompatibility.cause
|
116
|
+
incompatibility = cause.incompatibility
|
117
|
+
|
118
|
+
incompatibility.terms.each do |term|
|
119
|
+
package = term.package
|
120
|
+
name = package.name
|
121
|
+
|
122
|
+
if base_requirements[name]
|
123
|
+
names_to_unlock << name
|
124
|
+
elsif package.ignores_prereleases?
|
125
|
+
names_to_allow_prereleases_for << name
|
126
|
+
end
|
127
|
+
|
128
|
+
no_versions_incompat = [cause.incompatibility, cause.satisfier].find {|incompat| incompat.cause.is_a?(PubGrub::Incompatibility::NoVersions) }
|
129
|
+
next unless no_versions_incompat
|
130
|
+
|
131
|
+
extended_explanation = no_versions_incompat.extended_explanation
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
[names_to_unlock.uniq, names_to_allow_prereleases_for.uniq, extended_explanation]
|
136
|
+
end
|
137
|
+
|
121
138
|
def parse_dependency(package, dependency)
|
122
139
|
range = if repository_for(package).is_a?(Source::Gemspec)
|
123
140
|
PubGrub::VersionRange.any
|
@@ -215,7 +232,7 @@ module Bundler
|
|
215
232
|
|
216
233
|
def all_versions_for(package)
|
217
234
|
name = package.name
|
218
|
-
results = (@base[name] + @all_specs[name]).uniq
|
235
|
+
results = (@base[name] + filter_prereleases(@all_specs[name], package)).uniq {|spec| [spec.version.hash, spec.platform] }
|
219
236
|
locked_requirement = base_requirements[name]
|
220
237
|
results = filter_matching_specs(results, locked_requirement) if locked_requirement
|
221
238
|
|
@@ -284,6 +301,12 @@ module Bundler
|
|
284
301
|
end
|
285
302
|
end
|
286
303
|
|
304
|
+
def filter_prereleases(specs, package)
|
305
|
+
return specs unless package.ignores_prereleases?
|
306
|
+
|
307
|
+
specs.reject {|s| s.version.prerelease? }
|
308
|
+
end
|
309
|
+
|
287
310
|
def requirement_satisfied_by?(requirement, spec)
|
288
311
|
requirement.satisfied_by?(spec.version) || spec.source.is_a?(Source::Gemspec)
|
289
312
|
end
|
@@ -304,25 +327,20 @@ module Bundler
|
|
304
327
|
@base.base_requirements
|
305
328
|
end
|
306
329
|
|
307
|
-
def remove_from_candidates(spec)
|
308
|
-
@base.delete(spec)
|
309
|
-
end
|
310
|
-
|
311
330
|
def prepare_dependencies(requirements, packages)
|
312
331
|
to_dependency_hash(requirements, packages).map do |dep_package, dep_constraint|
|
313
332
|
name = dep_package.name
|
314
333
|
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
334
|
+
next [dep_package, dep_constraint] if name == "bundler"
|
335
|
+
|
336
|
+
versions = versions_for(dep_package, dep_constraint.range)
|
337
|
+
if versions.empty? && dep_package.ignores_prereleases?
|
338
|
+
@sorted_versions.delete(dep_package)
|
339
|
+
dep_package.consider_prereleases!
|
340
|
+
versions = versions_for(dep_package, dep_constraint.range)
|
322
341
|
end
|
342
|
+
next [dep_package, dep_constraint] unless versions.empty?
|
323
343
|
|
324
|
-
next [dep_package, dep_constraint] if name == "bundler"
|
325
|
-
next [dep_package, dep_constraint] unless versions_for(dep_package, dep_constraint.range).empty?
|
326
344
|
next unless dep_package.current_platform?
|
327
345
|
|
328
346
|
raise_not_found!(dep_package)
|
@@ -284,7 +284,7 @@ module Bundler
|
|
284
284
|
Bundler::SharedHelpers.set_env "BUNDLE_BIN_PATH", exe_file
|
285
285
|
Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", find_gemfile.to_s
|
286
286
|
Bundler::SharedHelpers.set_env "BUNDLER_VERSION", Bundler::VERSION
|
287
|
-
Bundler::SharedHelpers.set_env "BUNDLER_SETUP", File.expand_path("setup", __dir__)
|
287
|
+
Bundler::SharedHelpers.set_env "BUNDLER_SETUP", File.expand_path("setup", __dir__) unless RUBY_VERSION < "2.7"
|
288
288
|
end
|
289
289
|
|
290
290
|
def set_path
|
data/lib/bundler/version.rb
CHANGED
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
|
+
version: 2.4.5
|
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-
|
25
|
+
date: 2023-01-21 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.
|
383
|
+
rubygems_version: 3.4.5
|
384
384
|
signing_key:
|
385
385
|
specification_version: 4
|
386
386
|
summary: The best way to manage your application's dependencies
|