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

Vendor net-http, net-protocol, resolv, and timeout to reduce conflicts between Gemfile gems and internal dependencies #6793

Merged
merged 11 commits into from
Dec 12, 2023

Conversation

deivid-rodriguez
Copy link
Member

@deivid-rodriguez deivid-rodriguez commented Jul 4, 2023

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

Problems with our internal usage of default gems getting in the middle of our users.

Running the following script on Ruby 3.2 without any timeout version other than the default install reproduces the issue:

require 'bundler/inline'

gemfile(true) do
  source 'https://rubygems.org'
  gem 'timeout'
end

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

Vendor net-http, net-protocol, resolv, and timeout.

Make sure the following tasks are checked

@deivid-rodriguez deivid-rodriguez force-pushed the vendor-net-http-and-net-protocol branch 6 times, most recently from 345c68c to f5ec01a Compare July 4, 2023 19:54
@deivid-rodriguez deivid-rodriguez force-pushed the vendor-net-http-and-net-protocol branch 3 times, most recently from f8c3f72 to 19c1afc Compare August 9, 2023 12:36
@deivid-rodriguez deivid-rodriguez force-pushed the vendor-net-http-and-net-protocol branch 3 times, most recently from 00523b3 to 95ddd86 Compare November 10, 2023 20:28
@deivid-rodriguez
Copy link
Member Author

I'd like to add a spec for the user problem this is fixing, but other than that it's ready. I know @hsbt does not like this, so I'd like to ask more opinions to avoid just imposing my perspective.

I already said why I think we should do this in #6773 (comment).

I know it's annoying to vendor 10K lines of code, but it is what it is right now. Also I think it's good that Bundler & RubyGems will always use the same code for these gems, rather than having varying behavior depending on which version of net/http or whatever is installed in the user's system. I did get confused by this in the past.

@hsbt
Copy link
Member

hsbt commented Dec 1, 2023

Thank you for considering that. I understood this problem and your concern.

I worried that is not only for code management. The official ruby package size is increased in recent years.

ruby-2.7.8.tar.gz 16950365
ruby-3.0.6.tar.gz 21315725
ruby-3.1.4.tar.gz 20917933
ruby-3.2.2.tar.gz 20467023
ruby-3.3.0-preview3.tar.gz 21550473

It's not only caused vendoring code. Especially, Ruby 3.3 has Prism parser and related code. Ruby core team are also negative to manage duplicated code like net-http, timeout on ruby repo.

I have no idea to resolve both problem that are specified any versions and not vendoring them.

@deivid-rodriguez
Copy link
Member Author

deivid-rodriguez commented Dec 6, 2023

I don't think increased ruby package size is a strong reason to not do this, to be honest. This PR "just" increases about 70K the rubygems package size.

@deivid-rodriguez deivid-rodriguez force-pushed the vendor-net-http-and-net-protocol branch 2 times, most recently from 967ef1e to 8f765e1 Compare December 7, 2023 12:22
@deivid-rodriguez deivid-rodriguez marked this pull request as ready for review December 7, 2023 13:39
@deivid-rodriguez deivid-rodriguez changed the title Vendor a few gems used internally Vendor net-http, net-protocol, resolv, and timeout to reduce conflicts between Gemfile gems and internal dependencies Dec 7, 2023
Copy link
Member

@martinemde martinemde left a comment

Choose a reason for hiding this comment

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

I thought about this a bunch and talked with @deivid-rodriguez. I don't think this is the very best long term solution. I'd imagine rg&b playing nicely with any version of a stdlib that is loaded. However, this is not where this project is at right now, so I think we should stick with the plan in the RFC until we have a better plan. This is consistent with that plan.

@deivid-rodriguez deivid-rodriguez force-pushed the vendor-net-http-and-net-protocol branch 3 times, most recently from bcab4c9 to 9f73bfb Compare December 12, 2023 17:05
@deivid-rodriguez
Copy link
Member Author

Since I got someone else to back me up, and @hsbt said privately he's ok with vendoring if we decide so, I set this PR to be merged after CI.

@deivid-rodriguez deivid-rodriguez merged commit 57d458c into master Dec 12, 2023
80 checks passed
@deivid-rodriguez deivid-rodriguez deleted the vendor-net-http-and-net-protocol branch December 12, 2023 19:19
Rakefile Show resolved Hide resolved
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.

None yet

4 participants