-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Very slow dependency resolving #5689
Comments
Wow, congratulations on finding such a pathological resolver case! It's been years since I've seen one this bad. 😁 I suspect it will take some time to fix this, so in the meantime, here is a workaround you can use to get a complete resolution and a working Gemfile.lock: Start with this Gemfile:
Then run:
Commit the resulting |
I don't plan to wait 5 hours 😅, but I may be running into this too as I update a very small app. The OP's report seems clear, but in case it helps, I'll just note the scenarios that I found slow resolution:
Thanks for the workaround. I'll try that now. |
The workaround helped. 🙏
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies.....
Bundler could not find compatible versions for gem "activemodel":
In snapshot (Gemfile.lock):
activemodel (= 6.1.6)
In Gemfile:
populate was resolved to 0.1.0, which depends on
activemodel (>= 5.2, < 6.2)
rails (~> 7.0.3) was resolved to 7.0.3, which depends on
activemodel (= 7.0.3)
Deleting your Gemfile.lock file and running `bundle install` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict. After I allowed Rails 7.0 in |
✅ UPD: Running into #5385 Hey folks, sorry for chiming in 🙇 rubygems/bundler/lib/bundler/fetcher.rb Line 113 in 46a92b2
It becomes better on the second run because of the cache, I assume, but still takes significant time because of the iteration over all available versions: rubygems/bundler/lib/bundler/fetcher.rb Lines 110 to 111 in 46a92b2
It doesn't seem to do it on I'll poke around a bit more to have a clear reproduction and maybe a suggested solution Thanks! |
I think you're running into #5385. |
I'm using Bundler 2.3.4 until #5385 is resolved, in apps where there are private gems with many versions. |
If you're using a geminabox based server, I recommend you check out geminabox/geminabox#435! |
Just tried this reproducer against #5960 and it now resolves in 5 seconds! 🎉 |
Describe the problem as clearly as you can
The step to resolve the project dependencies with bundler takes multiple hours.
Did you try upgrading rubygems & bundler?
I tried it with 2.3.17 and a couple of other older releases of bundler:
Post steps to reproduce the problem
With this Gemfile:
I also tried it inside a Docker container:
The build inside the Docker container fails, because of missing build dependencies, however bundler mostly spends resolving dependencies there and the final time output, after it fails to build is:
So over 5 hours.
Which is the same on my host, where the build of those dependencies succeeds.
Which command did you run?
With the
Gemfile
posted above in place.What were you expecting to happen?
Resolving dependencies in under 5 minutes.
What actually happened?
Resolving dependencies in over 5 hours.
If not included with the output of your command, run
bundle env
and paste the output belowI used the docker container, so the environment should be clear. I can however post it as well if required...
The text was updated successfully, but these errors were encountered: