bundler 2.2.6 → 2.2.11
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.
Potentially problematic release.
This version of bundler might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +65 -0
- data/lib/bundler.rb +1 -1
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/cli.rb +1 -0
- data/lib/bundler/cli/cache.rb +1 -0
- data/lib/bundler/cli/gem.rb +12 -0
- data/lib/bundler/definition.rb +16 -25
- data/lib/bundler/feature_flag.rb +0 -1
- data/lib/bundler/fetcher.rb +0 -1
- data/lib/bundler/gem_helper.rb +8 -6
- data/lib/bundler/index.rb +6 -5
- data/lib/bundler/installer.rb +0 -17
- data/lib/bundler/installer/standalone.rb +15 -0
- data/lib/bundler/lazy_specification.rb +9 -18
- data/lib/bundler/man/bundle-add.1 +1 -1
- data/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/lib/bundler/man/bundle-cache.1 +1 -1
- data/lib/bundler/man/bundle-check.1 +1 -1
- data/lib/bundler/man/bundle-clean.1 +1 -1
- data/lib/bundler/man/bundle-config.1 +8 -8
- data/lib/bundler/man/bundle-config.1.ronn +11 -10
- data/lib/bundler/man/bundle-doctor.1 +1 -1
- data/lib/bundler/man/bundle-exec.1 +1 -1
- data/lib/bundler/man/bundle-gem.1 +1 -1
- data/lib/bundler/man/bundle-info.1 +1 -1
- data/lib/bundler/man/bundle-init.1 +1 -1
- data/lib/bundler/man/bundle-inject.1 +1 -1
- data/lib/bundler/man/bundle-install.1 +1 -1
- data/lib/bundler/man/bundle-list.1 +1 -1
- data/lib/bundler/man/bundle-lock.1 +1 -1
- data/lib/bundler/man/bundle-open.1 +1 -1
- data/lib/bundler/man/bundle-outdated.1 +1 -1
- data/lib/bundler/man/bundle-platform.1 +1 -1
- data/lib/bundler/man/bundle-pristine.1 +1 -1
- data/lib/bundler/man/bundle-remove.1 +1 -1
- data/lib/bundler/man/bundle-show.1 +1 -1
- data/lib/bundler/man/bundle-update.1 +1 -1
- data/lib/bundler/man/bundle-viz.1 +1 -1
- data/lib/bundler/man/bundle.1 +1 -1
- data/lib/bundler/man/gemfile.5 +1 -1
- data/lib/bundler/resolver.rb +79 -45
- data/lib/bundler/resolver/spec_group.rb +54 -42
- data/lib/bundler/settings.rb +1 -1
- data/lib/bundler/shared_helpers.rb +2 -2
- data/lib/bundler/source/git.rb +1 -1
- data/lib/bundler/source/rubygems.rb +0 -1
- data/lib/bundler/source_list.rb +2 -4
- data/lib/bundler/spec_set.rb +4 -3
- data/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +7 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +0 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +11 -5
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +2 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +11 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor.rb +5 -6
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +4 -2
- data/lib/bundler/vendor/thor/lib/thor/error.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +5 -1
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +9 -8
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +5 -2
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +5 -1
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/version.rb +1 -1
- metadata +4 -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 "BUNDLE\-CHECK" "1" "
|
4
|
+
.TH "BUNDLE\-CHECK" "1" "January 2021" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems
|
@@ -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 "BUNDLE\-CLEAN" "1" "
|
4
|
+
.TH "BUNDLE\-CLEAN" "1" "January 2021" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory
|
@@ -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 "BUNDLE\-CONFIG" "1" "
|
4
|
+
.TH "BUNDLE\-CONFIG" "1" "January 2021" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-config\fR \- Set bundler configuration options
|
@@ -136,9 +136,6 @@ Any periods in the configuration keys must be replaced with two underscores when
|
|
136
136
|
The following is a list of all configuration keys and their purpose\. You can learn more about their operation in bundle install(1) \fIbundle\-install\.1\.html\fR\.
|
137
137
|
.
|
138
138
|
.IP "\(bu" 4
|
139
|
-
\fBallow_bundler_dependency_conflicts\fR (\fBBUNDLE_ALLOW_BUNDLER_DEPENDENCY_CONFLICTS\fR): Allow resolving to specifications that have dependencies on \fBbundler\fR that are incompatible with the running Bundler version\.
|
140
|
-
.
|
141
|
-
.IP "\(bu" 4
|
142
139
|
\fBallow_deployment_source_credential_changes\fR (\fBBUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES\fR): When in deployment mode, allow changing the credentials to a gem\'s source\. Ex: \fBhttps://some\.host\.com/gems/path/\fR \-> \fBhttps://user_name:password@some\.host\.com/gems/path\fR
|
143
140
|
.
|
144
141
|
.IP "\(bu" 4
|
@@ -184,6 +181,9 @@ The following is a list of all configuration keys and their purpose\. You can le
|
|
184
181
|
\fBdisable_local_branch_check\fR (\fBBUNDLE_DISABLE_LOCAL_BRANCH_CHECK\fR): Allow Bundler to use a local git override without a branch specified in the Gemfile\.
|
185
182
|
.
|
186
183
|
.IP "\(bu" 4
|
184
|
+
\fBdisable_local_revision_check\fR (\fBBUNDLE_DISABLE_LOCAL_REVISION_CHECK\fR): Allow Bundler to use a local git override without checking if the revision present in the lockfile is present in the repository\.
|
185
|
+
.
|
186
|
+
.IP "\(bu" 4
|
187
187
|
\fBdisable_multisource\fR (\fBBUNDLE_DISABLE_MULTISOURCE\fR): When set, Gemfiles containing multiple sources will produce errors instead of warnings\. Use \fBbundle config unset disable_multisource\fR to unset\.
|
188
188
|
.
|
189
189
|
.IP "\(bu" 4
|
@@ -211,10 +211,10 @@ The following is a list of all configuration keys and their purpose\. You can le
|
|
211
211
|
\fBignore_messages\fR (\fBBUNDLE_IGNORE_MESSAGES\fR): When set, no post install messages will be printed\. To silence a single gem, use dot notation like \fBignore_messages\.httparty true\fR\.
|
212
212
|
.
|
213
213
|
.IP "\(bu" 4
|
214
|
-
\fBinit_gems_rb\fR (\fBBUNDLE_INIT_GEMS_RB\fR) Generate a \fBgems\.rb\fR instead of a \fBGemfile\fR when running \fBbundle init\fR\.
|
214
|
+
\fBinit_gems_rb\fR (\fBBUNDLE_INIT_GEMS_RB\fR): Generate a \fBgems\.rb\fR instead of a \fBGemfile\fR when running \fBbundle init\fR\.
|
215
215
|
.
|
216
216
|
.IP "\(bu" 4
|
217
|
-
\fBjobs\fR (\fBBUNDLE_JOBS\fR): The number of gems Bundler can install in parallel\. Defaults to 1\.
|
217
|
+
\fBjobs\fR (\fBBUNDLE_JOBS\fR): The number of gems Bundler can install in parallel\. Defaults to 1 on Windows, and to the the number of processors on other platforms\.
|
218
218
|
.
|
219
219
|
.IP "\(bu" 4
|
220
220
|
\fBno_install\fR (\fBBUNDLE_NO_INSTALL\fR): Whether \fBbundle package\fR should skip installing gems\.
|
@@ -241,7 +241,7 @@ The following is a list of all configuration keys and their purpose\. You can le
|
|
241
241
|
\fBprefer_patch\fR (BUNDLE_PREFER_PATCH): Prefer updating only to next patch version during updates\. Makes \fBbundle update\fR calls equivalent to \fBbundler update \-\-patch\fR\.
|
242
242
|
.
|
243
243
|
.IP "\(bu" 4
|
244
|
-
\fBprint_only_version_number\fR (\fBBUNDLE_PRINT_ONLY_VERSION_NUMBER\fR) Print only version number from \fBbundler \-\-version\fR\.
|
244
|
+
\fBprint_only_version_number\fR (\fBBUNDLE_PRINT_ONLY_VERSION_NUMBER\fR): Print only version number from \fBbundler \-\-version\fR\.
|
245
245
|
.
|
246
246
|
.IP "\(bu" 4
|
247
247
|
\fBredirect\fR (\fBBUNDLE_REDIRECT\fR): The number of redirects allowed for network requests\. Defaults to \fB5\fR\.
|
@@ -283,7 +283,7 @@ The following is a list of all configuration keys and their purpose\. You can le
|
|
283
283
|
\fBunlock_source_unlocks_spec\fR (\fBBUNDLE_UNLOCK_SOURCE_UNLOCKS_SPEC\fR): Whether running \fBbundle update \-\-source NAME\fR unlocks a gem with the given name\. Defaults to \fBtrue\fR\.
|
284
284
|
.
|
285
285
|
.IP "\(bu" 4
|
286
|
-
\fBupdate_requires_all_flag\fR (\fBBUNDLE_UPDATE_REQUIRES_ALL_FLAG\fR) Require passing \fB\-\-all\fR to \fBbundle update\fR when everything should be updated, and disallow passing no options to \fBbundle update\fR\.
|
286
|
+
\fBupdate_requires_all_flag\fR (\fBBUNDLE_UPDATE_REQUIRES_ALL_FLAG\fR): Require passing \fB\-\-all\fR to \fBbundle update\fR when everything should be updated, and disallow passing no options to \fBbundle update\fR\.
|
287
287
|
.
|
288
288
|
.IP "\(bu" 4
|
289
289
|
\fBuser_agent\fR (\fBBUNDLE_USER_AGENT\fR): The custom user agent fragment Bundler includes in API requests\.
|
@@ -133,9 +133,6 @@ the environment variable `BUNDLE_LOCAL__RACK`.
|
|
133
133
|
The following is a list of all configuration keys and their purpose. You can
|
134
134
|
learn more about their operation in [bundle install(1)](bundle-install.1.html).
|
135
135
|
|
136
|
-
* `allow_bundler_dependency_conflicts` (`BUNDLE_ALLOW_BUNDLER_DEPENDENCY_CONFLICTS`):
|
137
|
-
Allow resolving to specifications that have dependencies on `bundler` that
|
138
|
-
are incompatible with the running Bundler version.
|
139
136
|
* `allow_deployment_source_credential_changes` (`BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES`):
|
140
137
|
When in deployment mode, allow changing the credentials to a gem's source.
|
141
138
|
Ex: `https://some.host.com/gems/path/` -> `https://user_name:password@some.host.com/gems/path`
|
@@ -178,6 +175,9 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
|
|
178
175
|
* `disable_local_branch_check` (`BUNDLE_DISABLE_LOCAL_BRANCH_CHECK`):
|
179
176
|
Allow Bundler to use a local git override without a branch specified in the
|
180
177
|
Gemfile.
|
178
|
+
* `disable_local_revision_check` (`BUNDLE_DISABLE_LOCAL_REVISION_CHECK`):
|
179
|
+
Allow Bundler to use a local git override without checking if the revision
|
180
|
+
present in the lockfile is present in the repository.
|
181
181
|
* `disable_multisource` (`BUNDLE_DISABLE_MULTISOURCE`):
|
182
182
|
When set, Gemfiles containing multiple sources will produce errors
|
183
183
|
instead of warnings.
|
@@ -206,13 +206,14 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
|
|
206
206
|
* `global_gem_cache` (`BUNDLE_GLOBAL_GEM_CACHE`):
|
207
207
|
Whether Bundler should cache all gems globally, rather than locally to the
|
208
208
|
installing Ruby installation.
|
209
|
-
* `ignore_messages` (`BUNDLE_IGNORE_MESSAGES`):
|
210
|
-
messages will be printed. To silence a single gem,
|
211
|
-
`ignore_messages.httparty true`.
|
212
|
-
* `init_gems_rb` (`BUNDLE_INIT_GEMS_RB`)
|
209
|
+
* `ignore_messages` (`BUNDLE_IGNORE_MESSAGES`):
|
210
|
+
When set, no post install messages will be printed. To silence a single gem,
|
211
|
+
use dot notation like `ignore_messages.httparty true`.
|
212
|
+
* `init_gems_rb` (`BUNDLE_INIT_GEMS_RB`):
|
213
213
|
Generate a `gems.rb` instead of a `Gemfile` when running `bundle init`.
|
214
214
|
* `jobs` (`BUNDLE_JOBS`):
|
215
|
-
The number of gems Bundler can install in parallel. Defaults to 1
|
215
|
+
The number of gems Bundler can install in parallel. Defaults to 1 on Windows,
|
216
|
+
and to the the number of processors on other platforms.
|
216
217
|
* `no_install` (`BUNDLE_NO_INSTALL`):
|
217
218
|
Whether `bundle package` should skip installing gems.
|
218
219
|
* `no_prune` (`BUNDLE_NO_PRUNE`):
|
@@ -233,7 +234,7 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
|
|
233
234
|
Enable Bundler's experimental plugin system.
|
234
235
|
* `prefer_patch` (BUNDLE_PREFER_PATCH):
|
235
236
|
Prefer updating only to next patch version during updates. Makes `bundle update` calls equivalent to `bundler update --patch`.
|
236
|
-
* `print_only_version_number` (`BUNDLE_PRINT_ONLY_VERSION_NUMBER`)
|
237
|
+
* `print_only_version_number` (`BUNDLE_PRINT_ONLY_VERSION_NUMBER`):
|
237
238
|
Print only version number from `bundler --version`.
|
238
239
|
* `redirect` (`BUNDLE_REDIRECT`):
|
239
240
|
The number of redirects allowed for network requests. Defaults to `5`.
|
@@ -269,7 +270,7 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
|
|
269
270
|
* `unlock_source_unlocks_spec` (`BUNDLE_UNLOCK_SOURCE_UNLOCKS_SPEC`):
|
270
271
|
Whether running `bundle update --source NAME` unlocks a gem with the given
|
271
272
|
name. Defaults to `true`.
|
272
|
-
* `update_requires_all_flag` (`BUNDLE_UPDATE_REQUIRES_ALL_FLAG`)
|
273
|
+
* `update_requires_all_flag` (`BUNDLE_UPDATE_REQUIRES_ALL_FLAG`):
|
273
274
|
Require passing `--all` to `bundle update` when everything should be updated,
|
274
275
|
and disallow passing no options to `bundle update`.
|
275
276
|
* `user_agent` (`BUNDLE_USER_AGENT`):
|
@@ -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 "BUNDLE\-INFO" "1" "
|
4
|
+
.TH "BUNDLE\-INFO" "1" "January 2021" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-info\fR \- Show information for the given gem in your bundle
|
@@ -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 "BUNDLE\-INIT" "1" "
|
4
|
+
.TH "BUNDLE\-INIT" "1" "January 2021" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-init\fR \- Generates a Gemfile into the current working directory
|
@@ -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 "BUNDLE\-INJECT" "1" "
|
4
|
+
.TH "BUNDLE\-INJECT" "1" "January 2021" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile
|
@@ -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 "BUNDLE\-INSTALL" "1" "
|
4
|
+
.TH "BUNDLE\-INSTALL" "1" "January 2021" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-install\fR \- Install the dependencies specified in your Gemfile
|
@@ -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 "BUNDLE\-OPEN" "1" "
|
4
|
+
.TH "BUNDLE\-OPEN" "1" "January 2021" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-open\fR \- Opens the source directory for a gem in your bundle
|
@@ -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 "BUNDLE\-OUTDATED" "1" "
|
4
|
+
.TH "BUNDLE\-OUTDATED" "1" "January 2021" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-outdated\fR \- List installed gems with newer versions available
|
@@ -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 "BUNDLE\-PLATFORM" "1" "
|
4
|
+
.TH "BUNDLE\-PLATFORM" "1" "January 2021" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-platform\fR \- Displays platform compatibility information
|
@@ -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 "BUNDLE\-PRISTINE" "1" "
|
4
|
+
.TH "BUNDLE\-PRISTINE" "1" "January 2021" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-pristine\fR \- Restores installed gems to their pristine condition
|
@@ -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 "BUNDLE\-SHOW" "1" "
|
4
|
+
.TH "BUNDLE\-SHOW" "1" "January 2021" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem
|
@@ -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 "BUNDLE\-UPDATE" "1" "
|
4
|
+
.TH "BUNDLE\-UPDATE" "1" "January 2021" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-update\fR \- Update your gems to the latest available versions
|
@@ -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 "BUNDLE\-VIZ" "1" "
|
4
|
+
.TH "BUNDLE\-VIZ" "1" "January 2021" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile
|
data/lib/bundler/man/bundle.1
CHANGED
data/lib/bundler/man/gemfile.5
CHANGED
data/lib/bundler/resolver.rb
CHANGED
@@ -5,6 +5,8 @@ module Bundler
|
|
5
5
|
require_relative "vendored_molinillo"
|
6
6
|
require_relative "resolver/spec_group"
|
7
7
|
|
8
|
+
include GemHelpers
|
9
|
+
|
8
10
|
# Figures out the best possible configuration of gems that satisfies
|
9
11
|
# the list of passed dependencies and any child dependencies without
|
10
12
|
# causing any gem activation errors.
|
@@ -16,7 +18,6 @@ module Bundler
|
|
16
18
|
# <GemBundle>,nil:: If the list of dependencies can be resolved, a
|
17
19
|
# collection of gemspecs is returned. Otherwise, nil is returned.
|
18
20
|
def self.resolve(requirements, index, source_requirements = {}, base = [], gem_version_promoter = GemVersionPromoter.new, additional_base_requirements = [], platforms = nil)
|
19
|
-
platforms = Set.new(platforms) if platforms
|
20
21
|
base = SpecSet.new(base) unless base.is_a?(SpecSet)
|
21
22
|
resolver = new(index, source_requirements, base, gem_version_promoter, additional_base_requirements, platforms)
|
22
23
|
result = resolver.start(requirements)
|
@@ -35,11 +36,14 @@ module Bundler
|
|
35
36
|
@base_dg.add_vertex(ls.name, DepProxy.get_proxy(dep, ls.platform), true)
|
36
37
|
end
|
37
38
|
additional_base_requirements.each {|d| @base_dg.add_vertex(d.name, d) }
|
38
|
-
@platforms = platforms
|
39
|
+
@platforms = platforms.reject {|p| p != Gem::Platform::RUBY && (platforms - [p]).any? {|pl| generic(pl) == p } }
|
40
|
+
@resolving_only_for_ruby = platforms == [Gem::Platform::RUBY]
|
39
41
|
@gem_version_promoter = gem_version_promoter
|
40
|
-
@allow_bundler_dependency_conflicts = Bundler.feature_flag.allow_bundler_dependency_conflicts?
|
41
42
|
@use_gvp = Bundler.feature_flag.use_gem_version_promoter_for_major_updates? || !@gem_version_promoter.major?
|
42
43
|
@lockfile_uses_separate_rubygems_sources = Bundler.feature_flag.disable_multisource?
|
44
|
+
|
45
|
+
@variant_specific_names = []
|
46
|
+
@generic_names = ["Ruby\0", "RubyGems\0"]
|
43
47
|
end
|
44
48
|
|
45
49
|
def start(requirements)
|
@@ -103,14 +107,24 @@ module Bundler
|
|
103
107
|
include Molinillo::SpecificationProvider
|
104
108
|
|
105
109
|
def dependencies_for(specification)
|
106
|
-
specification.dependencies_for_activated_platforms
|
110
|
+
all_dependencies = specification.dependencies_for_activated_platforms
|
111
|
+
|
112
|
+
if @variant_specific_names.include?(specification.name)
|
113
|
+
@variant_specific_names |= all_dependencies.map(&:name) - @generic_names
|
114
|
+
else
|
115
|
+
generic_names, variant_specific_names = specification.partitioned_dependency_names_for_activated_platforms
|
116
|
+
@variant_specific_names |= variant_specific_names - @generic_names
|
117
|
+
@generic_names |= generic_names
|
118
|
+
end
|
119
|
+
|
120
|
+
all_dependencies
|
107
121
|
end
|
108
122
|
|
109
123
|
def search_for(dependency_proxy)
|
110
124
|
platform = dependency_proxy.__platform
|
111
125
|
dependency = dependency_proxy.dep
|
112
|
-
|
113
|
-
|
126
|
+
name = dependency.name
|
127
|
+
search_result = @search_for[dependency_proxy] ||= begin
|
114
128
|
index = index_for(dependency)
|
115
129
|
results = index.search(dependency, @base[name])
|
116
130
|
|
@@ -137,41 +151,48 @@ module Bundler
|
|
137
151
|
end
|
138
152
|
nested.reduce([]) do |groups, (version, specs)|
|
139
153
|
next groups if locked_requirement && !locked_requirement.satisfied_by?(version)
|
140
|
-
|
141
|
-
|
142
|
-
|
154
|
+
|
155
|
+
specs_by_platform = Hash.new do |current_specs, current_platform|
|
156
|
+
current_specs[current_platform] = select_best_platform_match(specs, current_platform)
|
157
|
+
end
|
158
|
+
|
159
|
+
spec_group_ruby = SpecGroup.create_for(specs_by_platform, [Gem::Platform::RUBY], Gem::Platform::RUBY)
|
160
|
+
groups << spec_group_ruby if spec_group_ruby
|
161
|
+
|
162
|
+
next groups if @resolving_only_for_ruby
|
163
|
+
|
164
|
+
spec_group = SpecGroup.create_for(specs_by_platform, @platforms, platform)
|
165
|
+
groups << spec_group if spec_group
|
166
|
+
|
167
|
+
groups
|
143
168
|
end
|
144
169
|
else
|
145
170
|
[]
|
146
171
|
end
|
147
172
|
# GVP handles major itself, but it's still a bit risky to trust it with it
|
148
173
|
# until we get it settled with new behavior. For 2.x it can take over all cases.
|
149
|
-
|
174
|
+
if !@use_gvp
|
150
175
|
spec_groups
|
151
176
|
else
|
152
177
|
@gem_version_promoter.sort_versions(dependency, spec_groups)
|
153
178
|
end
|
154
|
-
|
155
|
-
search.each do |sg|
|
156
|
-
next unless sg.for?(platform)
|
157
|
-
sg_all_platforms = sg.copy_for(self.class.sort_platforms(@platforms).reverse)
|
158
|
-
next unless sg_all_platforms
|
159
|
-
|
160
|
-
selected_sgs << sg_all_platforms
|
161
|
-
|
162
|
-
next if sg_all_platforms.activated_platforms == [Gem::Platform::RUBY]
|
163
|
-
# Add a spec group for "non platform specific spec" as the fallback
|
164
|
-
# spec group.
|
165
|
-
sg_ruby = sg.copy_for([Gem::Platform::RUBY])
|
166
|
-
next unless sg_ruby
|
179
|
+
end
|
167
180
|
|
168
|
-
|
169
|
-
|
181
|
+
unless search_result.empty?
|
182
|
+
specific_dependency = @variant_specific_names.include?(name)
|
183
|
+
return search_result unless specific_dependency
|
170
184
|
|
171
|
-
|
185
|
+
search_result.each do |sg|
|
186
|
+
if @generic_names.include?(name)
|
187
|
+
@variant_specific_names -= [name]
|
188
|
+
sg.activate_all_platforms!
|
189
|
+
else
|
190
|
+
sg.activate_platform!(platform)
|
191
|
+
end
|
172
192
|
end
|
173
|
-
selected_sgs
|
174
193
|
end
|
194
|
+
|
195
|
+
search_result
|
175
196
|
end
|
176
197
|
|
177
198
|
def index_for(dependency)
|
@@ -211,6 +232,10 @@ module Bundler
|
|
211
232
|
requirement.matches_spec?(spec) || spec.source.is_a?(Source::Gemspec)
|
212
233
|
end
|
213
234
|
|
235
|
+
def dependencies_equal?(dependencies, other_dependencies)
|
236
|
+
dependencies.map(&:dep) == other_dependencies.map(&:dep)
|
237
|
+
end
|
238
|
+
|
214
239
|
def relevant_sources_for_vertex(vertex)
|
215
240
|
if vertex.root?
|
216
241
|
[@source_requirements[vertex.name]]
|
@@ -238,13 +263,6 @@ module Bundler
|
|
238
263
|
end
|
239
264
|
end
|
240
265
|
|
241
|
-
# Sort platforms from most general to most specific
|
242
|
-
def self.sort_platforms(platforms)
|
243
|
-
platforms.sort_by do |platform|
|
244
|
-
platform_sort_key(platform)
|
245
|
-
end
|
246
|
-
end
|
247
|
-
|
248
266
|
def self.platform_sort_key(platform)
|
249
267
|
# Prefer specific platform to not specific platform
|
250
268
|
return ["99-LAST", "", "", ""] if Gem::Platform::RUBY == platform
|
@@ -329,10 +347,16 @@ module Bundler
|
|
329
347
|
def version_conflict_message(e)
|
330
348
|
# only show essential conflicts, if possible
|
331
349
|
conflicts = e.conflicts.dup
|
332
|
-
|
333
|
-
|
334
|
-
|
350
|
+
|
351
|
+
if conflicts["bundler"]
|
352
|
+
conflicts.replace("bundler" => conflicts["bundler"])
|
353
|
+
else
|
354
|
+
conflicts.delete_if do |_name, conflict|
|
355
|
+
deps = conflict.requirement_trees.map(&:last).flatten(1)
|
356
|
+
!Bundler::VersionRanges.empty?(*Bundler::VersionRanges.for_many(deps.map(&:requirement)))
|
357
|
+
end
|
335
358
|
end
|
359
|
+
|
336
360
|
e = Molinillo::VersionConflict.new(conflicts, e.specification_provider) unless conflicts.empty?
|
337
361
|
|
338
362
|
solver_name = "Bundler"
|
@@ -360,15 +384,25 @@ module Bundler
|
|
360
384
|
:additional_message_for_conflict => lambda do |o, name, conflict|
|
361
385
|
if name == "bundler"
|
362
386
|
o << %(\n Current Bundler version:\n bundler (#{Bundler::VERSION}))
|
363
|
-
other_bundler_required = !conflict.requirement.requirement.satisfied_by?(Gem::Version.new(Bundler::VERSION))
|
364
|
-
end
|
365
387
|
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
388
|
+
conflict_dependency = conflict.requirement
|
389
|
+
conflict_requirement = conflict_dependency.requirement
|
390
|
+
other_bundler_required = !conflict_requirement.satisfied_by?(Gem::Version.new(Bundler::VERSION))
|
391
|
+
|
392
|
+
if other_bundler_required
|
393
|
+
o << "\n\n"
|
394
|
+
|
395
|
+
candidate_specs = @source_requirements[:default_bundler].specs.search(conflict_dependency)
|
396
|
+
if candidate_specs.any?
|
397
|
+
target_version = candidate_specs.last.version
|
398
|
+
new_command = [File.basename($PROGRAM_NAME), "_#{target_version}_", *ARGV].join(" ")
|
399
|
+
o << "Your bundle requires a different version of Bundler than the one you're running.\n"
|
400
|
+
o << "Install the necessary version with `gem install bundler:#{target_version}` and rerun bundler using `#{new_command}`\n"
|
401
|
+
else
|
402
|
+
o << "Your bundle requires a different version of Bundler than the one you're running, and that version could not be found.\n"
|
403
|
+
end
|
404
|
+
end
|
405
|
+
elsif conflict.locked_requirement
|
372
406
|
o << "\n"
|
373
407
|
o << %(Running `bundle update` will rebuild your snapshot from scratch, using only\n)
|
374
408
|
o << %(the gems in your Gemfile, which may resolve the conflict.\n)
|