91 Commits

Author SHA1 Message Date
Chris Roberts
5003bb6e15 Updates to address all Ruby deprecations and warnings
This includes updates for resolving all warnings provided by Ruby
for deprecations and/or removed methods. It also enables support
for Ruby 2.7 in the specification constraint as all 2.7 related
warnings are resolved with this changeset.
2020-08-10 13:05:41 -07:00
Chris Roberts
5195bee9ea Check if plugin install provides specification
During a plugin install, if the plugin is already installed and
activated, no specification will be returned as there was nothing
new installed. In this situation, look for the requested plugin
within the activated specifications. If it is found, then proceed
since the plugin is installed. If it is not found, return an error.
2020-05-06 15:51:37 -07:00
Chris Roberts
307d7f70b6 Allow prerelease matches when Vagrant is a prerelease version
Sets prerelease on the request set based on Vagrant's version. This
allows installing plugins which may include a vagrant version constraint
when running on a development version without needing to a manual local
installation of the gem.
2020-05-01 16:05:49 -07:00
Chris Roberts
21e5913cef Explicitly activate vagrant specification when not activated 2020-03-10 15:08:56 -07:00
Chris Roberts
d96f7c4293 Fix documentation disable in generation hooks 2020-03-09 16:52:39 -07:00
Chris Roberts
351e053aeb Start adding test coverage to bundler class 2020-03-09 16:52:39 -07:00
Chris Roberts
21c1bb5e05 Add support for caching solutions. Remove GEMRC modifications.
This pull request adds an enhancement to the internal Bundler class
to cache solution sets. This prevents Vagrant from generating a
solution for configured plugins on every run. Modifications to
the configured plugin list (global or local) will result in the
cached solution being invalidatd and resolved again.

Also included is the removal of the GEMRC modifications required
for Windows.
2020-02-03 07:43:17 -08:00
Chris Roberts
bbd75ef25a
Merge pull request #10896 from chrisroberts/f-plugin-constraints
Properly generate dependency instance when multiple constraints provided
2019-06-05 14:01:48 -07:00
Chris Roberts
109214f89d Properly generate dependency instance when multiple constraints provided 2019-06-05 13:46:42 -07:00
Chris Roberts
07b9f39a54 Clean up gem sources modifications
Based on suggestions from @zenspider here:
3daf3e532d (r33408747)
2019-06-05 09:36:37 -07:00
Chris Roberts
062ef52816 Handle strict dependency enforcement when installed within system
When installed outside of the official installer and not running
within a bundler environment, properly activate core dependencies
and properly enforce constraints.
2019-06-05 07:45:07 -07:00
Brian Cain
757175b94e
Add note about removing patch fix and add test 2019-04-22 10:36:25 -07:00
Brian Cain
e2097be55e
Fixes #10800, Fixes #9148: Ensure rubygems is loading gemrc properly on Windows
Prior to this commit, when Vagrant attempted to use the Gem library, it
would attempt to pass in a gemrc through an environment variable that
the rubygems library would try to split and parse. This is normally
fine, as the method in question would return empty if that file did not
exist. However if the user had a file that matches the drive that
Vagrant was installed on, rubygems would fail saying the folder was not
a file (or a gemrc, in this case).

This commit works around that by instead configuring the gemrc location
through ruby with `Gem.configuration`.

