bundler 2.5.16 → 2.6.2
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 +4 -4
- data/CHANGELOG.md +194 -0
- data/bundler.gemspec +2 -2
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/cli/add.rb +3 -1
- data/lib/bundler/cli/check.rb +3 -3
- data/lib/bundler/cli/console.rb +0 -4
- data/lib/bundler/cli/doctor.rb +4 -4
- data/lib/bundler/cli/exec.rb +1 -0
- data/lib/bundler/cli/gem.rb +6 -3
- data/lib/bundler/cli/info.rb +2 -2
- data/lib/bundler/cli/inject.rb +1 -1
- data/lib/bundler/cli/install.rb +13 -4
- data/lib/bundler/cli/lock.rb +25 -6
- data/lib/bundler/cli/outdated.rb +16 -18
- data/lib/bundler/cli/pristine.rb +1 -1
- data/lib/bundler/cli/show.rb +2 -2
- data/lib/bundler/cli.rb +38 -68
- data/lib/bundler/compact_index_client/cache_file.rb +0 -5
- data/lib/bundler/compact_index_client/updater.rb +0 -11
- data/lib/bundler/definition.rb +186 -119
- data/lib/bundler/dependency.rb +1 -1
- data/lib/bundler/dsl.rb +67 -52
- data/lib/bundler/endpoint_specification.rb +10 -1
- data/lib/bundler/errors.rb +17 -5
- data/lib/bundler/feature_flag.rb +1 -0
- data/lib/bundler/fetcher/compact_index.rb +1 -1
- data/lib/bundler/fetcher.rb +12 -5
- data/lib/bundler/force_platform.rb +0 -2
- data/lib/bundler/gem_helpers.rb +21 -5
- data/lib/bundler/injector.rb +2 -2
- data/lib/bundler/inline.rb +42 -17
- data/lib/bundler/installer/gem_installer.rb +4 -2
- data/lib/bundler/installer/parallel_installer.rb +3 -2
- data/lib/bundler/installer/standalone.rb +2 -2
- data/lib/bundler/installer.rb +11 -47
- data/lib/bundler/lazy_specification.rb +74 -26
- data/lib/bundler/lockfile_generator.rb +1 -1
- data/lib/bundler/lockfile_parser.rb +10 -2
- data/lib/bundler/man/bundle-add.1 +42 -25
- data/lib/bundler/man/bundle-add.1.ronn +52 -23
- data/lib/bundler/man/bundle-binstubs.1 +7 -4
- data/lib/bundler/man/bundle-binstubs.1.ronn +6 -3
- data/lib/bundler/man/bundle-cache.1 +30 -2
- data/lib/bundler/man/bundle-cache.1.ronn +31 -2
- data/lib/bundler/man/bundle-check.1 +3 -3
- data/lib/bundler/man/bundle-check.1.ronn +4 -2
- data/lib/bundler/man/bundle-clean.1 +1 -1
- data/lib/bundler/man/bundle-config.1 +3 -5
- data/lib/bundler/man/bundle-config.1.ronn +2 -7
- data/lib/bundler/man/bundle-console.1 +2 -4
- data/lib/bundler/man/bundle-console.1.ronn +2 -7
- data/lib/bundler/man/bundle-doctor.1 +2 -2
- data/lib/bundler/man/bundle-doctor.1.ronn +1 -1
- data/lib/bundler/man/bundle-env.1 +9 -0
- data/lib/bundler/man/bundle-env.1.ronn +10 -0
- data/lib/bundler/man/bundle-exec.1 +5 -2
- data/lib/bundler/man/bundle-exec.1.ronn +4 -1
- data/lib/bundler/man/bundle-fund.1 +22 -0
- data/lib/bundler/man/bundle-fund.1.ronn +25 -0
- data/lib/bundler/man/bundle-gem.1 +17 -5
- data/lib/bundler/man/bundle-gem.1.ronn +27 -6
- data/lib/bundler/man/bundle-help.1 +1 -1
- data/lib/bundler/man/bundle-info.1 +5 -2
- data/lib/bundler/man/bundle-info.1.ronn +6 -2
- data/lib/bundler/man/bundle-init.1 +3 -3
- data/lib/bundler/man/bundle-init.1.ronn +3 -2
- data/lib/bundler/man/bundle-inject.1 +10 -2
- data/lib/bundler/man/bundle-inject.1.ronn +9 -1
- data/lib/bundler/man/bundle-install.1 +15 -12
- data/lib/bundler/man/bundle-install.1.ronn +22 -18
- data/lib/bundler/man/bundle-issue.1 +45 -0
- data/lib/bundler/man/bundle-issue.1.ronn +37 -0
- data/lib/bundler/man/bundle-licenses.1 +9 -0
- data/lib/bundler/man/bundle-licenses.1.ronn +10 -0
- data/lib/bundler/man/bundle-list.1 +1 -1
- data/lib/bundler/man/bundle-list.1.ronn +4 -1
- data/lib/bundler/man/bundle-lock.1 +21 -6
- data/lib/bundler/man/bundle-lock.1.ronn +25 -4
- data/lib/bundler/man/bundle-open.1 +2 -2
- data/lib/bundler/man/bundle-open.1.ronn +2 -1
- data/lib/bundler/man/bundle-outdated.1 +8 -5
- data/lib/bundler/man/bundle-outdated.1.ronn +8 -4
- data/lib/bundler/man/bundle-platform.1 +1 -1
- data/lib/bundler/man/bundle-plugin.1 +1 -1
- data/lib/bundler/man/bundle-pristine.1 +1 -1
- data/lib/bundler/man/bundle-pristine.1.ronn +1 -1
- data/lib/bundler/man/bundle-remove.1 +1 -1
- data/lib/bundler/man/bundle-remove.1.ronn +1 -1
- data/lib/bundler/man/bundle-show.1 +5 -2
- data/lib/bundler/man/bundle-show.1.ronn +4 -0
- data/lib/bundler/man/bundle-update.1 +13 -7
- data/lib/bundler/man/bundle-update.1.ronn +14 -6
- data/lib/bundler/man/bundle-version.1 +1 -1
- data/lib/bundler/man/bundle-viz.1 +4 -4
- data/lib/bundler/man/bundle-viz.1.ronn +7 -3
- data/lib/bundler/man/bundle.1 +1 -1
- data/lib/bundler/man/gemfile.5 +3 -1
- data/lib/bundler/man/gemfile.5.ronn +6 -0
- data/lib/bundler/man/index.txt +4 -0
- data/lib/bundler/materialization.rb +59 -0
- data/lib/bundler/plugin/api/source.rb +2 -1
- data/lib/bundler/plugin/events.rb +24 -0
- data/lib/bundler/plugin/installer.rb +1 -1
- data/lib/bundler/plugin.rb +20 -1
- data/lib/bundler/process_lock.rb +10 -14
- data/lib/bundler/remote_specification.rb +6 -1
- data/lib/bundler/resolver/base.rb +12 -6
- data/lib/bundler/resolver/candidate.rb +2 -2
- data/lib/bundler/resolver/package.rb +10 -1
- data/lib/bundler/resolver/spec_group.rb +4 -3
- data/lib/bundler/resolver.rb +36 -14
- data/lib/bundler/retry.rb +1 -1
- data/lib/bundler/ruby_version.rb +7 -1
- data/lib/bundler/rubygems_ext.rb +104 -51
- data/lib/bundler/rubygems_gem_installer.rb +7 -5
- data/lib/bundler/rubygems_integration.rb +23 -62
- data/lib/bundler/runtime.rb +22 -7
- data/lib/bundler/self_manager.rb +7 -7
- data/lib/bundler/settings.rb +6 -1
- data/lib/bundler/shared_helpers.rb +29 -17
- data/lib/bundler/source/git/git_proxy.rb +0 -2
- data/lib/bundler/source/git.rb +93 -40
- data/lib/bundler/source/metadata.rb +2 -3
- data/lib/bundler/source/path.rb +5 -3
- data/lib/bundler/source/rubygems.rb +6 -16
- data/lib/bundler/source_list.rb +1 -1
- data/lib/bundler/spec_set.rb +82 -57
- data/lib/bundler/stub_specification.rb +21 -2
- data/lib/bundler/templates/newgem/Gemfile.tt +0 -3
- data/lib/bundler/templates/newgem/README.md.tt +7 -3
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +15 -15
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +4 -4
- data/lib/bundler/ui/shell.rb +24 -2
- data/lib/bundler/ui/silent.rb +12 -1
- data/lib/bundler/uri_credentials_filter.rb +1 -1
- data/lib/bundler/vendor/fileutils/COPYING +56 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +15 -13
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +46 -8
- data/lib/bundler/vendor/securerandom/.document +1 -0
- data/lib/bundler/vendor/securerandom/COPYING +56 -0
- data/lib/bundler/vendor/securerandom/lib/securerandom.rb +102 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +3 -5
- data/lib/bundler/vendor/thor/lib/thor/group.rb +11 -0
- data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +1 -4
- data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +2 -1
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +9 -9
- data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +5 -21
- data/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor.rb +11 -0
- data/lib/bundler/vendor/uri/COPYING +56 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +37 -14
- data/lib/bundler/vendor/uri/lib/uri/file.rb +3 -3
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +16 -26
- data/lib/bundler/vendor/uri/lib/uri/http.rb +2 -2
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +10 -3
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +26 -3
- data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri.rb +9 -9
- data/lib/bundler/vendored_securerandom.rb +12 -0
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/yaml_serializer.rb +1 -1
- data/lib/bundler.rb +68 -36
- metadata +20 -10
- data/lib/bundler/vendor/fileutils/LICENSE.txt +0 -22
- data/lib/bundler/vendor/uri/LICENSE.txt +0 -22
@@ -10,9 +10,11 @@ bundle-update(1) -- Update your gems to the latest available versions
|
|
10
10
|
[--ruby]
|
11
11
|
[--bundler[=VERSION]]
|
12
12
|
[--full-index]
|
13
|
-
[--
|
13
|
+
[--gemfile=GEMFILE]
|
14
|
+
[--jobs=NUMBER]
|
14
15
|
[--quiet]
|
15
16
|
[--patch|--minor|--major]
|
17
|
+
[--pre]
|
16
18
|
[--redownload]
|
17
19
|
[--strict]
|
18
20
|
[--conservative]
|
@@ -32,13 +34,13 @@ gem.
|
|
32
34
|
* `--all`:
|
33
35
|
Update all gems specified in Gemfile.
|
34
36
|
|
35
|
-
* `--group=<
|
37
|
+
* `--group=<list>`, `-g=<list>`:
|
36
38
|
Only update the gems in the specified group. For instance, you can update all gems
|
37
39
|
in the development group with `bundle update --group development`. You can also
|
38
40
|
call `bundle update rails --group test` to update the rails gem and all gems in
|
39
41
|
the test group, for example.
|
40
42
|
|
41
|
-
* `--source=<
|
43
|
+
* `--source=<list>`:
|
42
44
|
The name of a `:git` or `:path` source used in the Gemfile(5). For
|
43
45
|
instance, with a `:git` source of `http://github.com/rails/rails.git`,
|
44
46
|
you would call `bundle update --source rails`
|
@@ -49,13 +51,16 @@ gem.
|
|
49
51
|
* `--ruby`:
|
50
52
|
Update the locked version of Ruby to the current version of Ruby.
|
51
53
|
|
52
|
-
* `--bundler`:
|
54
|
+
* `--bundler[=BUNDLER]`:
|
53
55
|
Update the locked version of bundler to the invoked bundler version.
|
54
56
|
|
55
57
|
* `--full-index`:
|
56
58
|
Fall back to using the single-file index of all gems.
|
57
59
|
|
58
|
-
* `--
|
60
|
+
* `--gemfile=GEMFILE`:
|
61
|
+
Use the specified gemfile instead of [`Gemfile(5)`][Gemfile(5)].
|
62
|
+
|
63
|
+
* `--jobs=<number>`, `-j=<number>`:
|
59
64
|
Specify the number of jobs to run in parallel. The default is the number of
|
60
65
|
available processors.
|
61
66
|
|
@@ -65,7 +70,7 @@ gem.
|
|
65
70
|
* `--quiet`:
|
66
71
|
Only output warnings and errors.
|
67
72
|
|
68
|
-
* `--redownload`:
|
73
|
+
* `--redownload`, `--force`:
|
69
74
|
Force downloading every gem.
|
70
75
|
|
71
76
|
* `--patch`:
|
@@ -77,6 +82,9 @@ gem.
|
|
77
82
|
* `--major`:
|
78
83
|
Prefer updating to next major version (default).
|
79
84
|
|
85
|
+
* `--pre`:
|
86
|
+
Always choose the highest allowed version, regardless of prerelease status.
|
87
|
+
|
80
88
|
* `--strict`:
|
81
89
|
Do not allow any gem to be updated past latest `--patch` | `--minor` | `--major`.
|
82
90
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.\" generated with nRonn/v0.11.1
|
2
2
|
.\" https://github.com/n-ronn/nronn/tree/0.11.1
|
3
|
-
.TH "BUNDLE\-VIZ" "1" "
|
3
|
+
.TH "BUNDLE\-VIZ" "1" "December 2024" ""
|
4
4
|
.SH "NAME"
|
5
5
|
\fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile
|
6
6
|
.SH "SYNOPSIS"
|
@@ -13,10 +13,10 @@ The associated gems must also be installed via \fBbundle install(1)\fR \fIbundle
|
|
13
13
|
\fBviz\fR command was deprecated in Bundler 2\.2\. Use bundler\-graph plugin \fIhttps://github\.com/rubygems/bundler\-graph\fR instead\.
|
14
14
|
.SH "OPTIONS"
|
15
15
|
.TP
|
16
|
-
\fB\-\-file\fR, \fB\-f\fR
|
16
|
+
\fB\-\-file=FILE\fR, \fB\-f=FILE\fR
|
17
17
|
The name to use for the generated file\. See \fB\-\-format\fR option
|
18
18
|
.TP
|
19
|
-
\fB\-\-format\fR, \fB\-F\fR
|
19
|
+
\fB\-\-format=FORMAT\fR, \fB\-F=FORMAT\fR
|
20
20
|
This is output format option\. Supported format is png, jpg, svg, dot \|\.\|\.\|\.
|
21
21
|
.TP
|
22
22
|
\fB\-\-requirements\fR, \fB\-R\fR
|
@@ -25,6 +25,6 @@ Set to show the version of each required dependency\.
|
|
25
25
|
\fB\-\-version\fR, \fB\-v\fR
|
26
26
|
Set to show each gem version\.
|
27
27
|
.TP
|
28
|
-
\fB\-\-without
|
28
|
+
\fB\-\-without=<list>\fR, \fB\-W=<list>\fR
|
29
29
|
Exclude gems that are part of the specified named group\.
|
30
30
|
|
@@ -20,13 +20,17 @@ The associated gems must also be installed via [`bundle install(1)`](bundle-inst
|
|
20
20
|
|
21
21
|
## OPTIONS
|
22
22
|
|
23
|
-
* `--file`, `-f`:
|
23
|
+
* `--file=FILE`, `-f=FILE`:
|
24
24
|
The name to use for the generated file. See `--format` option
|
25
|
-
|
25
|
+
|
26
|
+
* `--format=FORMAT`, `-F=FORMAT`:
|
26
27
|
This is output format option. Supported format is png, jpg, svg, dot ...
|
28
|
+
|
27
29
|
* `--requirements`, `-R`:
|
28
30
|
Set to show the version of each required dependency.
|
31
|
+
|
29
32
|
* `--version`, `-v`:
|
30
33
|
Set to show each gem version.
|
31
|
-
|
34
|
+
|
35
|
+
* `--without=<list>`, `-W=<list>`:
|
32
36
|
Exclude gems that are part of the specified named group.
|
data/lib/bundler/man/bundle.1
CHANGED
data/lib/bundler/man/gemfile.5
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
.\" generated with nRonn/v0.11.1
|
2
2
|
.\" https://github.com/n-ronn/nronn/tree/0.11.1
|
3
|
-
.TH "GEMFILE" "5" "
|
3
|
+
.TH "GEMFILE" "5" "December 2024" ""
|
4
4
|
.SH "NAME"
|
5
5
|
\fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
|
6
6
|
.SH "SYNOPSIS"
|
@@ -216,6 +216,8 @@ The following platform values are deprecated and should be replaced with \fBwind
|
|
216
216
|
.IP "\(bu" 4
|
217
217
|
\fBmswin\fR, \fBmswin64\fR, \fBmingw32\fR, \fBx64_mingw\fR
|
218
218
|
.IP "" 0
|
219
|
+
.P
|
220
|
+
Note that, while unfortunately using the same terminology, the values of this option are different from the values that \fBbundle lock \-\-add\-platform\fR can take\. The values of this option are more closer to "Ruby Implementation" while the values that \fBbundle lock \-\-add\-platform\fR understands are more related to OS and architecture of the different systems where your lockfile will be used\.
|
219
221
|
.SS "FORCE_RUBY_PLATFORM"
|
220
222
|
If you always want the pure ruby variant of a gem to be chosen over platform specific variants, you can use the \fBforce_ruby_platform\fR option:
|
221
223
|
.IP "" 4
|
@@ -242,6 +242,12 @@ The following platform values are deprecated and should be replaced with `window
|
|
242
242
|
|
243
243
|
* `mswin`, `mswin64`, `mingw32`, `x64_mingw`
|
244
244
|
|
245
|
+
Note that, while unfortunately using the same terminology, the values of this
|
246
|
+
option are different from the values that `bundle lock --add-platform` can take.
|
247
|
+
The values of this option are more closer to "Ruby Implementation" while the
|
248
|
+
values that `bundle lock --add-platform` understands are more related to OS and
|
249
|
+
architecture of the different systems where your lockfile will be used.
|
250
|
+
|
245
251
|
### FORCE_RUBY_PLATFORM
|
246
252
|
|
247
253
|
If you always want the pure ruby variant of a gem to be chosen over platform
|
data/lib/bundler/man/index.txt
CHANGED
@@ -8,13 +8,17 @@ bundle-clean(1) bundle-clean.1
|
|
8
8
|
bundle-config(1) bundle-config.1
|
9
9
|
bundle-console(1) bundle-console.1
|
10
10
|
bundle-doctor(1) bundle-doctor.1
|
11
|
+
bundle-env(1) bundle-env.1
|
11
12
|
bundle-exec(1) bundle-exec.1
|
13
|
+
bundle-fund(1) bundle-fund.1
|
12
14
|
bundle-gem(1) bundle-gem.1
|
13
15
|
bundle-help(1) bundle-help.1
|
14
16
|
bundle-info(1) bundle-info.1
|
15
17
|
bundle-init(1) bundle-init.1
|
16
18
|
bundle-inject(1) bundle-inject.1
|
17
19
|
bundle-install(1) bundle-install.1
|
20
|
+
bundle-issue(1) bundle-issue.1
|
21
|
+
bundle-licenses(1) bundle-licenses.1
|
18
22
|
bundle-list(1) bundle-list.1
|
19
23
|
bundle-lock(1) bundle-lock.1
|
20
24
|
bundle-open(1) bundle-open.1
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
#
|
5
|
+
# This class materializes a set of resolved specifications (`LazySpecification`)
|
6
|
+
# for a given gem into the most appropriate real specifications
|
7
|
+
# (`StubSepecification`, `EndpointSpecification`, etc), given a dependency and a
|
8
|
+
# target platform.
|
9
|
+
#
|
10
|
+
class Materialization
|
11
|
+
def initialize(dep, platform, candidates:)
|
12
|
+
@dep = dep
|
13
|
+
@platform = platform
|
14
|
+
@candidates = candidates
|
15
|
+
end
|
16
|
+
|
17
|
+
def complete?
|
18
|
+
specs.any?
|
19
|
+
end
|
20
|
+
|
21
|
+
def specs
|
22
|
+
@specs ||= if @candidates.nil?
|
23
|
+
[]
|
24
|
+
elsif platform
|
25
|
+
GemHelpers.select_best_platform_match(@candidates, platform, force_ruby: dep.force_ruby_platform)
|
26
|
+
else
|
27
|
+
GemHelpers.select_best_local_platform_match(@candidates, force_ruby: dep.force_ruby_platform || dep.default_force_ruby_platform)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def dependencies
|
32
|
+
specs.first.runtime_dependencies.map {|d| [d, platform] }
|
33
|
+
end
|
34
|
+
|
35
|
+
def materialized_spec
|
36
|
+
specs.reject(&:missing?).first&.materialization
|
37
|
+
end
|
38
|
+
|
39
|
+
def completely_missing_specs
|
40
|
+
return [] unless specs.all?(&:missing?)
|
41
|
+
|
42
|
+
specs
|
43
|
+
end
|
44
|
+
|
45
|
+
def partially_missing_specs
|
46
|
+
specs.select(&:missing?)
|
47
|
+
end
|
48
|
+
|
49
|
+
def incomplete_specs
|
50
|
+
return [] if complete?
|
51
|
+
|
52
|
+
@candidates || LazySpecification.new(dep.name, nil, nil)
|
53
|
+
end
|
54
|
+
|
55
|
+
private
|
56
|
+
|
57
|
+
attr_reader :dep, :platform
|
58
|
+
end
|
59
|
+
end
|
@@ -131,7 +131,7 @@ module Bundler
|
|
131
131
|
Bundler::Index.build do |index|
|
132
132
|
files.each do |file|
|
133
133
|
next unless spec = Bundler.load_gemspec(file)
|
134
|
-
|
134
|
+
spec.installed_by_version = Gem::VERSION
|
135
135
|
|
136
136
|
spec.source = self
|
137
137
|
Bundler.rubygems.validate(spec)
|
@@ -196,6 +196,7 @@ module Bundler
|
|
196
196
|
|
197
197
|
FileUtils.rm_rf(new_cache_path)
|
198
198
|
FileUtils.cp_r(install_path, new_cache_path)
|
199
|
+
FileUtils.rm_rf(app_cache_path.join(".git"))
|
199
200
|
FileUtils.touch(app_cache_path.join(".bundlecache"))
|
200
201
|
end
|
201
202
|
|
@@ -56,6 +56,30 @@ module Bundler
|
|
56
56
|
# Includes an Array of Bundler::Dependency objects
|
57
57
|
# GEM_AFTER_INSTALL_ALL = "after-install-all"
|
58
58
|
define :GEM_AFTER_INSTALL_ALL, "after-install-all"
|
59
|
+
|
60
|
+
# @!parse
|
61
|
+
# A hook called before each individual gem is required
|
62
|
+
# Includes a Bundler::Dependency.
|
63
|
+
# GEM_BEFORE_REQUIRE = "before-require"
|
64
|
+
define :GEM_BEFORE_REQUIRE, "before-require"
|
65
|
+
|
66
|
+
# @!parse
|
67
|
+
# A hook called after each individual gem is required
|
68
|
+
# Includes a Bundler::Dependency.
|
69
|
+
# GEM_AFTER_REQUIRE = "after-require"
|
70
|
+
define :GEM_AFTER_REQUIRE, "after-require"
|
71
|
+
|
72
|
+
# @!parse
|
73
|
+
# A hook called before any gems require
|
74
|
+
# Includes an Array of Bundler::Dependency objects.
|
75
|
+
# GEM_BEFORE_REQUIRE_ALL = "before-require-all"
|
76
|
+
define :GEM_BEFORE_REQUIRE_ALL, "before-require-all"
|
77
|
+
|
78
|
+
# @!parse
|
79
|
+
# A hook called after all gems required
|
80
|
+
# Includes an Array of Bundler::Dependency objects.
|
81
|
+
# GEM_AFTER_REQUIRE_ALL = "after-require-all"
|
82
|
+
define :GEM_AFTER_REQUIRE_ALL, "after-require-all"
|
59
83
|
end
|
60
84
|
end
|
61
85
|
end
|
@@ -34,7 +34,7 @@ module Bundler
|
|
34
34
|
# @return [Hash] map of names to their specs they are installed with
|
35
35
|
def install_definition(definition)
|
36
36
|
def definition.lock(*); end
|
37
|
-
definition.
|
37
|
+
definition.remotely!
|
38
38
|
specs = definition.specs
|
39
39
|
|
40
40
|
install_from_specs specs
|
data/lib/bundler/plugin.rb
CHANGED
@@ -342,7 +342,26 @@ module Bundler
|
|
342
342
|
# done to avoid conflicts
|
343
343
|
path = index.plugin_path(name)
|
344
344
|
|
345
|
-
|
345
|
+
paths = index.load_paths(name)
|
346
|
+
invalid_paths = paths.reject {|p| File.directory?(p) }
|
347
|
+
|
348
|
+
if invalid_paths.any?
|
349
|
+
Bundler.ui.warn <<~MESSAGE
|
350
|
+
The following plugin paths don't exist: #{invalid_paths.join(", ")}.
|
351
|
+
|
352
|
+
This can happen if the plugin was installed with a different version of Ruby that has since been uninstalled.
|
353
|
+
|
354
|
+
If you would like to reinstall the plugin, run:
|
355
|
+
|
356
|
+
bundler plugin uninstall #{name} && bundler plugin install #{name}
|
357
|
+
|
358
|
+
Continuing without installing plugin #{name}.
|
359
|
+
MESSAGE
|
360
|
+
|
361
|
+
return
|
362
|
+
end
|
363
|
+
|
364
|
+
Gem.add_to_load_path(*paths)
|
346
365
|
|
347
366
|
load path.join(PLUGIN_FILE_NAME)
|
348
367
|
|
data/lib/bundler/process_lock.rb
CHANGED
@@ -2,23 +2,19 @@
|
|
2
2
|
|
3
3
|
module Bundler
|
4
4
|
class ProcessLock
|
5
|
-
def self.lock(bundle_path = Bundler.bundle_path)
|
5
|
+
def self.lock(bundle_path = Bundler.bundle_path, &block)
|
6
6
|
lock_file_path = File.join(bundle_path, "bundler.lock")
|
7
|
-
|
7
|
+
base_lock_file_path = lock_file_path.delete_suffix(".lock")
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
9
|
+
require "fileutils" if Bundler.rubygems.provides?("< 3.6.0")
|
10
|
+
|
11
|
+
begin
|
12
|
+
SharedHelpers.filesystem_access(lock_file_path, :write) do
|
13
|
+
Gem.open_file_with_lock(base_lock_file_path, &block)
|
14
|
+
end
|
15
|
+
rescue PermissionError
|
16
|
+
block.call
|
14
17
|
end
|
15
|
-
rescue Errno::EACCES, Errno::ENOLCK, Errno::ENOTSUP, Errno::EPERM, Errno::EROFS
|
16
|
-
# In the case the user does not have access to
|
17
|
-
# create the lock file or is using NFS where
|
18
|
-
# locks are not available we skip locking.
|
19
|
-
yield
|
20
|
-
ensure
|
21
|
-
FileUtils.rm_f(lock_file_path) if has_lock
|
22
18
|
end
|
23
19
|
end
|
24
20
|
end
|
@@ -12,7 +12,7 @@ module Bundler
|
|
12
12
|
|
13
13
|
attr_reader :name, :version, :platform
|
14
14
|
attr_writer :dependencies
|
15
|
-
attr_accessor :source, :remote
|
15
|
+
attr_accessor :source, :remote, :locked_platform
|
16
16
|
|
17
17
|
def initialize(name, version, platform, spec_fetcher)
|
18
18
|
@name = name
|
@@ -21,6 +21,11 @@ module Bundler
|
|
21
21
|
@platform = Gem::Platform.new(platform)
|
22
22
|
@spec_fetcher = spec_fetcher
|
23
23
|
@dependencies = nil
|
24
|
+
@locked_platform = nil
|
25
|
+
end
|
26
|
+
|
27
|
+
def insecurely_materialized?
|
28
|
+
@locked_platform.to_s != @platform.to_s
|
24
29
|
end
|
25
30
|
|
26
31
|
# Needed before installs, since the arch matters then and quick
|
@@ -16,7 +16,7 @@ module Bundler
|
|
16
16
|
hash[name] = Package.new(name, platforms, **options)
|
17
17
|
end
|
18
18
|
|
19
|
-
@requirements = dependencies.
|
19
|
+
@requirements = dependencies.filter_map do |dep|
|
20
20
|
dep_platforms = dep.gem_platforms(platforms)
|
21
21
|
|
22
22
|
# Dependencies scoped to external platforms are ignored
|
@@ -27,11 +27,7 @@ module Bundler
|
|
27
27
|
@packages[name] = Package.new(name, dep_platforms, **options.merge(dependency: dep))
|
28
28
|
|
29
29
|
dep
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def specs_compatible_with(result)
|
34
|
-
@base.specs_compatible_with(result)
|
30
|
+
end
|
35
31
|
end
|
36
32
|
|
37
33
|
def [](name)
|
@@ -72,6 +68,12 @@ module Bundler
|
|
72
68
|
end
|
73
69
|
end
|
74
70
|
|
71
|
+
def include_remote_specs(names)
|
72
|
+
names.each do |name|
|
73
|
+
get_package(name).consider_remote_versions!
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
75
77
|
private
|
76
78
|
|
77
79
|
def indirect_pins(names)
|
@@ -101,6 +103,10 @@ module Bundler
|
|
101
103
|
def build_base_requirements
|
102
104
|
base_requirements = {}
|
103
105
|
@base.each do |ls|
|
106
|
+
if ls.source_changed? && ls.source.specs.search(ls.name).empty?
|
107
|
+
raise GemNotFound, "Could not find gem '#{ls.name}' in #{ls.source}"
|
108
|
+
end
|
109
|
+
|
104
110
|
req = Gem::Requirement.new(ls.version)
|
105
111
|
base_requirements[ls.name] = req
|
106
112
|
end
|
@@ -34,10 +34,10 @@ module Bundler
|
|
34
34
|
@spec_group.dependencies
|
35
35
|
end
|
36
36
|
|
37
|
-
def to_specs(package)
|
37
|
+
def to_specs(package, most_specific_locked_platform)
|
38
38
|
return [] if package.meta?
|
39
39
|
|
40
|
-
@spec_group.to_specs(package.force_ruby_platform
|
40
|
+
@spec_group.to_specs(package.force_ruby_platform?, most_specific_locked_platform)
|
41
41
|
end
|
42
42
|
|
43
43
|
def prerelease?
|
@@ -15,7 +15,7 @@ module Bundler
|
|
15
15
|
class Package
|
16
16
|
attr_reader :name, :platforms, :dependency, :locked_version
|
17
17
|
|
18
|
-
def initialize(name, platforms, locked_specs:, unlock:, prerelease: false, dependency: nil)
|
18
|
+
def initialize(name, platforms, locked_specs:, unlock:, prerelease: false, prefer_local: false, dependency: nil)
|
19
19
|
@name = name
|
20
20
|
@platforms = platforms
|
21
21
|
@locked_version = locked_specs[name].first&.version
|
@@ -23,6 +23,7 @@ module Bundler
|
|
23
23
|
@dependency = dependency || Dependency.new(name, @locked_version)
|
24
24
|
@top_level = !dependency.nil?
|
25
25
|
@prerelease = @dependency.prerelease? || @locked_version&.prerelease? || prerelease ? :consider_first : :ignore
|
26
|
+
@prefer_local = prefer_local
|
26
27
|
end
|
27
28
|
|
28
29
|
def platform_specs(specs)
|
@@ -69,6 +70,14 @@ module Bundler
|
|
69
70
|
@prerelease = :consider_last
|
70
71
|
end
|
71
72
|
|
73
|
+
def prefer_local?
|
74
|
+
@prefer_local
|
75
|
+
end
|
76
|
+
|
77
|
+
def consider_remote_versions!
|
78
|
+
@prefer_local = false
|
79
|
+
end
|
80
|
+
|
72
81
|
def force_ruby_platform?
|
73
82
|
@dependency.force_ruby_platform
|
74
83
|
end
|
@@ -25,10 +25,11 @@ module Bundler
|
|
25
25
|
@source ||= exemplary_spec.source
|
26
26
|
end
|
27
27
|
|
28
|
-
def to_specs(force_ruby_platform)
|
28
|
+
def to_specs(force_ruby_platform, most_specific_locked_platform)
|
29
29
|
@specs.map do |s|
|
30
30
|
lazy_spec = LazySpecification.from_spec(s)
|
31
31
|
lazy_spec.force_ruby_platform = force_ruby_platform
|
32
|
+
lazy_spec.most_specific_locked_platform = most_specific_locked_platform
|
32
33
|
lazy_spec
|
33
34
|
end
|
34
35
|
end
|
@@ -38,9 +39,9 @@ module Bundler
|
|
38
39
|
end
|
39
40
|
|
40
41
|
def dependencies
|
41
|
-
@dependencies ||= @specs.
|
42
|
+
@dependencies ||= @specs.flat_map do |spec|
|
42
43
|
__dependencies(spec) + metadata_dependencies(spec)
|
43
|
-
end.
|
44
|
+
end.uniq.sort
|
44
45
|
end
|
45
46
|
|
46
47
|
def ==(other)
|
data/lib/bundler/resolver.rb
CHANGED
@@ -15,10 +15,11 @@ module Bundler
|
|
15
15
|
|
16
16
|
include GemHelpers
|
17
17
|
|
18
|
-
def initialize(base, gem_version_promoter)
|
18
|
+
def initialize(base, gem_version_promoter, most_specific_locked_platform = nil)
|
19
19
|
@source_requirements = base.source_requirements
|
20
20
|
@base = base
|
21
21
|
@gem_version_promoter = gem_version_promoter
|
22
|
+
@most_specific_locked_platform = most_specific_locked_platform
|
22
23
|
end
|
23
24
|
|
24
25
|
def start
|
@@ -79,14 +80,13 @@ module Bundler
|
|
79
80
|
def solve_versions(root:, logger:)
|
80
81
|
solver = PubGrub::VersionSolver.new(source: self, root: root, logger: logger)
|
81
82
|
result = solver.solve
|
82
|
-
|
83
|
-
resolved_specs |= @base.specs_compatible_with(SpecSet.new(resolved_specs))
|
83
|
+
result.flat_map {|package, version| version.to_specs(package, @most_specific_locked_platform) }
|
84
84
|
rescue PubGrub::SolveFailure => e
|
85
85
|
incompatibility = e.incompatibility
|
86
86
|
|
87
|
-
names_to_unlock, names_to_allow_prereleases_for, extended_explanation = find_names_to_relax(incompatibility)
|
87
|
+
names_to_unlock, names_to_allow_prereleases_for, names_to_allow_remote_specs_for, extended_explanation = find_names_to_relax(incompatibility)
|
88
88
|
|
89
|
-
names_to_relax = names_to_unlock + names_to_allow_prereleases_for
|
89
|
+
names_to_relax = names_to_unlock + names_to_allow_prereleases_for + names_to_allow_remote_specs_for
|
90
90
|
|
91
91
|
if names_to_relax.any?
|
92
92
|
if names_to_unlock.any?
|
@@ -96,11 +96,17 @@ module Bundler
|
|
96
96
|
end
|
97
97
|
|
98
98
|
if names_to_allow_prereleases_for.any?
|
99
|
-
Bundler.ui.debug "Found conflicts with dependencies with prereleases. Will
|
99
|
+
Bundler.ui.debug "Found conflicts with dependencies with prereleases. Will retry considering prereleases for #{names_to_allow_prereleases_for.join(", ")}...", true
|
100
100
|
|
101
101
|
@base.include_prereleases(names_to_allow_prereleases_for)
|
102
102
|
end
|
103
103
|
|
104
|
+
if names_to_allow_remote_specs_for.any?
|
105
|
+
Bundler.ui.debug "Found conflicts with local versions of #{names_to_allow_remote_specs_for.join(", ")}. Will retry considering remote versions...", true
|
106
|
+
|
107
|
+
@base.include_remote_specs(names_to_allow_remote_specs_for)
|
108
|
+
end
|
109
|
+
|
104
110
|
root, logger = setup_solver
|
105
111
|
|
106
112
|
Bundler.ui.debug "Retrying resolution...", true
|
@@ -120,6 +126,7 @@ module Bundler
|
|
120
126
|
def find_names_to_relax(incompatibility)
|
121
127
|
names_to_unlock = []
|
122
128
|
names_to_allow_prereleases_for = []
|
129
|
+
names_to_allow_remote_specs_for = []
|
123
130
|
extended_explanation = nil
|
124
131
|
|
125
132
|
while incompatibility.conflict?
|
@@ -134,6 +141,8 @@ module Bundler
|
|
134
141
|
names_to_unlock << name
|
135
142
|
elsif package.ignores_prereleases? && @all_specs[name].any? {|s| s.version.prerelease? }
|
136
143
|
names_to_allow_prereleases_for << name
|
144
|
+
elsif package.prefer_local? && @all_specs[name].any? {|s| !s.is_a?(StubSpecification) }
|
145
|
+
names_to_allow_remote_specs_for << name
|
137
146
|
end
|
138
147
|
|
139
148
|
no_versions_incompat = [cause.incompatibility, cause.satisfier].find {|incompat| incompat.cause.is_a?(PubGrub::Incompatibility::NoVersions) }
|
@@ -143,7 +152,7 @@ module Bundler
|
|
143
152
|
end
|
144
153
|
end
|
145
154
|
|
146
|
-
[names_to_unlock.uniq, names_to_allow_prereleases_for.uniq, extended_explanation]
|
155
|
+
[names_to_unlock.uniq, names_to_allow_prereleases_for.uniq, names_to_allow_remote_specs_for.uniq, extended_explanation]
|
147
156
|
end
|
148
157
|
|
149
158
|
def parse_dependency(package, dependency)
|
@@ -244,7 +253,7 @@ module Bundler
|
|
244
253
|
|
245
254
|
def all_versions_for(package)
|
246
255
|
name = package.name
|
247
|
-
results = (@base[name] +
|
256
|
+
results = (@base[name] + filter_specs(@all_specs[name], package)).uniq {|spec| [spec.version.hash, spec.platform] }
|
248
257
|
|
249
258
|
if name == "bundler" && !bundler_pinned_to_current_version?
|
250
259
|
bundler_spec = Gem.loaded_specs["bundler"]
|
@@ -368,12 +377,22 @@ module Bundler
|
|
368
377
|
end
|
369
378
|
end
|
370
379
|
|
380
|
+
def filter_specs(specs, package)
|
381
|
+
filter_remote_specs(filter_prereleases(specs, package), package)
|
382
|
+
end
|
383
|
+
|
371
384
|
def filter_prereleases(specs, package)
|
372
385
|
return specs unless package.ignores_prereleases? && specs.size > 1
|
373
386
|
|
374
387
|
specs.reject {|s| s.version.prerelease? }
|
375
388
|
end
|
376
389
|
|
390
|
+
def filter_remote_specs(specs, package)
|
391
|
+
return specs unless package.prefer_local?
|
392
|
+
|
393
|
+
specs.select {|s| s.is_a?(StubSpecification) }
|
394
|
+
end
|
395
|
+
|
377
396
|
# Ignore versions that depend on themselves incorrectly
|
378
397
|
def filter_invalid_self_dependencies(specs, name)
|
379
398
|
specs.reject do |s|
|
@@ -398,17 +417,20 @@ module Bundler
|
|
398
417
|
end
|
399
418
|
|
400
419
|
def prepare_dependencies(requirements, packages)
|
401
|
-
to_dependency_hash(requirements, packages).
|
420
|
+
to_dependency_hash(requirements, packages).filter_map do |dep_package, dep_constraint|
|
402
421
|
name = dep_package.name
|
403
422
|
|
404
423
|
next [dep_package, dep_constraint] if name == "bundler"
|
405
424
|
|
406
425
|
dep_range = dep_constraint.range
|
407
426
|
versions = select_sorted_versions(dep_package, dep_range)
|
408
|
-
if versions.empty?
|
409
|
-
|
410
|
-
|
411
|
-
|
427
|
+
if versions.empty?
|
428
|
+
if dep_package.ignores_prereleases? || dep_package.prefer_local?
|
429
|
+
@all_versions.delete(dep_package)
|
430
|
+
@sorted_versions.delete(dep_package)
|
431
|
+
end
|
432
|
+
dep_package.consider_prereleases! if dep_package.ignores_prereleases?
|
433
|
+
dep_package.consider_remote_versions! if dep_package.prefer_local?
|
412
434
|
versions = select_sorted_versions(dep_package, dep_range)
|
413
435
|
end
|
414
436
|
|
@@ -421,7 +443,7 @@ module Bundler
|
|
421
443
|
next unless dep_package.current_platform?
|
422
444
|
|
423
445
|
raise_not_found!(dep_package)
|
424
|
-
end.
|
446
|
+
end.to_h
|
425
447
|
end
|
426
448
|
|
427
449
|
def select_sorted_versions(package, range)
|
data/lib/bundler/retry.rb
CHANGED
@@ -50,7 +50,7 @@ module Bundler
|
|
50
50
|
end
|
51
51
|
return true unless name
|
52
52
|
Bundler.ui.info "" unless Bundler.ui.debug? # Add new line in case dots preceded this
|
53
|
-
Bundler.ui.warn "Retrying #{name} due to error (#{current_run.next}/#{total_runs}): #{e.class} #{e.message}",
|
53
|
+
Bundler.ui.warn "Retrying #{name} due to error (#{current_run.next}/#{total_runs}): #{e.class} #{e.message}", true
|
54
54
|
end
|
55
55
|
|
56
56
|
def keep_trying?
|
data/lib/bundler/ruby_version.rb
CHANGED
@@ -23,7 +23,13 @@ module Bundler
|
|
23
23
|
# specified must match the version.
|
24
24
|
|
25
25
|
@versions = Array(versions).map do |v|
|
26
|
-
|
26
|
+
normalized_v = normalize_version(v)
|
27
|
+
|
28
|
+
unless Gem::Requirement::PATTERN.match?(normalized_v)
|
29
|
+
raise InvalidArgumentError, "#{v} is not a valid requirement on the Ruby version"
|
30
|
+
end
|
31
|
+
|
32
|
+
op, v = Gem::Requirement.parse(normalized_v)
|
27
33
|
op == "=" ? v.to_s : "#{op} #{v}"
|
28
34
|
end
|
29
35
|
|