Skip to content

Commit 9f4c9dc

Browse files
committed
Disable default behavior of frozen_string_literal for Ruby 3.4+
According to https://bugs.ruby-lang.org/issues/20205, it will enable `# frozen_string_literal: true` by default in the future Ruby. This changing will affect many Fluentd plugins, and they will require to be deal with it properly. But I think it is too tough. So, this patch will set `--disable=frozen_string_literal` as launch option to disable default behavior for `# frozen_string_literal: true` in future Ruby. GitHub: fluentGH-4585 Signed-off-by: Watson <[email protected]>
1 parent 5618dd0 commit 9f4c9dc

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Rake::TestTask.new(:base_test) do |t|
4343
end
4444
t.verbose = true
4545
t.warning = true
46-
t.ruby_opts = ["-Eascii-8bit:ascii-8bit"]
46+
t.ruby_opts = ["-Eascii-8bit:ascii-8bit --disable=frozen_string_literal"]
4747
end
4848

4949
task :parallel_test do

lib/fluent/supervisor.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,8 @@ def build_spawn_command
10191019
fluentd_spawn_cmd = [ServerEngine.ruby_bin_path]
10201020
end
10211021

1022+
fluentd_spawn_cmd << '--disable=frozen_string_literal'
1023+
10221024
rubyopt = ENV['RUBYOPT']
10231025
if rubyopt
10241026
encodes, others = rubyopt.split(' ').partition { |e| e.match?(RUBY_ENCODING_OPTIONS_REGEX) }

0 commit comments

Comments
 (0)