Related rubygems issue
[#2733](https://github.com/rubygems/rubygems/issues/2733)
2019-04-19 17:07:49 -07:00
Chris Roberts
3daf3e532d Update ordering of gem sources to ensure proper resolution
In recent Rubies the first dependency to satisfy the constraint will
be used regardless if higher versions are available in subsequent
sources. Move custom source to start of list when resolving plugins
to provide desired behavior.
2018-11-02 09:14:27 -07:00
Chris Roberts
3223737734 Use env_local consistently internally 2018-07-17 14:49:41 -07:00
Chris Roberts
b71054502e Update local usage to env_local for clarity 2018-07-17 14:49:41 -07:00
Chris Roberts
40f4e6f67e Vagrant Environment isolated plugins
Adds support for plugins isolated to a specific `Vagrant::Environment`
which can be managed by the vagrant plugin command using the the
--local flag.
2018-07-17 14:49:41 -07:00
Chris Roberts
91018d4edc Remove existing items from request set prior to installation 2018-05-08 13:52:23 -07:00
Josh Soref
1a5ddea9f4 Spelling fixes
* account
* addresses
* administrator
* afterwards
* because
* bridgeable
* capabilities
* capability
* checksum
* configuration
* configuration for
* configure
* criteria
* delimited
* delivered
* derivatives
* description
* detect
* directory
* display
* downloading
* during
* electric
* enabling
* encountered
* equivalent
* executable
* executed
* hashicorp
* hypervisor
* hyphens
* implementation
* incorporate
* inheritance
* initialize
* instance
* instead
* interactions
* invocable
* machine
* maximum
* message
* mounting
* overridden
* overwrite
* paramiko
* preparing
* provides
* provisioning
* recursively
* requested
* resetting
* retryable
* running
* satisfied
* searching
* sometimes
* specified
* successfully
* synced folders
* unauthorized
* underlying
* userprofile
* vagrant
* vagrantfile
* variable
* various
* version
* virtual
* windows
2018-03-14 14:41:04 +00:00
Chris Roberts
f42279508d Reset plugin constraint on update if explicit version set 2017-06-28 07:24:32 -07:00
Chris Roberts
73d85bd2f7 Support strict enforcement of internal dependency constraints 2017-06-27 19:20:20 -07:00
Chris Roberts
85d5f11f62 Adjustments to handle plugin updates using proper constraints
If a user provides the gem version using an explicit version or a
constraint, the update action should honor that constraint and not
simply replace it with an unbound constraint.

This also removes system plugin specifications from being matched
and preferred which prevents updates and can result in unexpected
downgrades when running the update.
2017-06-27 19:05:30 -07:00
Chris Roberts
6aafe3255a Force wrappers to be generated to prevent invalid version parsing 2017-04-06 16:52:10 -07:00
Chris Roberts
df069deac0 Validate plugin sources and report errors if detected. 2017-04-04 17:53:04 -07:00
Chris Roberts
354c1c2b51 Prevent adding local paths to RubyGems sources list 2017-03-22 16:36:42 -07:00
Chris Roberts
9d1ec938ef Merge pull request #8341 from chrisroberts/enhancement/prerelease
Support spec prerelease matching
2017-03-07 15:02:17 -08:00
Chris Roberts
7610ecfcba Allow prerelease matches on vagrant spec when running instance is prerelease 2017-03-07 10:36:35 -08:00
Chris Roberts
96204383c7 Force path as preferred source on local install 2017-03-03 09:12:44 -08:00
Chris Roberts
86af6501ed Remove installer set push from default source push 2017-02-24 08:02:22 -08:00
Chris Roberts
70cacb27fa Prefer given source if available when installing plugin 2017-02-09 17:22:48 -08:00
Michael Brandt
be63ace50f Add gem_version to plugin_info for local installs 2017-02-02 17:58:29 -07:00
Chris Roberts
df00edf1a7 Set base directory to parent directory within plugin specs
This adjustment allows for extensions to be properly discovered after
plugin gem specifications have been activated.
2017-01-06 12:55:13 -08:00
Chris Roberts
c8d564e578 Prevent interaction when removing plugin gems 2016-12-06 07:07:52 -08:00
Chris Roberts
5b1b18d01a Merge pull request #8068 from chrisroberts/bundler/install-solution-act
Detect load failure within solution set and retry if found
2016-12-05 13:28:58 -08:00
Chris Roberts
3dccd82a39 Explicitly require name_tuple
This does not get automatically loaded before usage so ensure
it is properly loaded for plugin usage.
2016-12-05 09:35:02 -08:00
Chris Roberts
ce35611c34 Detect load failure within solution set and retry if found
Installation solution sets in 2.2.5 can end up out of order (not seen
in 2.3.1) causing LoadErrors when the specification is in the solution
set during validation. This detects the missing spec within the solution
and if found will move spec to the start of the solution set and retry
solution activation.
2016-12-01 08:15:04 -08:00
Chris Roberts
f1e623976b Do not include default specifications within dependencies 2016-11-28 16:54:59 -08:00
Chris Roberts
2cc4b82198 Only read default specifications directory when within bundler context 2016-11-22 08:26:43 -08:00
Chris Roberts
a51949933f Always apply builtin constraints within dependency restrictions
Include detection of running context (within Bundler or not) and
load the "buitin" gems based on that context.
2016-11-22 07:53:19 -08:00
Chris Roberts
53b9f1747c Allow plugin_init_error to provide all information. Include final reset on specifications. 2016-11-17 16:40:51 -08:00
Chris Roberts
818f7acb7b Provide better internal consistency of installed plugin gems.
Refactors reusable actions into isolated methods. Supports installation/removal
without activation to prevent unintended conflicts during upgrades and cleanup.
Introduced custom resolver set to handle multiple installed versions of gems
which enables proper cleanup.
2016-11-16 13:26:13 -08:00
Chris Roberts
e2d96f942f Provide nice error output when plugin initialization fails
Include extra logging during initialization to display error if encountered
and solution set prior to performing activations.
2016-11-15 15:50:39 -08:00
Chris Roberts
3edd0b57e9 Add debug logging output to Bundler implementation 2016-11-11 15:08:59 -08:00
Chris Roberts
bd3f0c442c Only use Gem sources that are provided 2016-11-11 14:50:20 -08:00
Chris Roberts
1691e3af58 Only install from defined sources unless install is local 2016-11-11 14:44:14 -08:00
Chris Roberts
d8455c0a9a Add custom sources if not included 2016-11-11 14:33:26 -08:00
Chris Roberts
6e40d46c50 Fix up local gem plugin installation when not published remotely 2016-11-11 14:25:03 -08:00
Chris Roberts
3fb5913af1 Update .init! to attempt repair if instructed 2016-11-07 18:48:51 -08:00
Chris Roberts
1fb4553d14 [core] Remove bundler usage for plugin management 2016-11-07 18:48:51 -08:00
Seth Vargo
05aafedc6d
core/bundler: Reset specs in a way that works with new Rubygems 2016-06-20 15:19:21 -07:00