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

Hack fix for Sorbet hidden definitions update failing on Ruby 3 #16281

Merged
merged 3 commits into from Dec 3, 2023

Conversation

Bo98
Copy link
Member

@Bo98 Bo98 commented Dec 1, 2023

Fixes error seen in #16279.

The hidden definition finder goes through requires all of Homebrew's code and its dependencies. This includes section of the code that autoloads rdoc (via yard). When the hidden definition finder goes through all defined constants to see what it doesn't know about, it hits the autoload on RDoc::Servlet which unfortunately causes it to abort the process entirely as rdoc/servlet uses abort rather than letting standard LoadError happen: https://github.com/ruby/ruby/blob/v3_1_4/lib/rdoc/servlet.rb#L10. We workaround this by providing a stubbed webrick.

We will probably eventually phase out hidden-definitions but that won't be done until well after the Ruby 3 migration is complete - we'll want an updated Tapioca etc first.

Copy link
Contributor

@apainintheneck apainintheneck left a comment

Choose a reason for hiding this comment

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

LGTM! Should the move to use Tapioca be added as a follow-up to the Ruby 3 epic or would it make more sense to create a new issue for that?

It looks like I misunderstood. The issue was more Tapioca dropping support for Ruby 2.6 so that should be solved automatically by the Ruby 3.x upgrade. Maybe an issue for phasing out hidden-definitions would make sense though.

@apainintheneck apainintheneck merged commit 0f39516 into Homebrew:master Dec 3, 2023
28 checks passed
@Bo98 Bo98 deleted the ruby3-hidden-defs-fix branch December 3, 2023 18:56
@Bo98
Copy link
Member Author

Bo98 commented Dec 3, 2023

Maybe an issue for phasing out hidden-definitions would make sense though.

Yeah it's something I need to see first what the steps required are. Quite a bit has changed in Tapioca in the past while so I need to catch up.

Updating all gems will happen towards the end of the Ruby 3 process, which will include Tapioca.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Works for me, thanks @Bo98!

@github-actions github-actions bot added the outdated PR was locked due to age label Jan 4, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants