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

Support gemified set #4297

Merged
merged 9 commits into from
Jan 28, 2021
Merged

Support gemified set #4297

merged 9 commits into from
Jan 28, 2021

Conversation

deivid-rodriguez
Copy link
Member

What was the end-user or developer problem that led to this PR?

The problem is that users can't currently specify set in their Gemfiles with the version they want to use, because bundler uses set and activates the default version of set unconditionally.

To be honest though, the reason that made me work on this was not that one, but that I found that some usages of Set are actually much slower than using plan arrays. In particular, I was making some improvements to the resolver, and found that due to the nature of my changes (making inclusion checks on the @platforms array quite frequently), they were slowing down the resolver quite a lot (from 9 seconds to 12 seconds on a Gemfile proved problematic in the past). When switching to plain arrays, there was no performance penalty.

What is your fix for the problem, implemented in this PR?

My fix is to replace all usages of Set preventing it to be supported as a default gem, fixing both of the above issues.

This requires changes in both thor and Molinillo which I will propose upstream.

Fixes #3912.

Make sure the following tasks are checked

@deivid-rodriguez
Copy link
Member Author

@deivid-rodriguez
Copy link
Member Author

Thor PR was merged, Molinillo's one is waiting on feedback from Samuel. I'll update the comments about the vendored libraries and their differences with their latest released versions later.

@deivid-rodriguez
Copy link
Member Author

Thor 1.1.0 has been released 🎉, I'll update this PR to use that.

@deivid-rodriguez deivid-rodriguez marked this pull request as draft January 20, 2021 19:48
@deivid-rodriguez deivid-rodriguez marked this pull request as ready for review January 21, 2021 13:29
@deivid-rodriguez
Copy link
Member Author

I updated the PR to use thor 1.1.0. I wouldn't rely on the Molinillo PR to be attended soon, so this should be ready.

@deivid-rodriguez
Copy link
Member Author

Got some feedback in the Molinillo PR so I updated the PR in Molinillo and this PR to include the modified version.

@deivid-rodriguez
Copy link
Member Author

Pull request to Molinillo was merged, and now this PR reflects that.

Not sure why but removing usages of the default gem `set` triggers some
missing `Bundler::SharedHelpers::OpenSSL` missing constant errors.

Fully qualify these usages to avoid it.
Actually making this a set seems to be a very noticiable performance
penalty in some cases. It's not necessary so remove it.
Since it has changes to lazily load `set`.
So it can be used by rubygems too.
Copy link
Member

@hsbt hsbt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm +1 for the changes under the lib/* and bundler/lib/*.

@deivid-rodriguez
Copy link
Member Author

Thanks @hsbt! I will review @segiddins comment, and try to get this ready soon.

@deivid-rodriguez
Copy link
Member Author

deivid-rodriguez commented Jan 28, 2021

Let's do this and see how it goes!

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.

Handle promotion of set to a default gem
4 participants