summaryrefslogtreecommitdiff
path: root/lib/bundler/plugin
AgeCommit message (Collapse)Author
9 days[ruby/rubygems] Clarify before-fetch/after-fetch hook docstringsHiroshi SHIBATA
The hook receives a Bundler spec proxy (Bundler::EndpointSpecification or Bundler::RemoteSpecification) that responds to the Gem::Specification API but is not itself a Gem::Specification instance. Plugins doing strict is_a? checks would break on the previous wording. Also clarify the cache-hit language: the hook does not fire when the initial download-cache check in fetch_gem finds the .gem already on disk, but Bundler.rubygems.download_gem also has a race-protection early return on the same path, which the previous wording obscured. https://github.com/ruby/rubygems/commit/93fe617ea8 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9 days[ruby/rubygems] Reorder plugin event definitions chronologicallyHiroshi SHIBATA
Arrange events.rb by actual firing order so the file reads as a timeline of bundler's lifecycle: Gemfile eval, install-all bracket (with per-gem fetch, git fetch, and install nested inside), then require-all bracket (with per-gem require nested inside). Also clarify the git fetch hook docstrings: the hook fires around both remote fetch and checkout, not only fetch. https://github.com/ruby/rubygems/commit/acc0659ffc Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9 days[ruby/rubygems] Add plugin hooks around gem fetch and git source fetchMarvin Frick
Adds four new hook points: - before-fetch / after-fetch: fires in Source::Rubygems#download_gem around actual network downloads, avoiding noise from cache hits. - before-git-fetch / after-git-fetch: fires in Source::Git#specs around fetch/checkout operations. Based on the original proposal in #8162 with adjustments: - Moved gem fetch hooks from fetch_gem_if_possible to download_gem so they only fire on actual network I/O. - Dropped the source argument since spec.source provides it. - Renamed git hooks to before-git-fetch / after-git-fetch for consistency with the existing before-*/after-* pattern. - Removed GEM_BEFORE_FETCH/GEM_AFTER_FETCH from Source::Git#install since using gem fetch events for git sources is semantically inconsistent. https://github.com/ruby/rubygems/commit/34c4a46ef2 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9 days[ruby/rubygems] Add bundler before/after eval hooks for pluginsCody Cutrer
https://github.com/ruby/rubygems/commit/fefe97c0bd
2026-03-25[ruby/rubygems] Implement relative path handling for plugin paths in ↵Hiroshi SHIBATA
Bundler::Plugin::Index https://github.com/ruby/rubygems/commit/dd50b93622
2026-03-12[ruby/rubygems] Split the download and install process of a gem:Edouard CHIN
- ### Problem Bundler awaits for the dependencies of a gem to be download and installed before it proceeds to downloading and installing the dependency itself. This creates a bottleneck at the end of the installation process and block a thread unnecessarily. ### Details The installation strategy in Bundler is to await for "leaf gems" to be download/installed before the "root gem" is processed. For instance, in this scenario: - Gem "foo" has a dependency on "bar" (We can call this the "root gem") - Gem "bar" has no dependency (We call cal this the "leaf gems") - A Gemfile adds "gem 'foo'" In this case, only a single thread will have work to do, that is because Bundler will queue the gem "bar" to be downloaded and installed, and only when "bar" is finished, then Bundler will queue work for "foo". For **pure ruby gems**, this strategy is a waste of time because during the installation, a gem's code is not evaluated and no "require" statement is evaluated. For gems with native extensions, this strategy make sense. When the `extconf.rb` of a gem is evaluated, it's possible that the extconf requires a dependency and therefore Bundler needs to wait for those dependencies to be installed before it can execute the extconf. A typical example is a native extension that require 'mini_portile2'. ### Solution From the explanation above, I'd like to split the download from the installation of a gem. The tricky aspect is that there is no RubyGems API to know whether a gem has a native extension. The only way to know is after we download the gem and read the `metadata` from the tarball. So the solution in this patch is as follow: 1. We download all gems without doing any checks. 2. Once the gems are downloaded, we now know whether a gem has a native extensions. 3. If a gem is a pure ruby gems, we install it without waiting. 4. If a gem has a native extension, we check whether its dependencies are installed. If a dependency is not yet installed, we put back the gem in the queue. It will be dequeued later on and we'll redo this logic. ### Performance gain The speed gain highly depends on how deep the dependency tree is. E.g. bar depends on foo which depends on baz which depends on jane ... Previously we'd proceed to installing gems just one by one and only a single thread would be used. In a freshly generated Rails application, the speed gain is not that important. And the reason is because we are having a "tail latency" issue. Around the end of the installation process, the remaining gems to be installed are the one with native extensions, since we had to wait for for their dependencies to be installed. Compiling them is the slowest part, and since we are doing it at the end then the speed gain is not that noticeable. ### Misc Another advantage of this change is to be able to more easily implement this kind of feature https://github.com/ruby/rubygems/issues/9138 to let users solely download gems, without installing them . https://github.com/ruby/rubygems/commit/e5e8c0a507
2026-03-04[ruby/rubygems] Fix plugin new version not registering:Edouard CHIN
- ### Problem When a plugin in the Gemfile is updated to a new version, it will be downloaded but will not be registered. The old version of the plugin will be loaded when Bundler is invoked. ### Context The problem is in the `Index#installed?` method that only checks for the plugin name in the index. If it finds one, it skips the registration. ### Solution Check whether the registed plugin load paths matche the new plugin one. If not, register the new plugin which will override the previous one in the index. https://github.com/ruby/rubygems/commit/ac65001055
2025-09-19[rubygems/rubygems] Move error handling to right behind the optionDavid Rodríguez
This is where error handling happens in all the other options, so it's where we'll look when we completely remove error handling for these removed CLI flags in the next major. https://github.com/rubygems/rubygems/commit/40d660c607
2025-09-19[rubygems/rubygems] Make `--local-git` flag to `bundle plugin install` raise ↵David Rodríguez
an error https://github.com/rubygems/rubygems/commit/8bfe317e6d
2025-09-16[rubygems/rubygems] Remove aggregate source mentionsDavid Rodríguez
It's a term from times with multiple remote sources, let's move on :) https://github.com/rubygems/rubygems/commit/6439b8944e
2025-03-24[rubygems/rubygems] Refactor Path vs Gemspec source comparisonDavid Rodríguez
https://github.com/rubygems/rubygems/commit/58e9bd9962 Notes: Merged: https://github.com/ruby/ruby/pull/12968
2025-03-24[rubygems/rubygems] Consistently use "lockfile" over "lock file"David Rodríguez
https://github.com/rubygems/rubygems/commit/e891be9197 Notes: Merged: https://github.com/ruby/ruby/pull/12968
2025-02-21[rubygems/rubygems] Allow noop `bundle install` to work on read-only or ↵David Rodríguez
protected folders As long as there's nothing new to install and gems are already there. If not, give a meaningful error about what happened. This was how things already worked until https://github.com/rubygems/rubygems/commit/345ec45f5a87, so this commit partially reverts that change. https://github.com/rubygems/rubygems/commit/794b0ecb39
2025-01-14[rubygems/rubygems] Do not fail on start when cannot find writable user ↵Vasily Fedoseyev
directory on ruby 3.4 https://github.com/rubygems/rubygems/commit/027cdc750a Notes: Merged: https://github.com/ruby/ruby/pull/12568
2024-11-25[rubygems/rubygems] Most of the times, eagerly resolving is not necessaryDavid Rodríguez
All we need is to setup remote or local sources appropriately. https://github.com/rubygems/rubygems/commit/3ceff46a2a
2024-09-20[rubygems/rubygems] Unconditionally set installed_by_versionSamuel Giddins
It has been supported since RubyGems 2.2.0 via https://github.com/rubygems/rubygems/commit/4525e45a4d45 Signed-off-by: Samuel Giddins <segiddins@segiddins.me> https://github.com/rubygems/rubygems/commit/bf39c583e8
2024-07-23[rubygems/rubygems] Stop removing the `.git` folder from cached git gemsDavid Rodríguez
If we want to change git gems to use a proper cache, instead of using the cache folder as the install location, so we need to keep git information in the cache, so that when running `bundle install` or `bundler install --local`, we are able to figure out whether the revision that needs to be checked out is present locally in the cache or needs to be fetched from the remote repository. https://github.com/rubygems/rubygems/commit/607eda63eb
2024-04-19[rubygems/rubygems] Add plugin hooks for Bundler.requirefatkodima
https://github.com/rubygems/rubygems/commit/b373b7ed0d
2024-04-11[rubygems/rubygems] Fix installing plugins via relative pathsCody Cutrer
This affected both CLI and Gemfile installs https://github.com/rubygems/rubygems/commit/a0d101a8df
2024-03-27[rubygems/rubygems] Allow installing plugins from path via CLICody Cutrer
Also bring the man page up to date. https://github.com/rubygems/rubygems/commit/a849bd6947
2024-03-25[rubygems/rubygems] Improve validation of `bundle plugin install` optionsCody Cutrer
Ensure only one source type is specified, and ensure options that are only relevant to git sources are only specified with git. https://github.com/rubygems/rubygems/commit/58b043215e
2024-03-18[rubygems/rubygems] Deprecate `bundle plugin install --local-git=`Cody Cutrer
It's the exact same implementation as --git https://github.com/rubygems/rubygems/commit/18eb2418c6
2024-01-29[rubygems/rubygems] Use rubygems vendored uri from Bundler when availableDavid Rodríguez
https://github.com/rubygems/rubygems/commit/5d6a8f2fb4
2023-12-07[rubygems/rubygems] Use modern hashes consistentlyDavid Rodríguez
https://github.com/rubygems/rubygems/commit/bb66253f2c
2023-10-31[rubygems/rubygems] Only remove bundler plugin gem when it's inside the cacheCody Cutrer
https://github.com/rubygems/rubygems/commit/8d51390ca4
2023-10-23[rubygems/rubygems] Refactor to checksums stored via sourceSamuel Giddins
This gets the specs passing, and handles the fact that we expect checkums to be pinned only to a particular source This also avoids reading in .gem files during lockfile generation, instead allowing us to query the source for each resolved gem to grab the checksum Finally, this opens up a route to having user-stored checksum databases, similar to how other package managers do this! Add checksums to dev lockfiles Handle full name conflicts from different original_platforms when adding checksums to store from compact index Specs passing on Bundler 3 https://github.com/rubygems/rubygems/commit/86c7084e1c
2023-03-28[rubygems/rubygems] Fix installing plugins in frozen modeDavid Rodríguez
Plugins don't use a lockfile, so ignore frozen related settings. https://github.com/rubygems/rubygems/commit/f17a3bb81f
2022-12-26Merge RubyGems/Bundler masterHiroshi SHIBATA
from https://github.com/rubygems/rubygems/commit/72fd3dd2096af16d797ad0cd8e0d2a8869e240b3 Notes: Merged: https://github.com/ruby/ruby/pull/7025
2022-09-08Resync Bundler & RubyGemsDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/6330
2022-09-05Merge ↵Hiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/16c3535413afebcdbab7582c6017c27b5da8a8dc Notes: Merged: https://github.com/ruby/ruby/pull/6326
2022-06-24Sync RubyGems & Bundler with upstream repoDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/6054
2022-05-13[rubygems/rubygems] Fix `Gemfile.lock` versions leaking to `bundler/inline` ↵David Rodríguez
install output The lockfile is completely ignored in inline mode, yet the previous output would suggest it wasn't. https://github.com/rubygems/rubygems/commit/763125a745
2022-04-28Merge RubyGems/Bundler masterHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/fe96fb6e2ac5a8b6df5e852470d11fa854301eca Notes: Merged: https://github.com/ruby/ruby/pull/5669
2021-12-21Merge RubyGems-3.3.0 and Bundler-2.3.0Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/5317
2021-12-03[rubygems/rubygems] Improve sources representationDavid Rodríguez
We have two representations of a source. Once used for sorting, which should not depend on the source's state, but solely on its static information, like remotes. Another one used for error and informational messages, which should properly inform about the exact state of the source when the message is printed. This commit makes the latter be the default implementation of `to_s`, so that error and informational messages are more accurate by default. https://github.com/rubygems/rubygems/commit/b5f2b88957
2021-08-31[rubygems/rubygems] Fix `bundle plugin install` misdetection of installed ↵David Rodríguez
versions https://github.com/rubygems/rubygems/commit/9c88db949d Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-07-16[rubygems/rubygems] fix dangling empty hooksAndre Arko
it turns out that running `bundle plugin uninstall some-plugin` would remove that plugin from the list of hooks, but if the list of hooks for an event was now empty, we would serialize the empty array into yaml as an empty single bullet item. which would then get unserialized as a plugin with the name empty string. which we would then try to load and explode. 😬 https://github.com/rubygems/rubygems/commit/545ebba9a5
2021-07-14Merge RubyGems/Bundler master from 8459ebd6ad65ce3397233416dc64083ae7572bb9Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/4648
2021-07-07Sync RubyGems and Bundler with upstreamHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/4634
2021-07-07Sync latest bundler & rubygems development versionDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/4533
2021-04-15Merge the master branch of BundlerHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/4383
2021-03-08Sync latest development version of bundler & rubygemsDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/4143
2020-12-08Merge prepare version of Bundler 2.2.0Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3864
2020-10-15Merge bundler-2.2.0.rc.2Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3659
2020-05-13Update the bundler version with master branchHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3086
2019-12-15Prepare to release bundler-2.1.0Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/2753
2019-08-16[bundler/bundler] Fix typo in comment: attibutes -> attributesMasato Ohba
https://github.com/bundler/bundler/commit/876545805e Notes: Merged: https://github.com/ruby/ruby/pull/2366
2019-06-09Merge bundler master from upstream.Hiroshi SHIBATA
Pick from 8dd59e3ba97eb80a599f8149f31bf40773b69dc0
2019-04-14Merge Bundler 2.1.0.pre.1 as developed version from upstream.hsbt
https://github.com/bundler/bundler/commit/a53709556b95a914e874b22ed2116a46b0528852 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-02Added bundler as default gems. Revisit [Feature #12733]hsbt
* bin/*, lib/bundler/*, lib/bundler.rb, spec/bundler, man/*: Merge from latest stable branch of bundler/bundler repository and added workaround patches. I will backport them into upstream. * common.mk, defs/gmake.mk: Added `test-bundler` task for test suite of bundler. * tool/sync_default_gems.rb: Added sync task for bundler. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e