-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Migrate our resolver engine to PubGrub #5960
Conversation
9f8bfcb
to
7577eef
Compare
4904014
to
0079afb
Compare
I understand this is WIP, but seeing the new resolver as part of Bundler instead of RubyGems does not seems to be right. BTW I also wonder, why there needs to be new resolver. For instance, there is libsolv used by DNF on Fedora. Of course, it is not Ruby, but it has Ruby bindings at least. |
Can you explain why it is not right?
Per my understanding it should be much faster. Some info is at https://github.com/gel-rb/gel#why-should-i-use-gel. |
I also don't get what's not right about it. I guess you mean we should also migrate the RubyGems resolver, and eventually keep everything in RubyGems? I guess, but no way that should be a blocker for improvements like this one. It's very close to ready, by the way, I'm in the process of upstreaming changes needed to pub_grub and it's progressing smoothly :)
There are issues with our current resolver that have been around for ages. In particular that its error messages are confusing, and that sometimes it's not smart enough and takes forever to find a solution. PubGrub is state of the art with respect to the version solving problem and many package managers are adopting it for good reasons, have a look at https://nex3.medium.com/pubgrub-2fb6470504f too. |
38c9fc1
to
5cc1d9e
Compare
Yep, this is the end result I'd like to see. I think that Bundler should be extension to RubyGems, not the other way around. But it seems we are on the same page after all :)
Just to explain, I was not defending Molinillo. I was just pointing out there are already other dependency resolvers. However, the PIP discussion might be enlightening, why e.g. libsolv might not be the right choice. |
Makes sense! The "why there needs to be a new resolver" and then suggesting an alternative resolver confused me 😅. I do defend Molinillo by the way, it has done the job so far, and I'm sure it provided a much better alternative to what we had when it was first introduced. But it's time to move on to something better! The PIP link was an interesting read, thanks! The outcome confused me a bit because it sounds like they went with something else that's not Pub Grub but I tend to recall pub grub style messages from running pip... 🤔 |
I think they have some (probably implementation specific) concerns, which disqualified the implementation, not the algorithm. |
7a8867b
to
349f4d5
Compare
These are now specs, not spec groups.
We already have a "silent" level in our standard logger, so we don't really need a special class.
So that we can feed it to PubGrub.
In general, when unlocking dependencies, we only care about their names.
This is only used for materialization, and for example, metadata spec groups don't need it, so no need to set them all on initialization.
It's set again a few lines later.
ae56c54
to
48bd51f
Compare
Great! Going in then! |
rubygems/rubygems#5960 Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
Hey! Which release this change will be included in? |
We'll release this with Bundler 2.4.0 in a few days/weeks. |
I am incredibly excited about this! Thank you so much for making it happen, @deivid-rodriguez! ❤️ |
What was the end-user or developer problem that led to this PR?
Our current resolve engine has performance issues where sometimes it will hang during resolution due to an excessive number of resolution steps. In addition to that, its resolution error messages tend to be confusing and too verbose, not highlighting the real resolution culprits.
What is your fix for the problem, implemented in this PR?
My fix is to migrate Bundler to use pub_grub instead.
Closes #3296.
Closes #5689.
Make sure the following tasks are checked