warning: literal string will be frozen in the future
since Ruby 3.4.0
#4585
Labels
pending
To be done in the future
Describe the bug
warning: literal string will be frozen in the future
since Ruby 3.4.0According to https://bugs.ruby-lang.org/issues/20205,
String literals may be frozen by default in the future (maybe Ruby 4.0+).
A transition period will be provided for this change,
the warning is only displayed when Ruby is started with the -w option enabled at present.
In fact, if we run the test in Ruby HEAD, we will encounter many warnings.
https://github.com/fluent/fluentd/actions/runs/10277576606
While the performance gains are attractive,
it will affect all Ruby code used by fluentd if string literals were frozen by default:
Then, I investigate logs in https://github.com/fluent/fluentd/actions/runs/10277576606,
seems that the
msgpack
,rr
gems and Fluentd main codes encounter the warnings when running tests at present.However, the Fluentd plugins are not included.
We may need to set
RUBYOPT="-disable=frozen_string_literal"
to run Fluentd safely.To Reproduce
Run test on Ruby HEAD
Expected behavior
Works well
Your Environment
Your Configuration
Your Error Log
Additional context
No response
The text was updated successfully, but these errors were encountered: