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

[🐛 Bug]: [rb] Either declare or remove dependency on base64 #13447

Closed
Earlopain opened this issue Jan 16, 2024 · 6 comments · Fixed by #13454
Closed

[🐛 Bug]: [rb] Either declare or remove dependency on base64 #13447

Earlopain opened this issue Jan 16, 2024 · 6 comments · Fixed by #13454
Milestone

Comments

@Earlopain
Copy link
Contributor

What happened?

Ruby 3.3 shows a warning if the base64 gem is required without it being declared in the gemspec, Ruby 3.4 will throw an error.
See https://github.com/ruby/ruby/blob/master/doc/NEWS/NEWS-3.3.0.md#stdlib-updates

Many gems have opted to inline the base64 implementation, however this gem makes use of the urlsafe variants which are a bit more complex and not just a wrapper over pack/unpack. You would need to inline the entirety of https://github.com/ruby/base64/blob/9669a7d3b0e3b9a739969404daf58f912c58c6b3/lib/base64.rb, similar to newrelic/newrelic-ruby-agent#2378

How can we reproduce the issue?

Use `selenium-webdriver` on Ruby 3.3

Relevant log output

base64 is not part of the default gems since Ruby 3.4.0. Add it to your Gemfile.

Operating System

Irrelevant

Selenium version

Ruby master

What are the browser(s) and version(s) where you see this issue?

Irrelevant

What are the browser driver(s) and version(s) where you see this issue?

Irrelevant

Are you using Selenium Grid?

No response

Copy link

@Earlopain, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@titusfortner
Copy link
Member

@Earlopain would you like to PR the change?

@Earlopain
Copy link
Contributor Author

Sure, I can do that. In which direction would you like this to go though? Add base64 to the gemspec or inline it instead?

I've already played with inlining it in a fork of mine here trunk...Earlopain:selenium:rb-base64-dep and that seems to work fine. But I'm not sure about the license thing I did there.

@titusfortner
Copy link
Member

I don't have strong opinions either way, so whatever you think is best.

Sounds like...

Gemspec

  • it's maintained by ruby org, so unlikely to stop being maintained
  • we need all of the code

Inline

  • minimize dependencies
  • unlikely to change

My general inclination is that I'd rather manage a dependency than maintain code unrelated to my repo, but other people balance that calculus differently, and this is not a hill I would die on. 😁

Earlopain added a commit to Earlopain/selenium that referenced this issue Jan 17, 2024
Ruby 3.3 shows a warning if requiring base64 without specifying it in the gemspec
Ruby 3.4 will throw a warning.
See https://github.com/ruby/ruby/blob/master/doc/NEWS/NEWS-3.3.0.md#stdlib-updates

Closes SeleniumHQ#13447
@Earlopain
Copy link
Contributor Author

As a consumer, I would prefer a minimal dependency tree. However I'm also not the one having to maintain it in the end.

I have already removed base64 from a bunch of gems already so my opinion on this is heavily biased. Most times, there were only one or two usages of the trivial wrapper methods.

I will defer to your decision on this. I don't think my opinion as a random passerby holds much weight.

Earlopain added a commit to Earlopain/selenium that referenced this issue Jan 18, 2024
Ruby 3.3 shows a warning if requiring base64 without specifying it in the gemspec
Ruby 3.4 will throw a warning.
See https://github.com/ruby/ruby/blob/master/doc/NEWS/NEWS-3.3.0.md#stdlib-updates

Closes SeleniumHQ#13447
@titusfortner titusfortner added this to the 4.17 milestone Jan 18, 2024
Earlopain added a commit to Earlopain/selenium that referenced this issue Jan 18, 2024
Ruby 3.3 shows a warning if requiring base64 without specifying it in the gemspec
Ruby 3.4 will throw a warning.
See https://github.com/ruby/ruby/blob/master/doc/NEWS/NEWS-3.3.0.md#stdlib-updates

Closes SeleniumHQ#13447
titusfortner added a commit that referenced this issue Jan 20, 2024
[rb] Add base64 gem as a runtime dependency

Ruby 3.3 shows a warning if requiring base64 without specifying it in the gemspec
Ruby 3.4 will throw a warning.
See https://github.com/ruby/ruby/blob/master/doc/NEWS/NEWS-3.3.0.md#stdlib-updates

Closes #13447

Co-authored-by: Titus Fortner <[email protected]>
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants