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

Migrate our resolver engine to PubGrub #5960

Merged
merged 43 commits into from
Nov 11, 2022
Merged

Migrate our resolver engine to PubGrub #5960

merged 43 commits into from
Nov 11, 2022

Conversation

deivid-rodriguez
Copy link
Member

@deivid-rodriguez deivid-rodriguez commented Sep 30, 2022

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

@voxik
Copy link
Contributor

voxik commented Oct 20, 2022

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.

@simi
Copy link
Member

simi commented Oct 20, 2022

I understand this is WIP, but seeing the new resolver as part of Bundler instead of RubyGems does not seems to be right.

Can you explain why it is not 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.

Per my understanding it should be much faster. Some info is at https://github.com/gel-rb/gel#why-should-i-use-gel.

@deivid-rodriguez
Copy link
Member Author

deivid-rodriguez commented Oct 20, 2022

I understand this is WIP, but seeing the new resolver as part of Bundler instead of RubyGems does not seems to be right.

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 :)

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.

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.

@voxik
Copy link
Contributor

voxik commented Oct 26, 2022

I guess you mean we should also migrate the RubyGems resolver, and eventually keep everything in RubyGems?

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 :)

BTW I also wonder, why there needs to be new resolver.

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.

@deivid-rodriguez
Copy link
Member Author

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... 🤔

@voxik
Copy link
Contributor

voxik commented Oct 27, 2022

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... thinking

I think they have some (probably implementation specific) concerns, which disqualified the implementation, not the algorithm.

@deivid-rodriguez
Copy link
Member Author

Great! Going in then!

@deivid-rodriguez deivid-rodriguez merged commit 26807a5 into master Nov 11, 2022
@deivid-rodriguez deivid-rodriguez deleted the pub_grub branch November 11, 2022 20:48
hsbt added a commit to ruby/ruby that referenced this pull request Nov 11, 2022
  rubygems/rubygems#5960

  Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
@krzysiek1507
Copy link

Hey! Which release this change will be included in?

@deivid-rodriguez
Copy link
Member Author

We'll release this with Bundler 2.4.0 in a few days/weeks.

@duckinator
Copy link
Member

I am incredibly excited about this! Thank you so much for making it happen, @deivid-rodriguez! ❤️

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

Successfully merging this pull request may close these issues.

Very slow dependency resolving Small improvement to dependency resolution conflict messages
9 participants