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

Globally silence default gem warnings #18259

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

Bo98
Copy link
Member

@Bo98 Bo98 commented Sep 5, 2024

Otherwise we're going to get spammed even more in Ruby 3.3.5, in ways that are arguably upstream bugs (require "json" now issues a deprecation warning for its internal code).

@Bo98 Bo98 force-pushed the silence-default-gems-warnings branch from e6e878e to eb5f476 Compare September 5, 2024 02:37
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.

Merging to unblock newer Portable Ruby but would be great to discuss more post-merge.

[Kernel.singleton_class, Kernel].each do |kernel_class|
next unless kernel_class.respond_to?(:no_warning_require, true)

kernel_class.alias_method :require, :no_warning_require
Copy link
Member

Choose a reason for hiding this comment

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

Can this use the Warning gem instead? Feels like a nicer API if possible.

Copy link
Member Author

@Bo98 Bo98 Sep 5, 2024

Choose a reason for hiding this comment

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

We already did but it never worked. I got spammed with base64 warnings every time I ran brew tests.

Ruby 3.3.5 also makes it significantly unclearer what needs it. fiddle is an obvious one but it seems that json and irb now need it too despite not being deprecated, because internally they use code that still depends on other deprecated bundled gems.

Copy link
Member

Choose a reason for hiding this comment

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

Cool, this approach makes sense then, thanks 👍🏻

@MikeMcQuaid MikeMcQuaid merged commit dfe28d8 into master Sep 5, 2024
27 checks passed
@MikeMcQuaid MikeMcQuaid deleted the silence-default-gems-warnings branch September 5, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants