Skip to content

Conversation

larouxn
Copy link
Contributor

@larouxn larouxn commented Dec 21, 2024

Disclaimer: I'm not that familiar with this gem. Simply trying to address Ruby 3.4 issues as it will be released in a few days and the amount of warning messages when running our application on Ruby 3.4 is quite large. Thankfully the fixes seem pretty straightforward.

  1. Add base64 to the Gemspec as a runtime dependency as it's no longer a default gem as of Ruby 3.4.
  2. Add frozen_string_literal: true directive and dup all strings that we attempt to modify in place with force_encoding as in place string modification is forbidden with said directive in place.

Resolves #25

@larouxn larouxn changed the title Add Ruby 3.4 support Support Ruby 3.4 Dec 27, 2024
@larouxn
Copy link
Contributor Author

larouxn commented Jan 16, 2025

FYI, have been running this branch in production on Ruby 3.4.1 without issue for a day or so now.

@larouxn
Copy link
Contributor Author

larouxn commented Feb 6, 2025

👋 @anakinj, is this something you'd be able to look into reviewing, merging, and releasing?

(tagging as I see you've been active over in jwt/ruby-jwt)

@anakinj
Copy link
Member

anakinj commented Feb 6, 2025

Hi. I'd love to help but I don't currently have powers to merge or release the jwe gem. I'll reach out to @francescobbo to see if he would be willing to extend the powers a bit.

@anakinj
Copy link
Member

anakinj commented Feb 15, 2025

@larouxn Could you be so kind and rebase your branch. Now I have powers and did a little refresh on the CI.

larouxn and others added 2 commits February 16, 2025 09:49
The warning that appears without this change is:

  warning: base64 was loaded from the standard library, but is not part of the default gems starting from Ruby 3.4.0.
  You can add base64 to your Gemfile or gemspec to silence this warning.
Co-authored-by: Étienne Barrié <etienne.barrie@gmail.com>
@larouxn
Copy link
Contributor Author

larouxn commented Feb 16, 2025

👋 @anakinj, sure thing! Just rebased on latest master. Should be good to go now, pending your review.

Additionally noting that this PR fixes the Ruby 3.4 CI failure on master as shown here in branch CI.

@anakinj anakinj merged commit 4d1b11b into jwt:master Feb 16, 2025
9 checks passed
@larouxn larouxn deleted the ruby_3.4_support branch February 16, 2025 08:01
@larouxn larouxn restored the ruby_3.4_support branch February 16, 2025 13:55
@larouxn larouxn deleted the ruby_3.4_support branch February 17, 2025 00:50
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.

Ruby 3.4 warnings: freezing strings and base64 no longer default gem

4 participants