Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle keep "installing" plugins from Gemfile #6630

Open
dfop02 opened this issue Apr 20, 2023 · 3 comments · May be fixed by #6957
Open

Bundle keep "installing" plugins from Gemfile #6630

dfop02 opened this issue Apr 20, 2023 · 3 comments · May be fixed by #6957
Labels

Comments

@dfop02
Copy link

dfop02 commented Apr 20, 2023

Describe the problem as clearly as you can

I started building a very simple plugin using as reference this guide, after push and test I notice that when we bundle install them from Gemfile (without git or path), it keep saying "installing" every run.

Did you try upgrading rubygems & bundler?

Yes, I tested on Bundler 2.4.12 and Rubygems 3.4.12

Post steps to reproduce the problem

Just add any plugin to your Rails App gemfile as specified on the early guide, ex.:
Gemfile

plugin 'bundle_filter'
plugin 'extended_bundler-errors'

Which command did you run?

bundle or bundle install

What were you expecting to happen?

plugins are already installed, but the bundler tries install again

What actually happened?

"Installing plugin x" even if is already installed

Where is the problem?

I did a small search and found the problem probably here where Bundler keep installing plugins if they're already installed, what makes the bug.

How solve the problem?

I actually tried few changes on my own version of Bundler gem 2.4.12, looks very simple to fix but since I don't know if could have any impact, prefer wait you guys to take a look. I solved the problem just checking if there is plugins not installed yet before actually install someone, here:

bundler/plugin.rb#L88

plugins = definition.dependencies.map(&:name).reject { |p| index.installed? p }
return if plugins.empty?
installed_specs = Installer.new.install_definition(definition)

Please take a look and say if makes sense :)

If not included with the output of your command, run bundle env and paste the output below

Bundler             2.4.12
  Platforms         ruby, x86_64-darwin-20
Ruby                2.7.2p137 (2020-10-01 revision 5445e0435260b449decf2ac16f9d09bae3cafe72) [x86_64-darwin-20]
  Full Path         /Users/dfop/.rvm/rubies/ruby-2.7.2/bin/ruby
  Config Dir        /Users/dfop/.rvm/rubies/ruby-2.7.2/etc
RubyGems            3.4.12
  Gem Home          /Users/dfop/.rvm/gems/ruby-2.7.2@my-test-rails
  Gem Path          /Users/dfop/.rvm/gems/ruby-2.7.2@my-test-rails:/Users/dfop/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0
  User Home         /Users/dfop
  User Path         /Users/dfop/.gem/ruby/2.7.0
  Bin Dir           /Users/dfop/.rvm/gems/ruby-2.7.2@my-test-rails/bin
Tools               
  Git               2.40.0
  RVM               1.29.12-next (master)
  rbenv             not installed
  chruby            not installed
  rubygems-bundler  (1.4.5)
@dfop02 dfop02 added the Bundler label Apr 20, 2023
@simi
Copy link
Member

simi commented Apr 28, 2023

Hello @dfop02! Thanks for the report. I can reproduce the problem. Would you mind to open PR with your suggested solution? It would be needed to add also some specs to ensure this is not going to regress again. I can help you in PR if needed. Feel free to inspire at other related specs at https://github.com/rubygems/rubygems/blob/63bfffea48182490f307c42bade849a584d10a7e/bundler/spec/bundler/plugin_spec.rb.


Btw. you linked rubygems/bundler repo, but bundler is currently being developed as part of this repo in bundler folder.

@dfop02
Copy link
Author

dfop02 commented May 20, 2023

Hello @simi , I opened a PR for this issue, please take a look when you had some time.

@Antronin
Copy link

Antronin commented Feb 5, 2024

Hello, Any update on this? It still happening for me in bundle 2.5.4, ruby 3.3.0p0 for bundler-graph.
I was able to solve by adding bundler-graph as gem to my Gemfile:
gem 'bundler-graph'
but in this case what's the reason to use
plugin 'bundler-graph'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants