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

Add logger as dependency to address the warning in Ruby 3.4 #68

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

taketo1113
Copy link

This pull request has been created to address the warning of loading logger gem from standard library in Ruby 3.4. It will cause an error in Ruby 3.5.

The reason this warning started appearing is due to changes in the bundled gems for Ruby 3.5.
https://bugs.ruby-lang.org/issues/20309

Steps to reproduce

The steps to reproduce the warning are as follows:

$ ruby -v
ruby 3.4.0dev (2024-10-29T07:56:32Z master 21b3dfa03b) +PRISM [arm64-darwin23]

$ bundle exec ruby -e 'require "logger"'
-e:1: warning: logger was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0.
You can add logger to your Gemfile or gemspec to silence this warning.

Expected behavior

With Ruby 3.3 and earlier, it works like this:

$ ruby -v
ruby 3.3.6 (2024-11-05 revision 75015d4c1f) [arm64-darwin23]

$ bundle exec ruby -e 'require "logger"'
$

Changes

This Pull Request changes to add logger as a runtime dependency to fix the warning in Ruby 3.4.

Additional information

In mercenary, logger is used as follows:
https://github.com/jekyll/mercenary/blob/main/lib/mercenary.rb#L5

@ashmaroli
Copy link
Member

Thank you for submitting this pull request, @taketo1113.

However, since the upstream change will only "break" from Ruby 3.5.0 (Xmas 2025) onwards, we will merge this pull request after Ruby 3.4.0 release and CI workflow updates.

@taketo1113
Copy link
Author

@ashmaroli Thank you for your comment.

However, since the upstream change will only "break" from Ruby 3.5.0 (Xmas 2025) onwards, we will merge this pull request after Ruby 3.4.0 release and CI workflow updates.

That's right.
I agree that merging after the release of Ruby 3.4 is a good idea.

If necessary, shall I also create a pull request to update the CI for Ruby 3.4?
(It seems that there are only CI configurations for Ruby 2.5 and 2.7 at the moment, and CI for Ruby 3.0 and above is missing.)

@ashmaroli
Copy link
Member

Right now, you would have to use a ruby-head directive to load Ruby 3.4.0 in CI. So, I recommend waiting till the Xmas release to submit the pull request to update CI.

Even if someone else submits a similar PR before you do, I will make sure that your PR gets higher priority for getting merged.

@taketo1113
Copy link
Author

I got it.

After Ruby 3.4 is released, if there are no CI updates, I’ll create a pull request.
Thank you for considering this!

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