rubygems-update 3.3.21 → 3.3.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +32 -0
- data/Manifest.txt +8 -0
- data/POLICIES.md +38 -5
- data/bundler/CHANGELOG.md +40 -0
- data/bundler/bundler.gemspec +6 -8
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli/init.rb +5 -1
- data/bundler/lib/bundler/cli.rb +2 -1
- data/bundler/lib/bundler/current_ruby.rb +14 -5
- data/bundler/lib/bundler/definition.rb +7 -20
- data/bundler/lib/bundler/dependency.rb +18 -85
- data/bundler/lib/bundler/dsl.rb +0 -1
- data/bundler/lib/bundler/endpoint_specification.rb +1 -1
- data/bundler/lib/bundler/feature_flag.rb +0 -1
- data/bundler/lib/bundler/gem_version_promoter.rb +10 -25
- data/bundler/lib/bundler/index.rb +3 -26
- data/bundler/lib/bundler/injector.rb +2 -1
- data/bundler/lib/bundler/lockfile_generator.rb +1 -1
- data/bundler/lib/bundler/man/bundle-add.1 +6 -2
- data/bundler/lib/bundler/man/bundle-add.1.ronn +4 -1
- data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
- data/bundler/lib/bundler/man/bundle-check.1 +1 -1
- data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
- data/bundler/lib/bundler/man/bundle-config.1 +1 -1
- data/bundler/lib/bundler/man/bundle-console.1 +53 -0
- data/bundler/lib/bundler/man/bundle-console.1.ronn +44 -0
- data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
- data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
- data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
- data/bundler/lib/bundler/man/bundle-help.1 +13 -0
- data/bundler/lib/bundler/man/bundle-help.1.ronn +12 -0
- data/bundler/lib/bundler/man/bundle-info.1 +1 -1
- data/bundler/lib/bundler/man/bundle-init.1 +1 -1
- data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
- data/bundler/lib/bundler/man/bundle-install.1 +1 -1
- data/bundler/lib/bundler/man/bundle-list.1 +1 -1
- data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
- data/bundler/lib/bundler/man/bundle-open.1 +1 -1
- data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
- data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
- data/bundler/lib/bundler/man/bundle-plugin.1 +1 -1
- data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
- data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
- data/bundler/lib/bundler/man/bundle-show.1 +1 -1
- data/bundler/lib/bundler/man/bundle-update.1 +1 -1
- data/bundler/lib/bundler/man/bundle-version.1 +35 -0
- data/bundler/lib/bundler/man/bundle-version.1.ronn +24 -0
- data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
- data/bundler/lib/bundler/man/bundle.1 +6 -2
- data/bundler/lib/bundler/man/bundle.1.ronn +4 -1
- data/bundler/lib/bundler/man/gemfile.5 +8 -38
- data/bundler/lib/bundler/man/gemfile.5.ronn +9 -27
- data/bundler/lib/bundler/man/index.txt +3 -0
- data/bundler/lib/bundler/match_remote_metadata.rb +4 -1
- data/bundler/lib/bundler/resolver/base.rb +50 -0
- data/bundler/lib/bundler/resolver.rb +72 -93
- data/bundler/lib/bundler/rubygems_ext.rb +24 -3
- data/bundler/lib/bundler/settings.rb +0 -1
- data/bundler/lib/bundler/spec_set.rb +11 -1
- data/bundler/lib/bundler/templates/newgem/gitlab-ci.yml.tt +5 -4
- data/bundler/lib/bundler/version.rb +1 -1
- data/lib/rubygems/gemcutter_utilities.rb +8 -1
- data/lib/rubygems/package.rb +9 -4
- data/lib/rubygems/platform.rb +17 -1
- data/lib/rubygems/query_utils.rb +2 -2
- data/lib/rubygems/resolver.rb +1 -1
- data/lib/rubygems.rb +1 -1
- data/rubygems-update.gemspec +1 -1
- data/test/rubygems/helper.rb +23 -19
- data/test/rubygems/packages/Bluebie-legs-0.6.2.gem +0 -0
- data/test/rubygems/test_gem.rb +254 -212
- data/test/rubygems/test_gem_commands_info_command.rb +26 -0
- data/test/rubygems/test_gem_commands_owner_command.rb +105 -24
- data/test/rubygems/test_gem_commands_push_command.rb +44 -23
- data/test/rubygems/test_gem_commands_signin_command.rb +28 -3
- data/test/rubygems/test_gem_commands_yank_command.rb +9 -9
- data/test/rubygems/test_gem_gemcutter_utilities.rb +16 -12
- data/test/rubygems/test_gem_package.rb +15 -0
- data/test/rubygems/test_gem_platform.rb +67 -0
- data/test/rubygems/test_gem_resolver.rb +33 -0
- data/test/rubygems/test_require.rb +5 -5
- data/test/rubygems/utilities.rb +36 -14
- metadata +11 -3
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "GEMFILE" "5" "
|
4
|
+
.TH "GEMFILE" "5" "September 2022" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
|
@@ -254,19 +254,15 @@ There are a number of \fBGemfile\fR platforms:
|
|
254
254
|
.
|
255
255
|
.TP
|
256
256
|
\fBruby\fR
|
257
|
-
C Ruby (MRI), Rubinius or TruffleRuby, but
|
257
|
+
C Ruby (MRI), Rubinius, or TruffleRuby, but not Windows
|
258
258
|
.
|
259
259
|
.TP
|
260
260
|
\fBmri\fR
|
261
|
-
|
261
|
+
C Ruby (MRI) only, but not Windows
|
262
262
|
.
|
263
263
|
.TP
|
264
|
-
\
|
265
|
-
Windows 32
|
266
|
-
.
|
267
|
-
.TP
|
268
|
-
\fBx64_mingw\fR
|
269
|
-
Windows 64 bit \'mingw32\' platform (aka RubyInstaller x64)
|
264
|
+
\fBwindows\fR
|
265
|
+
Windows C Ruby (MRI), including RubyInstaller 32\-bit and 64\-bit versions
|
270
266
|
.
|
271
267
|
.TP
|
272
268
|
\fBrbx\fR
|
@@ -280,15 +276,8 @@ JRuby
|
|
280
276
|
\fBtruffleruby\fR
|
281
277
|
TruffleRuby
|
282
278
|
.
|
283
|
-
.TP
|
284
|
-
\fBmswin\fR
|
285
|
-
Windows
|
286
|
-
.
|
287
279
|
.P
|
288
|
-
|
289
|
-
.
|
290
|
-
.P
|
291
|
-
To specify a version in addition to a platform, append the version number without the delimiter to the platform\. For example, to specify that a gem should only be used on platforms with Ruby 2\.3, use:
|
280
|
+
On platforms \fBruby\fR, \fBmri\fR, and \fBwindows\fR, you may additionally specify a version by appending the major and minor version numbers without a delimiter\. For example, to specify that a gem should only be used on platform \fBruby\fR version 2\.3, use:
|
292
281
|
.
|
293
282
|
.IP "" 4
|
294
283
|
.
|
@@ -301,26 +290,7 @@ ruby_23
|
|
301
290
|
.IP "" 0
|
302
291
|
.
|
303
292
|
.P
|
304
|
-
|
305
|
-
.
|
306
|
-
.TP
|
307
|
-
\fBruby\fR
|
308
|
-
1\.8, 1\.9, 2\.0, 2\.1, 2\.2, 2\.3, 2\.4, 2\.5, 2\.6
|
309
|
-
.
|
310
|
-
.TP
|
311
|
-
\fBmri\fR
|
312
|
-
1\.8, 1\.9, 2\.0, 2\.1, 2\.2, 2\.3, 2\.4, 2\.5, 2\.6
|
313
|
-
.
|
314
|
-
.TP
|
315
|
-
\fBmingw\fR
|
316
|
-
1\.8, 1\.9, 2\.0, 2\.1, 2\.2, 2\.3, 2\.4, 2\.5, 2\.6
|
317
|
-
.
|
318
|
-
.TP
|
319
|
-
\fBx64_mingw\fR
|
320
|
-
2\.0, 2\.1, 2\.2, 2\.3, 2\.4, 2\.5, 2\.6
|
321
|
-
.
|
322
|
-
.P
|
323
|
-
As with groups, you can specify one or more platforms:
|
293
|
+
As with groups (above), you may specify one or more platforms:
|
324
294
|
.
|
325
295
|
.IP "" 4
|
326
296
|
.
|
@@ -328,7 +298,7 @@ As with groups, you can specify one or more platforms:
|
|
328
298
|
|
329
299
|
gem "weakling", platforms: :jruby
|
330
300
|
gem "ruby\-debug", platforms: :mri_18
|
331
|
-
gem "nokogiri", platforms: [:
|
301
|
+
gem "nokogiri", platforms: [:windows_26, :jruby]
|
332
302
|
.
|
333
303
|
.fi
|
334
304
|
.
|
@@ -190,47 +190,29 @@ platforms.
|
|
190
190
|
There are a number of `Gemfile` platforms:
|
191
191
|
|
192
192
|
* `ruby`:
|
193
|
-
C Ruby (MRI), Rubinius or TruffleRuby, but
|
193
|
+
C Ruby (MRI), Rubinius, or TruffleRuby, but not Windows
|
194
194
|
* `mri`:
|
195
|
-
|
196
|
-
* `
|
197
|
-
Windows 32
|
198
|
-
* `x64_mingw`:
|
199
|
-
Windows 64 bit 'mingw32' platform (aka RubyInstaller x64)
|
195
|
+
C Ruby (MRI) only, but not Windows
|
196
|
+
* `windows`:
|
197
|
+
Windows C Ruby (MRI), including RubyInstaller 32-bit and 64-bit versions
|
200
198
|
* `rbx`:
|
201
199
|
Rubinius
|
202
200
|
* `jruby`:
|
203
201
|
JRuby
|
204
202
|
* `truffleruby`:
|
205
203
|
TruffleRuby
|
206
|
-
* `mswin`:
|
207
|
-
Windows
|
208
204
|
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
To specify a version in addition to a platform, append the version number without
|
213
|
-
the delimiter to the platform. For example, to specify that a gem should only be
|
214
|
-
used on platforms with Ruby 2.3, use:
|
205
|
+
On platforms `ruby`, `mri`, and `windows`, you may additionally specify a version
|
206
|
+
by appending the major and minor version numbers without a delimiter. For example,
|
207
|
+
to specify that a gem should only be used on platform `ruby` version 2.3, use:
|
215
208
|
|
216
209
|
ruby_23
|
217
210
|
|
218
|
-
|
219
|
-
|
220
|
-
* `ruby`:
|
221
|
-
1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
|
222
|
-
* `mri`:
|
223
|
-
1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
|
224
|
-
* `mingw`:
|
225
|
-
1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
|
226
|
-
* `x64_mingw`:
|
227
|
-
2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
|
228
|
-
|
229
|
-
As with groups, you can specify one or more platforms:
|
211
|
+
As with groups (above), you may specify one or more platforms:
|
230
212
|
|
231
213
|
gem "weakling", platforms: :jruby
|
232
214
|
gem "ruby-debug", platforms: :mri_18
|
233
|
-
gem "nokogiri", platforms: [:
|
215
|
+
gem "nokogiri", platforms: [:windows_26, :jruby]
|
234
216
|
|
235
217
|
All operations involving groups ([`bundle install`](bundle-install.1.html), `Bundler.setup`,
|
236
218
|
`Bundler.require`) behave exactly the same as if any groups not
|
@@ -6,9 +6,11 @@ bundle-cache(1) bundle-cache.1
|
|
6
6
|
bundle-check(1) bundle-check.1
|
7
7
|
bundle-clean(1) bundle-clean.1
|
8
8
|
bundle-config(1) bundle-config.1
|
9
|
+
bundle-console(1) bundle-console.1
|
9
10
|
bundle-doctor(1) bundle-doctor.1
|
10
11
|
bundle-exec(1) bundle-exec.1
|
11
12
|
bundle-gem(1) bundle-gem.1
|
13
|
+
bundle-help(1) bundle-help.1
|
12
14
|
bundle-info(1) bundle-info.1
|
13
15
|
bundle-init(1) bundle-init.1
|
14
16
|
bundle-inject(1) bundle-inject.1
|
@@ -23,4 +25,5 @@ bundle-pristine(1) bundle-pristine.1
|
|
23
25
|
bundle-remove(1) bundle-remove.1
|
24
26
|
bundle-show(1) bundle-show.1
|
25
27
|
bundle-update(1) bundle-update.1
|
28
|
+
bundle-version(1) bundle-version.1
|
26
29
|
bundle-viz(1) bundle-viz.1
|
@@ -2,8 +2,11 @@
|
|
2
2
|
|
3
3
|
module Bundler
|
4
4
|
module FetchMetadata
|
5
|
+
# A fallback is included because the original version of the specification
|
6
|
+
# API didn't include that field, so some marshalled specs in the index have it
|
7
|
+
# set to +nil+.
|
5
8
|
def matches_current_ruby?
|
6
|
-
@required_ruby_version ||= _remote_specification.required_ruby_version
|
9
|
+
@required_ruby_version ||= _remote_specification.required_ruby_version || Gem::Requirement.default
|
7
10
|
|
8
11
|
super
|
9
12
|
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
class Resolver
|
5
|
+
class Base
|
6
|
+
def initialize(base, additional_base_requirements)
|
7
|
+
@base = base
|
8
|
+
@additional_base_requirements = additional_base_requirements
|
9
|
+
end
|
10
|
+
|
11
|
+
def [](name)
|
12
|
+
@base[name]
|
13
|
+
end
|
14
|
+
|
15
|
+
def delete(spec)
|
16
|
+
@base.delete(spec)
|
17
|
+
end
|
18
|
+
|
19
|
+
def base_requirements
|
20
|
+
@base_requirements ||= build_base_requirements
|
21
|
+
end
|
22
|
+
|
23
|
+
def unlock_deps(deps)
|
24
|
+
exact, lower_bound = deps.partition(&:specific?)
|
25
|
+
|
26
|
+
exact.each do |exact_dep|
|
27
|
+
@base.delete_by_name_and_version(exact_dep.name, exact_dep.requirement.requirements.first.last)
|
28
|
+
end
|
29
|
+
|
30
|
+
lower_bound.each do |lower_bound_dep|
|
31
|
+
@additional_base_requirements.delete(lower_bound_dep)
|
32
|
+
end
|
33
|
+
|
34
|
+
@base_requirements = nil
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def build_base_requirements
|
40
|
+
base_requirements = {}
|
41
|
+
@base.each do |ls|
|
42
|
+
dep = Dependency.new(ls.name, ls.version)
|
43
|
+
base_requirements[ls.name] = DepProxy.get_proxy(dep, ls.platform)
|
44
|
+
end
|
45
|
+
@additional_base_requirements.each {|d| base_requirements[d.name] = d }
|
46
|
+
base_requirements
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -3,12 +3,11 @@
|
|
3
3
|
module Bundler
|
4
4
|
class Resolver
|
5
5
|
require_relative "vendored_molinillo"
|
6
|
+
require_relative "resolver/base"
|
6
7
|
require_relative "resolver/spec_group"
|
7
8
|
|
8
9
|
include GemHelpers
|
9
10
|
|
10
|
-
attr_writer :platforms
|
11
|
-
|
12
11
|
# Figures out the best possible configuration of gems that satisfies
|
13
12
|
# the list of passed dependencies and any child dependencies without
|
14
13
|
# causing any gem activation errors.
|
@@ -27,15 +26,13 @@ module Bundler
|
|
27
26
|
|
28
27
|
def initialize(source_requirements, base, gem_version_promoter, additional_base_requirements, platforms)
|
29
28
|
@source_requirements = source_requirements
|
30
|
-
@base = base
|
29
|
+
@base = Resolver::Base.new(base, additional_base_requirements)
|
31
30
|
@resolver = Molinillo::Resolver.new(self, self)
|
32
31
|
@results_for = {}
|
33
32
|
@search_for = {}
|
34
|
-
@additional_base_requirements = additional_base_requirements
|
35
33
|
@platforms = platforms
|
36
34
|
@resolving_only_for_ruby = platforms == [Gem::Platform::RUBY]
|
37
35
|
@gem_version_promoter = gem_version_promoter
|
38
|
-
@use_gvp = Bundler.feature_flag.use_gem_version_promoter_for_major_updates? || !@gem_version_promoter.major?
|
39
36
|
end
|
40
37
|
|
41
38
|
def start(requirements, exclude_specs: [])
|
@@ -45,18 +42,10 @@ module Bundler
|
|
45
42
|
remove_from_candidates(spec)
|
46
43
|
end
|
47
44
|
|
48
|
-
|
49
|
-
@base.each do |ls|
|
50
|
-
dep = Dependency.new(ls.name, ls.version)
|
51
|
-
@base_dg.add_vertex(ls.name, DepProxy.get_proxy(dep, ls.platform), true)
|
52
|
-
end
|
53
|
-
@additional_base_requirements.each {|d| @base_dg.add_vertex(d.name, d) }
|
54
|
-
|
55
|
-
@gem_version_promoter.prerelease_specified = @prerelease_specified = {}
|
56
|
-
requirements.each {|dep| @prerelease_specified[dep.name] ||= dep.prerelease? }
|
45
|
+
requirements.each {|dep| prerelease_specified[dep.name] ||= dep.prerelease? }
|
57
46
|
|
58
47
|
verify_gemfile_dependencies_are_found!(requirements)
|
59
|
-
result = @resolver.resolve(requirements
|
48
|
+
result = @resolver.resolve(requirements).
|
60
49
|
map(&:payload).
|
61
50
|
reject {|sg| sg.name.end_with?("\0") }.
|
62
51
|
map(&:to_specs).
|
@@ -64,8 +53,20 @@ module Bundler
|
|
64
53
|
|
65
54
|
SpecSet.new(SpecSet.new(result).for(regular_requirements, false, @platforms))
|
66
55
|
rescue Molinillo::VersionConflict => e
|
56
|
+
conflicts = e.conflicts
|
57
|
+
|
58
|
+
deps_to_unlock = conflicts.values.inject([]) do |deps, conflict|
|
59
|
+
deps |= conflict.requirement_trees.flatten.map {|req| base_requirements[req.name] }.compact
|
60
|
+
end
|
61
|
+
|
62
|
+
if deps_to_unlock.any?
|
63
|
+
@base.unlock_deps(deps_to_unlock)
|
64
|
+
reset_spec_cache
|
65
|
+
retry
|
66
|
+
end
|
67
|
+
|
67
68
|
message = version_conflict_message(e)
|
68
|
-
raise VersionConflict.new(
|
69
|
+
raise VersionConflict.new(conflicts.keys.uniq, message)
|
69
70
|
rescue Molinillo::CircularDependencyError => e
|
70
71
|
names = e.dependencies.sort_by(&:name).map {|d| "gem '#{d.name}'" }
|
71
72
|
raise CyclicDependencyError, "Your bundle requires gems that depend" \
|
@@ -120,31 +121,15 @@ module Bundler
|
|
120
121
|
dependency = dependency_proxy.dep
|
121
122
|
name = dependency.name
|
122
123
|
@search_for[dependency_proxy] ||= begin
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
end
|
124
|
+
locked_results = @base[name].select {|spec| requirement_satisfied_by?(dependency, nil, spec) }
|
125
|
+
locked_requirement = base_requirements[name]
|
126
|
+
results = results_for(dependency) + locked_results
|
127
|
+
results = results.select {|spec| requirement_satisfied_by?(locked_requirement, nil, spec) } if locked_requirement
|
128
128
|
|
129
|
-
if
|
130
|
-
|
131
|
-
# last during resolution.
|
132
|
-
pre, results = results.partition {|spec| spec.version.prerelease? }
|
133
|
-
results = pre + results
|
134
|
-
end
|
129
|
+
if results.any?
|
130
|
+
results = @gem_version_promoter.sort_versions(dependency, results)
|
135
131
|
|
136
|
-
|
137
|
-
nested = []
|
138
|
-
results.each do |spec|
|
139
|
-
version, specs = nested.last
|
140
|
-
if version == spec.version
|
141
|
-
specs << spec
|
142
|
-
else
|
143
|
-
nested << [spec.version, [spec]]
|
144
|
-
end
|
145
|
-
end
|
146
|
-
nested.reduce([]) do |groups, (version, specs)|
|
147
|
-
next groups if locked_requirement && !locked_requirement.satisfied_by?(version)
|
132
|
+
results.group_by(&:version).reduce([]) do |groups, (_, specs)|
|
148
133
|
next groups unless specs.any? {|spec| spec.match_platform(platform) }
|
149
134
|
|
150
135
|
specs_by_platform = Hash.new do |current_specs, current_platform|
|
@@ -167,13 +152,6 @@ module Bundler
|
|
167
152
|
else
|
168
153
|
[]
|
169
154
|
end
|
170
|
-
# GVP handles major itself, but it's still a bit risky to trust it with it
|
171
|
-
# until we get it settled with new behavior. For 2.x it can take over all cases.
|
172
|
-
if !@use_gvp
|
173
|
-
spec_groups
|
174
|
-
else
|
175
|
-
@gem_version_promoter.sort_versions(dependency, spec_groups)
|
176
|
-
end
|
177
155
|
end
|
178
156
|
end
|
179
157
|
|
@@ -199,12 +177,6 @@ module Bundler
|
|
199
177
|
"Gemfile"
|
200
178
|
end
|
201
179
|
|
202
|
-
def name_for_locking_dependency_source
|
203
|
-
Bundler.default_lockfile.basename.to_s
|
204
|
-
rescue StandardError
|
205
|
-
"Gemfile.lock"
|
206
|
-
end
|
207
|
-
|
208
180
|
def requirement_satisfied_by?(requirement, activated, spec)
|
209
181
|
requirement.matches_spec?(spec) || spec.source.is_a?(Source::Gemspec)
|
210
182
|
end
|
@@ -218,7 +190,7 @@ module Bundler
|
|
218
190
|
name = name_for(dependency)
|
219
191
|
vertex = activated.vertex_named(name)
|
220
192
|
[
|
221
|
-
@
|
193
|
+
@base[name].any? ? 0 : 1,
|
222
194
|
vertex.payload ? 0 : 1,
|
223
195
|
vertex.root? ? 0 : 1,
|
224
196
|
amount_constrained(dependency),
|
@@ -237,9 +209,16 @@ module Bundler
|
|
237
209
|
|
238
210
|
private
|
239
211
|
|
212
|
+
def base_requirements
|
213
|
+
@base.base_requirements
|
214
|
+
end
|
215
|
+
|
216
|
+
def prerelease_specified
|
217
|
+
@gem_version_promoter.prerelease_specified
|
218
|
+
end
|
219
|
+
|
240
220
|
def remove_from_candidates(spec)
|
241
221
|
@base.delete(spec)
|
242
|
-
@gem_version_promoter.reset
|
243
222
|
|
244
223
|
@results_for.keys.each do |dep|
|
245
224
|
next unless dep.name == spec.name
|
@@ -247,7 +226,12 @@ module Bundler
|
|
247
226
|
@results_for[dep].reject {|s| s.name == spec.name && s.version == spec.version }
|
248
227
|
end
|
249
228
|
|
229
|
+
reset_spec_cache
|
230
|
+
end
|
231
|
+
|
232
|
+
def reset_spec_cache
|
250
233
|
@search_for = {}
|
234
|
+
@gem_version_promoter.reset
|
251
235
|
end
|
252
236
|
|
253
237
|
# returns an integer \in (-\infty, 0]
|
@@ -267,7 +251,7 @@ module Bundler
|
|
267
251
|
all - 1_000_000
|
268
252
|
else
|
269
253
|
search = search_for(dependency)
|
270
|
-
search =
|
254
|
+
search = prerelease_specified[dependency.name] ? search.count : search.count {|s| !s.version.prerelease? }
|
271
255
|
search - all
|
272
256
|
end
|
273
257
|
end
|
@@ -296,7 +280,7 @@ module Bundler
|
|
296
280
|
end
|
297
281
|
|
298
282
|
def gem_not_found_message(name, requirement, source, extra_message = "")
|
299
|
-
specs = source.specs.search(name)
|
283
|
+
specs = source.specs.search(name).sort_by {|s| [s.version, s.platform.to_s] }
|
300
284
|
matching_part = name
|
301
285
|
requirement_label = SharedHelpers.pretty_dependency(requirement)
|
302
286
|
cache_message = begin
|
@@ -339,18 +323,6 @@ module Bundler
|
|
339
323
|
|
340
324
|
e.message_with_trees(
|
341
325
|
:full_message_for_conflict => lambda do |name, conflict|
|
342
|
-
o = if name.end_with?("\0")
|
343
|
-
String.new("Bundler found conflicting requirements for the #{name} version:")
|
344
|
-
else
|
345
|
-
String.new("Bundler could not find compatible versions for gem \"#{name}\":")
|
346
|
-
end
|
347
|
-
o << %(\n)
|
348
|
-
if conflict.locked_requirement
|
349
|
-
o << %( In snapshot (#{name_for_locking_dependency_source}):\n)
|
350
|
-
o << %( #{SharedHelpers.pretty_dependency(conflict.locked_requirement)}\n)
|
351
|
-
o << %(\n)
|
352
|
-
end
|
353
|
-
o << %( In #{name_for_explicit_dependency_source}:\n)
|
354
326
|
trees = conflict.requirement_trees
|
355
327
|
|
356
328
|
# called first, because we want to reduce the amount of work required to find maximal empty sets
|
@@ -369,30 +341,41 @@ module Bundler
|
|
369
341
|
trees.sort_by! {|t| t.reverse.map(&:name) }
|
370
342
|
end
|
371
343
|
|
372
|
-
|
373
|
-
|
374
|
-
|
344
|
+
if trees.size > 1 || name == "bundler"
|
345
|
+
o = if name.end_with?("\0")
|
346
|
+
String.new("Bundler found conflicting requirements for the #{name} version:")
|
347
|
+
else
|
348
|
+
String.new("Bundler could not find compatible versions for gem \"#{name}\":")
|
349
|
+
end
|
350
|
+
o << %(\n)
|
351
|
+
o << %( In #{name_for_explicit_dependency_source}:\n)
|
352
|
+
o << trees.map do |tree|
|
353
|
+
t = "".dup
|
354
|
+
depth = 2
|
375
355
|
|
376
|
-
|
377
|
-
|
356
|
+
base_tree = tree.first
|
357
|
+
base_tree_name = base_tree.name
|
378
358
|
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
359
|
+
if base_tree_name.end_with?("\0")
|
360
|
+
t = nil
|
361
|
+
else
|
362
|
+
tree.each do |req|
|
363
|
+
t << " " * depth << SharedHelpers.pretty_dependency(req)
|
364
|
+
unless tree.last == req
|
365
|
+
if spec = conflict.activated_by_name[req.name]
|
366
|
+
t << %( was resolved to #{spec.version}, which)
|
367
|
+
end
|
368
|
+
t << %( depends on)
|
387
369
|
end
|
388
|
-
t << %(
|
370
|
+
t << %(\n)
|
371
|
+
depth += 1
|
389
372
|
end
|
390
|
-
t << %(\n)
|
391
|
-
depth += 1
|
392
373
|
end
|
393
|
-
|
394
|
-
|
395
|
-
|
374
|
+
t
|
375
|
+
end.compact.join("\n")
|
376
|
+
else
|
377
|
+
o = String.new
|
378
|
+
end
|
396
379
|
|
397
380
|
if name == "bundler"
|
398
381
|
o << %(\n Current Bundler version:\n bundler (#{Bundler::VERSION}))
|
@@ -416,17 +399,13 @@ module Bundler
|
|
416
399
|
end
|
417
400
|
elsif name.end_with?("\0")
|
418
401
|
o << %(\n Current #{name} version:\n #{SharedHelpers.pretty_dependency(@metadata_requirements.find {|req| req.name == name })}\n\n)
|
419
|
-
elsif conflict.locked_requirement
|
420
|
-
o << "\n"
|
421
|
-
o << %(Deleting your #{name_for_locking_dependency_source} file and running `bundle install` will rebuild your snapshot from scratch, using only\n)
|
422
|
-
o << %(the gems in your Gemfile, which may resolve the conflict.\n)
|
423
402
|
elsif !conflict.existing
|
424
403
|
o << "\n"
|
425
404
|
|
426
405
|
relevant_source = conflict.requirement.source || source_for(name)
|
427
406
|
|
428
|
-
extra_message = if
|
429
|
-
", which is required by gem '#{SharedHelpers.pretty_dependency(
|
407
|
+
extra_message = if trees.first.size > 1
|
408
|
+
", which is required by gem '#{SharedHelpers.pretty_dependency(trees.first[-2])}',"
|
430
409
|
else
|
431
410
|
""
|
432
411
|
end
|
@@ -237,8 +237,11 @@ module Gem
|
|
237
237
|
MINGW = Gem::Platform.new("x86-mingw32")
|
238
238
|
X64_MINGW = [Gem::Platform.new("x64-mingw32"),
|
239
239
|
Gem::Platform.new("x64-mingw-ucrt")].freeze
|
240
|
+
WINDOWS = [MSWIN, MSWIN64, MINGW, X64_MINGW].flatten.freeze
|
241
|
+
X64_LINUX = Gem::Platform.new("x86_64-linux")
|
242
|
+
X64_LINUX_MUSL = Gem::Platform.new("x86_64-linux-musl")
|
240
243
|
|
241
|
-
if
|
244
|
+
if X64_LINUX === X64_LINUX_MUSL
|
242
245
|
remove_method :===
|
243
246
|
|
244
247
|
def ===(other)
|
@@ -258,10 +261,21 @@ module Gem
|
|
258
261
|
# version
|
259
262
|
(
|
260
263
|
(@os != "linux" && (@version.nil? || other.version.nil?)) ||
|
261
|
-
(@os == "linux" && (
|
264
|
+
(@os == "linux" && (normalized_linux_version_ext == other.normalized_linux_version_ext || ["musl#{@version}", "musleabi#{@version}", "musleabihf#{@version}"].include?(other.version))) ||
|
262
265
|
@version == other.version
|
263
266
|
)
|
264
267
|
end
|
268
|
+
|
269
|
+
# This is a copy of RubyGems 3.3.23 or higher `normalized_linux_method`.
|
270
|
+
# Once only 3.3.23 is supported, we can use the method in RubyGems.
|
271
|
+
def normalized_linux_version_ext
|
272
|
+
return nil unless @version
|
273
|
+
|
274
|
+
without_gnu_nor_abi_modifiers = @version.sub(/\Agnu/, "").sub(/eabi(hf)?\Z/, "")
|
275
|
+
return nil if without_gnu_nor_abi_modifiers.empty?
|
276
|
+
|
277
|
+
without_gnu_nor_abi_modifiers
|
278
|
+
end
|
265
279
|
end
|
266
280
|
end
|
267
281
|
|
@@ -274,14 +288,21 @@ module Gem
|
|
274
288
|
def match_gem?(platform, gem_name)
|
275
289
|
match_platforms?(platform, Gem.platforms)
|
276
290
|
end
|
291
|
+
end
|
292
|
+
|
293
|
+
match_platforms_defined = Gem::Platform.respond_to?(:match_platforms?, true)
|
294
|
+
|
295
|
+
if !match_platforms_defined || Gem::Platform.send(:match_platforms?, Gem::Platform::X64_LINUX_MUSL, [Gem::Platform::X64_LINUX])
|
277
296
|
|
278
297
|
private
|
279
298
|
|
299
|
+
remove_method :match_platforms? if match_platforms_defined
|
300
|
+
|
280
301
|
def match_platforms?(platform, platforms)
|
281
302
|
platforms.any? do |local_platform|
|
282
303
|
platform.nil? ||
|
283
304
|
local_platform == platform ||
|
284
|
-
(local_platform != Gem::Platform::RUBY &&
|
305
|
+
(local_platform != Gem::Platform::RUBY && platform =~ local_platform)
|
285
306
|
end
|
286
307
|
end
|
287
308
|
end
|
@@ -114,10 +114,20 @@ module Bundler
|
|
114
114
|
SpecSet.new(arr)
|
115
115
|
end
|
116
116
|
|
117
|
+
def -(other)
|
118
|
+
SpecSet.new(to_a - other.to_a)
|
119
|
+
end
|
120
|
+
|
117
121
|
def find_by_name_and_platform(name, platform)
|
118
122
|
@specs.detect {|spec| spec.name == name && spec.match_platform(platform) }
|
119
123
|
end
|
120
124
|
|
125
|
+
def delete_by_name_and_version(name, version)
|
126
|
+
@specs.reject! {|spec| spec.name == name && spec.version == version }
|
127
|
+
@lookup = nil
|
128
|
+
@sorted = nil
|
129
|
+
end
|
130
|
+
|
121
131
|
def what_required(spec)
|
122
132
|
unless req = find {|s| s.dependencies.any? {|d| d.type == :runtime && d.name == spec.name } }
|
123
133
|
return [spec]
|
@@ -166,7 +176,7 @@ module Bundler
|
|
166
176
|
def lookup
|
167
177
|
@lookup ||= begin
|
168
178
|
lookup = Hash.new {|h, k| h[k] = [] }
|
169
|
-
|
179
|
+
@specs.each do |s|
|
170
180
|
lookup[s.name] << s
|
171
181
|
end
|
172
182
|
lookup
|
@@ -1,8 +1,9 @@
|
|
1
|
-
|
1
|
+
default:
|
2
|
+
image: ruby:<%= RUBY_VERSION %>
|
2
3
|
|
3
|
-
before_script:
|
4
|
-
|
5
|
-
|
4
|
+
before_script:
|
5
|
+
- gem install bundler -v <%= Bundler::VERSION %>
|
6
|
+
- bundle install
|
6
7
|
|
7
8
|
example_job:
|
8
9
|
script:
|
@@ -201,7 +201,8 @@ module Gem::GemcutterUtilities
|
|
201
201
|
# block was given or shows the response body to the user.
|
202
202
|
#
|
203
203
|
# If the response was not successful, shows an error to the user including
|
204
|
-
# the +error_prefix+ and the response body.
|
204
|
+
# the +error_prefix+ and the response body. If the response was a permanent redirect,
|
205
|
+
# shows an error to the user including the redirect location.
|
205
206
|
|
206
207
|
def with_response(response, error_prefix = nil)
|
207
208
|
case response
|
@@ -211,6 +212,12 @@ module Gem::GemcutterUtilities
|
|
211
212
|
else
|
212
213
|
say clean_text(response.body)
|
213
214
|
end
|
215
|
+
when Net::HTTPPermanentRedirect, Net::HTTPRedirection then
|
216
|
+
message = "The request has redirected permanently to #{response['location']}. Please check your defined push host URL."
|
217
|
+
message = "#{error_prefix}: #{message}" if error_prefix
|
218
|
+
|
219
|
+
say clean_text(message)
|
220
|
+
terminate_interaction(ERROR_CODE)
|
214
221
|
else
|
215
222
|
message = response.body
|
216
223
|
message = "#{error_prefix}: #{message}" if error_prefix
|