From b5b271888ad1efc9111e2bf6375d4856b5fe23a3 Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Mon, 16 Jan 2023 13:45:50 +0900 Subject: [PATCH 01/15] Switch bundled ruby to 3.2 Since Ruby 2.7 is close to EOL, we are going to switch bundled Ruby to 3.2. We'll ship it as td-agent 5.0. TODO: Install Rust to build environment to build YJIT. Signed-off-by: Takuro Ashie --- td-agent/Rakefile | 61 +- td-agent/config.rb | 25 +- ...-Removed-the-old-executables-of-racc.patch | 634 ------------------ ...4f6d2f39bcd1ff04516591cc18d4027ab186.patch | 30 - ...confusion-of-received-response-messa.patch | 53 -- 5 files changed, 19 insertions(+), 784 deletions(-) delete mode 100644 td-agent/patches/ruby-2.7/0001-Removed-the-old-executables-of-racc.patch delete mode 100644 td-agent/patches/ruby-2.7/0002-Fixup-a6864f6d2f39bcd1ff04516591cc18d4027ab186.patch delete mode 100644 td-agent/patches/ruby-3.0/0001-ruby-resolv-Fix-confusion-of-received-response-messa.patch diff --git a/td-agent/Rakefile b/td-agent/Rakefile index 7ee171ac9..eed7e7fa3 100755 --- a/td-agent/Rakefile +++ b/td-agent/Rakefile @@ -168,31 +168,11 @@ def tar_command end end -def use_ruby3? - # Check whether ubuntu 22.04 (jammy) or not - # Basically, TD Agent adopts ruby 2.7 as default version, but on Ubuntu 22.04, - # use ruby 3.x because distribution switches to OpenSSL 3.x. - return false unless File.exist?("/etc/os-release") - os_release_entries = File.open("/etc/os-release").readlines.map(&:strip) - return true if os_release_entries.include?("UBUNTU_CODENAME=jammy") and os_release_entries.include?("ID=ubuntu") - return true if os_release_entries.include?("PLATFORM_ID=\"platform:el9\"") - return true if os_release_entries.include?("PLATFORM_ID=\"platform:al2022\"") - return false -end - -def bundled_ruby_version - use_ruby3? ? BUNDLED_RUBY3_VERSION : BUNDLED_RUBY_VERSION -end - -def bundled_ruby_source_sha256sum - use_ruby3? ? BUNDLED_RUBY3_SOURCE_SHA256SUM : BUNDLED_RUBY_SOURCE_SHA256SUM -end - class DownloadTask include Rake::DSL attr_reader :file_jemalloc_source - attr_reader :file_ruby_source, :file_ruby3_source, :file_ruby_installer_x64 + attr_reader :file_ruby_source, :file_ruby_installer_x64 attr_reader :file_fluentd_archive attr_reader :files_ruby_gems attr_reader :file_openssl_source, :file_mingw_openssl @@ -207,7 +187,6 @@ class DownloadTask @file_openssl_source, @file_mingw_openssl, @file_ruby_source, - @file_ruby3_source, @file_ruby_installer_x64, @file_fluentd_archive, *@files_ruby_gems @@ -227,7 +206,7 @@ class DownloadTask task :jemalloc => [@file_jemalloc_source] desc "Download Ruby source" - task :ruby => [@file_ruby_source, @file_ruby3_source, @file_ruby_installer_x64] + task :ruby => [@file_ruby_source, @file_ruby_installer_x64] desc "Clone fluentd repository and create a tarball" task :fluentd => @file_fluentd_archive @@ -299,24 +278,14 @@ class DownloadTask end def define_ruby_source_file - [[BUNDLED_RUBY_VERSION, BUNDLED_RUBY_SOURCE_SHA256SUM], - [BUNDLED_RUBY3_VERSION, BUNDLED_RUBY3_SOURCE_SHA256SUM]].each do |version, sha256sum| - filename = "ruby-#{version}.tar.gz" - feature_version = version.match(/^(\d+\.\d+)/)[0] - url_base = "https://cache.ruby-lang.org/pub/ruby/" - url = "#{url_base}#{feature_version}/#{filename}" - - if version.start_with?("3") - @file_ruby3_source = File.join(DOWNLOADS_DIR, filename) - file @file_ruby3_source do - download_file(url, filename, sha256sum) - end - else - @file_ruby_source = File.join(DOWNLOADS_DIR, filename) - file @file_ruby_source do - download_file(url, filename, sha256sum) - end - end + filename = "ruby-#{BUNDLED_RUBY_VERSION}.tar.gz" + feature_version = BUNDLED_RUBY_VERSION.match(/^(\d+\.\d+)/)[0] + url_base = "https://cache.ruby-lang.org/pub/ruby/" + url = "#{url_base}#{feature_version}/#{filename}" + + @file_ruby_source = File.join(DOWNLOADS_DIR, filename) + file @file_ruby_source do + download_file(url, filename, BUNDLED_RUBY_SOURCE_SHA256SUM) end end @@ -687,7 +656,7 @@ class BuildTask BUNDLED_RUBY_PATCHES.each do |patch| patch_name, version_condition = patch dependency = Gem::Dependency.new('', version_condition) - if dependency.match?('', bundled_ruby_version) + if dependency.match?('', BUNDLED_RUBY_VERSION) patch_path = File.join(__dir__, "patches", patch_name) sh("patch", "-p1", "--input=#{patch_path}") end @@ -804,11 +773,7 @@ class BuildTask end def build_ruby_from_source - tarball = if use_ruby3? - @download_task.file_ruby3_source - else - @download_task.file_ruby_source - end + tarball = @download_task.file_ruby_source ruby_source_dir = tarball.sub(/\.tar\.gz$/, '') sh(*tar_command, "xvf", tarball, "-C", DOWNLOADS_DIR) @@ -953,7 +918,7 @@ class BuildTask if windows? ruby_version = BUNDLED_RUBY_INSTALLER_X64_VERSION else - ruby_version = bundled_ruby_version + ruby_version = BUNDLED_RUBY_VERSION end rb_major, rb_minor, rb_teeny = ruby_version.split("-", 2).first.split(".", 3) "#{rb_major}.#{rb_minor}.0" # gem path's teeny version is always 0 diff --git a/td-agent/config.rb b/td-agent/config.rb index 463f625d7..117d14b55 100644 --- a/td-agent/config.rb +++ b/td-agent/config.rb @@ -20,30 +20,17 @@ BUNDLER_VERSION= "2.3.18" # https://www.ruby-lang.org/en/downloads/ (tar.gz) -BUNDLED_RUBY_VERSION = "2.7.6" -BUNDLED_RUBY_SOURCE_SHA256SUM = "e7203b0cc09442ed2c08936d483f8ac140ec1c72e37bb5c401646b7866cb5d10" -#BUNDLED_RUBY_VERSION = "3.0.4" -#BUNDLED_RUBY_SOURCE_SHA256SUM = "70b47c207af04bce9acea262308fb42893d3e244f39a4abc586920a1c723722b" -#BUNDLED_RUBY_VERSION = "3.1.2" -#BUNDLED_RUBY_SOURCE_SHA256SUM = "61843112389f02b735428b53bb64cf988ad9fb81858b8248e22e57336f24a83e" - -BUNDLED_RUBY3_VERSION = "3.1.2" -BUNDLED_RUBY3_SOURCE_SHA256SUM = "61843112389f02b735428b53bb64cf988ad9fb81858b8248e22e57336f24a83e" +BUNDLED_RUBY_VERSION = "3.2.0" +BUNDLED_RUBY_SOURCE_SHA256SUM = "daaa78e1360b2783f98deeceb677ad900f3a36c0ffa6e2b6b19090be77abc272" BUNDLED_RUBY_PATCHES = [ - ["ruby-2.7/0001-Removed-the-old-executables-of-racc.patch", ["~> 2.7.0"]], - ["ruby-2.7/0002-Fixup-a6864f6d2f39bcd1ff04516591cc18d4027ab186.patch", ["~> 2.7.0"]], - ["ruby-3.0/0001-ruby-resolv-Fix-confusion-of-received-response-messa.patch", ["= 2.7.3"]], - ["ruby-3.0/0001-ruby-resolv-Fix-confusion-of-received-response-messa.patch", ["= 3.0.1"]], + # An example entry: + # ["ruby-3.0/0001-ruby-resolv-Fix-confusion-of-received-response-messa.patch", ["= 3.0.1"]], ] # https://rubyinstaller.org/downloads/ (7-ZIP ARCHIVES) -BUNDLED_RUBY_INSTALLER_X64_VERSION = "2.7.6-1" -BUNDLED_RUBY_INSTALLER_X64_SHA256SUM = "7c74064a4c410a866e37dc04bf35945dc1c7c313f32a4bf773e145662bbc285a" -#BUNDLED_RUBY_INSTALLER_X64_VERSION = "3.0.4-1" -#BUNDLED_RUBY_INSTALLER_X64_SHA256SUM = "0c272c995e8247ab7a9db176e84cec46044d15c2cc318d3973def8a410df2b61" -#BUNDLED_RUBY_INSTALLER_X64_VERSION = "3.1.2-1" -#BUNDLED_RUBY_INSTALLER_X64_SHA256SUM = "637039c18dd4ad4a1fed326eed8caca8a686b79cee68bf6b85636bf9ec3a083c" +BUNDLED_RUBY_INSTALLER_X64_VERSION = "3.2.0-1" +BUNDLED_RUBY_INSTALLER_X64_SHA256SUM = "c89a52859e9b008f73ad2bb2bce57b70b40ed90ccce68eefe16e49803bbb2c41" # Patch files are assumed to be for Ruby's source tree, then applied to # lib/ruby/x.y.0 in RubyInstaller. So that "-p2" options will be passed diff --git a/td-agent/patches/ruby-2.7/0001-Removed-the-old-executables-of-racc.patch b/td-agent/patches/ruby-2.7/0001-Removed-the-old-executables-of-racc.patch deleted file mode 100644 index 968313d55..000000000 --- a/td-agent/patches/ruby-2.7/0001-Removed-the-old-executables-of-racc.patch +++ /dev/null @@ -1,634 +0,0 @@ -From a6864f6d2f39bcd1ff04516591cc18d4027ab186 Mon Sep 17 00:00:00 2001 -From: Hiroshi SHIBATA -Date: Wed, 1 Jan 2020 07:42:42 +0900 -Subject: [PATCH 1/2] Removed the old executables of racc - - [ruby-core:93516][Feature #15982] - - https://github.com/ruby/racc/pull/123 ---- - bin/racc2y | 27 ---- - bin/y2racc | 27 ---- - libexec/racc2y | 195 ---------------------------- - libexec/y2racc | 339 ------------------------------------------------- - 4 files changed, 588 deletions(-) - delete mode 100755 bin/racc2y - delete mode 100755 bin/y2racc - delete mode 100755 libexec/racc2y - delete mode 100755 libexec/y2racc - -diff --git a/bin/racc2y b/bin/racc2y -deleted file mode 100755 -index a1e4352632..0000000000 ---- a/bin/racc2y -+++ /dev/null -@@ -1,27 +0,0 @@ --#!/usr/bin/env ruby --# --# This file was generated by RubyGems. --# --# The application 'racc' is installed as part of a gem, and --# this file is here to facilitate running it. --# -- --require 'rubygems' -- --version = ">= 0.a" -- --if ARGV.first -- str = ARGV.first -- str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding -- if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then -- version = $1 -- ARGV.shift -- end --end -- --if Gem.respond_to?(:activate_bin_path) --load Gem.activate_bin_path('racc', 'racc2y', version) --else --gem "racc", version --load Gem.bin_path("racc", "racc2y", version) --end -diff --git a/bin/y2racc b/bin/y2racc -deleted file mode 100755 -index 023615f369..0000000000 ---- a/bin/y2racc -+++ /dev/null -@@ -1,27 +0,0 @@ --#!/usr/bin/env ruby --# --# This file was generated by RubyGems. --# --# The application 'racc' is installed as part of a gem, and --# this file is here to facilitate running it. --# -- --require 'rubygems' -- --version = ">= 0.a" -- --if ARGV.first -- str = ARGV.first -- str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding -- if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then -- version = $1 -- ARGV.shift -- end --end -- --if Gem.respond_to?(:activate_bin_path) --load Gem.activate_bin_path('racc', 'y2racc', version) --else --gem "racc", version --load Gem.bin_path("racc", "y2racc", version) --end -diff --git a/libexec/racc2y b/libexec/racc2y -deleted file mode 100755 -index f88d73ed2c..0000000000 ---- a/libexec/racc2y -+++ /dev/null -@@ -1,195 +0,0 @@ --#!/usr/local/bin/ruby --# --# $Id$ --# --# Copyright (c) 1999-2006 Minero Aoki --# --# This program is feee software. --# You can distribute/modify this program under the terms of --# the GNU LGPL, Lesser General Public License version 2.1. --# For details of the LGPL, see the file "COPYING". --# -- --require 'racc/grammarfileparser' --require 'racc/info' --require 'optparse' -- --def main -- @with_action = true -- with_header = false -- with_inner = false -- with_footer = false -- output = nil -- parser = OptionParser.new -- parser.banner = "Usage: #{File.basename($0)} [-AHIF] [-oFILENAME] GRAMMARFILE" -- parser.on('-o', '--output=FILENAME', 'output file name [.yacc]') {|name| -- output = name -- } -- parser.on('-A', '--without-action', 'Does not include actions.') { -- @with_action = false -- } -- parser.on('-H', '--with-header', 'Includes header part.') { -- with_header = true -- } -- parser.on('-I', '--with-inner', 'Includes inner part.') { -- with_inner = true -- } -- parser.on('-F', '--with-footer', 'Includes footer part.') { -- with_footer = true -- } -- parser.on('--version', 'Prints version and quit.') { -- puts "racc2y version #{Racc::Version}" -- exit 0 -- } -- parser.on('--copyright', 'Prints copyright and quit.') { -- puts Racc::Copyright -- exit 0 -- } -- parser.on('--help', 'Prints this message and quit.') { -- puts parser.help -- exit 1 -- } -- begin -- parser.parse! -- rescue OptionParser::ParseError => err -- $stderr.puts err.message -- $stderr.puts parser.help -- exit 1 -- end -- if ARGV.empty? -- $stderr.puts "no input file" -- exit 1 -- end -- unless ARGV.size == 1 -- $stderr.puts "too many inputs" -- exit 1 -- end -- input = ARGV[0] -- -- begin -- result = Racc::GrammarFileParser.parse_file(input) -- result.grammar.init -- File.open(output || "#{input}.yacc", 'w') {|f| -- f.puts "/* generated from #{input} */" -- if with_header -- f.puts -- f.puts '%{' -- print_user_codes f, result.params.header -- f.puts '%}' -- end -- f.puts -- print_terminals f, result.grammar -- f.puts -- print_precedence_table f, precedence_table(result.grammar) -- f.puts -- f.puts '%%' -- print_grammar f, result.grammar -- f.puts '%%' -- if with_inner -- f.puts '/*---- inner ----*/' -- print_user_codes f, result.params.inner -- end -- if with_footer -- f.puts '/*---- footer ----*/' -- print_user_codes f, result.params.footer -- end -- } -- rescue SystemCallError => err -- $stderr.puts err.message -- exit 1 -- end --end -- --def print_terminals(f, grammar) -- init_indent = '%token'.size -- f.print '%token' -- columns = init_indent -- grammar.symboltable.each_terminal do |t| -- next unless t.terminal? -- next if t.dummy? -- next if t == grammar.symboltable.anchor -- next if t == grammar.symboltable.error -- unless t.value.kind_of?(String) -- if columns > 60 -- f.puts -- f.print ' ' * init_indent -- columns = init_indent -- end -- columns += f.write(" #{yacc_symbol(t)}") -- end -- end -- f.puts --end -- --def precedence_table(grammar) -- table = [] -- grammar.symboltable.select {|sym| sym.precedence }.each do |sym| -- (table[sym.prec] ||= [sym.assoc]).push sym -- end -- table.compact --end -- --def print_precedence_table(f, table) -- return if table.empty? -- f.puts '/* precedance table */' -- table.each do |syms| -- assoc = syms.shift -- f.printf '%%%-8s ', assoc.to_s.downcase -- f.puts syms.map {|s| yacc_symbol(s) }.join(' ') -- end -- f.puts --end -- --def print_grammar(f, grammar) -- prev_target = nil -- indent = 10 -- embactions = [] -- grammar.each do |rule| -- if rule.target.dummy? -- embactions.push rule.action unless rule.action.empty? -- next -- end -- if rule.target == prev_target -- f.print ' ' * indent, '|' -- else -- prev_target = rule.target -- f.printf "\n%-10s:", yacc_symbol(prev_target) -- end -- rule.symbols.each do |s| -- if s.dummy? # target of dummy rule for embedded action -- f.puts -- print_action f, embactions.shift, indent -- f.print ' ' * (indent + 1) -- else -- f.print ' ', yacc_symbol(s) -- end -- end -- if rule.specified_prec -- f.print ' %prec ', yacc_symbol(rule.specified_prec) -- end -- f.puts -- unless rule.action.empty? -- print_action f, rule.action, indent -- end -- end --end -- --def print_action(f, action, indent) -- return unless @with_action -- f.print ' ' * (indent + 4), "{\n" -- f.print ' ' * (indent + 6), action.source.text.strip, "\n" -- f.print ' ' * (indent + 4) , "}\n" --end -- --def print_user_codes(f, srcs) -- return if srcs.empty? -- srcs.each do |src| -- f.puts src.text -- end --end -- --def yacc_symbol(s) -- s.to_s.gsub('"', "'") --end -- --main -diff --git a/libexec/y2racc b/libexec/y2racc -deleted file mode 100755 -index 7933f94153..0000000000 ---- a/libexec/y2racc -+++ /dev/null -@@ -1,339 +0,0 @@ --#!/usr/local/bin/ruby --# --# $Id$ --# --# Copyright (c) 1999-2006 Minero Aoki --# --# This program is free software. --# You can distribute/modify this program under the terms of --# the GNU LGPL, Lesser General Public License version 2.1. --# For details of the GNU LGPL, see the file "COPYING". --# -- --require 'racc/info' --require 'strscan' --require 'forwardable' --require 'optparse' -- --def main -- @with_action = true -- @with_header = false -- @with_usercode = false -- cname = 'MyParser' -- input = nil -- output = nil -- parser = OptionParser.new -- parser.banner = "Usage: #{File.basename($0)} [-Ahu] [-c ] [-o ] " -- parser.on('-o', '--output=FILENAME', 'output file name [.racc]') {|name| -- output = name -- } -- parser.on('-c', '--classname=NAME', "Name of the parser class. [#{cname}]") {|name| -- cname = name -- } -- parser.on('-A', '--without-action', 'Does not include actions.') { -- @with_action = false -- } -- parser.on('-h', '--with-header', 'Includes header (%{...%}).') { -- @with_header = true -- } -- parser.on('-u', '--with-user-code', 'Includes user code.') { -- @with_usercode = true -- } -- parser.on('--version', 'Prints version and quit.') { -- puts "y2racc version #{Racc::Version}" -- exit 0 -- } -- parser.on('--copyright', 'Prints copyright and quit.') { -- puts Racc::Copyright -- exit 0 -- } -- parser.on('--help', 'Prints this message and quit.') { -- puts parser.help -- exit 1 -- } -- begin -- parser.parse! -- rescue OptionParser::ParseError => err -- $stderr.puts err.message -- $stderr.puts parser.help -- exit 1 -- end -- if ARGV.empty? -- $stderr.puts 'no input' -- exit 1 -- end -- if ARGV.size > 1 -- $stderr.puts 'too many input' -- exit 1 -- end -- input = ARGV[0] -- -- begin -- result = YaccFileParser.parse_file(input) -- File.open(output || "#{input}.racc", 'w') {|f| -- convert cname, result, f -- } -- rescue SystemCallError => err -- $stderr.puts err.message -- exit 1 -- end --end -- --def convert(classname, result, f) -- init_indent = 'token'.size -- f.puts %<# Converted from "#{result.filename}" by y2racc version #{Racc::Version}> -- f.puts -- f.puts "class #{classname}" -- unless result.terminals.empty? -- f.puts -- f.print 'token' -- columns = init_indent -- result.terminals.each do |t| -- if columns > 60 -- f.puts -- f.print ' ' * init_indent -- columns = init_indent -- end -- columns += f.write(" #{t}") -- end -- f.puts -- end -- unless result.precedence_table.empty? -- f.puts -- f.puts 'preclow' -- result.precedence_table.each do |assoc, toks| -- f.printf " %-8s %s\n", assoc, toks.join(' ') unless toks.empty? -- end -- f.puts 'prechigh' -- end -- if result.start -- f.puts -- f.puts "start #{@start}" -- end -- -- f.puts -- f.puts 'rule' -- texts = @with_action ? result.grammar : result.grammar_without_actions -- texts.each do |text| -- f.print text -- end -- -- if @with_header and result.header -- f.puts -- f.puts '---- header' -- f.puts result.header -- end -- if @with_usercode and result.usercode -- f.puts -- f.puts '---- footer' -- f.puts result.usercode -- end --end -- --class ParseError < StandardError; end -- --class StringScanner_withlineno -- def initialize(src) -- @s = StringScanner.new(src) -- @lineno = 1 -- end -- -- extend Forwardable -- def_delegator "@s", :eos? -- def_delegator "@s", :rest -- -- attr_reader :lineno -- -- def scan(re) -- advance_lineno(@s.scan(re)) -- end -- -- def scan_until(re) -- advance_lineno(@s.scan_until(re)) -- end -- -- def skip(re) -- str = advance_lineno(@s.scan(re)) -- str ? str.size : nil -- end -- -- def getch -- advance_lineno(@s.getch) -- end -- -- private -- -- def advance_lineno(str) -- @lineno += str.count("\n") if str -- str -- end --end -- --class YaccFileParser -- -- Result = Struct.new(:terminals, :precedence_table, :start, -- :header, :grammar, :usercode, :filename) -- class Result # reopen -- def initialize -- super -- self.terminals = [] -- self.precedence_table = [] -- self.start = nil -- self.grammar = [] -- self.header = nil -- self.usercode = nil -- self.filename = nil -- end -- -- def grammar_without_actions -- grammar().map {|text| text[0,1] == '{' ? '{}' : text } -- end -- end -- -- def YaccFileParser.parse_file(filename) -- new().parse(File.read(filename), filename) -- end -- -- def parse(src, filename = '-') -- @result = Result.new -- @filename = filename -- @result.filename = filename -- s = StringScanner_withlineno.new(src) -- parse_header s -- parse_grammar s -- @result -- end -- -- private -- -- COMMENT = %r -- CHAR = /'((?:[^'\\]+|\\.)*)'/ -- STRING = /"((?:[^"\\]+|\\.)*)"/ -- -- def parse_header(s) -- skip_until_percent s -- until s.eos? -- case -- when t = s.scan(/left/) -- @result.precedence_table.push ['left', scan_symbols(s)] -- when t = s.scan(/right/) -- @result.precedence_table.push ['right', scan_symbols(s)] -- when t = s.scan(/nonassoc/) -- @result.precedence_table.push ['nonassoc', scan_symbols(s)] -- when t = s.scan(/token/) -- list = scan_symbols(s) -- list.shift if /\A<(.*)>\z/ =~ list[0] -- @result.terminals.concat list -- when t = s.scan(/start/) -- @result.start = scan_symbols(s)[0] -- when s.skip(%r<(?: -- type | union | expect | thong | binary | -- semantic_parser | pure_parser | no_lines | -- raw | token_table -- )\b>x) -- skip_until_percent s -- when s.skip(/\{/) # header (%{...%}) -- str = s.scan_until(/\%\}/) -- str.chop! -- str.chop! -- @result.header = str -- skip_until_percent s -- when s.skip(/\%/) # grammar (%%...) -- return -- else -- raise ParseError, "#{@filename}:#{s.lineno}: scan error" -- end -- end -- end -- -- def skip_until_percent(s) -- until s.eos? -- s.skip /[^\%\/]+/ -- next if s.skip(COMMENT) -- return if s.getch == '%' -- end -- end -- -- def scan_symbols(s) -- list = [] -- until s.eos? -- s.skip /\s+/ -- if s.skip(COMMENT) -- ; -- elsif t = s.scan(CHAR) -- list.push t -- elsif t = s.scan(STRING) -- list.push t -- elsif s.skip(/\%/) -- break -- elsif t = s.scan(/\S+/) -- list.push t -- else -- raise ParseError, "#{@filename}:#{@lineno}: scan error" -- end -- end -- list -- end -- -- def parse_grammar(s) -- buf = [] -- until s.eos? -- if t = s.scan(/[^%'"{\/]+/) -- buf.push t -- break if s.eos? -- end -- if s.skip(/\{/) -- buf.push scan_action(s) -- elsif t = s.scan(/'(?:[^'\\]+|\\.)*'/) then buf.push t -- elsif t = s.scan(/"(?:[^"\\]+|\\.)*"/) then buf.push t -- elsif t = s.scan(COMMENT) then buf.push t -- elsif s.skip(/%prec\b/) then buf.push '=' -- elsif s.skip(/%%/) -- @result.usercode = s.rest -- break -- else -- buf.push s.getch -- end -- end -- @result.grammar = buf -- end -- -- def scan_action(s) -- buf = '{' -- nest = 1 -- until s.eos? -- if t = s.scan(%r<[^/{}'"]+>) -- buf << t -- break if s.eos? -- elsif t = s.scan(COMMENT) -- buf << t -- elsif t = s.scan(CHAR) -- buf << t -- elsif t = s.scan(STRING) -- buf << t -- else -- c = s.getch -- buf << c -- case c -- when '{' -- nest += 1 -- when '}' -- nest -= 1 -- return buf if nest == 0 -- end -- end -- end -- $stderr.puts "warning: unterminated action in #{@filename}" -- buf -- end -- --end -- --unless Object.method_defined?(:funcall) -- class Object -- alias funcall __send__ -- end --end -- -- --main --- -2.20.1 - diff --git a/td-agent/patches/ruby-2.7/0002-Fixup-a6864f6d2f39bcd1ff04516591cc18d4027ab186.patch b/td-agent/patches/ruby-2.7/0002-Fixup-a6864f6d2f39bcd1ff04516591cc18d4027ab186.patch deleted file mode 100644 index a7eb5c9fa..000000000 --- a/td-agent/patches/ruby-2.7/0002-Fixup-a6864f6d2f39bcd1ff04516591cc18d4027ab186.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 69731b248f12f52c3897584db914cdf04a8ce5ac Mon Sep 17 00:00:00 2001 -From: Hiroshi SHIBATA -Date: Wed, 1 Jan 2020 07:53:27 +0900 -Subject: [PATCH 2/2] Fixup a6864f6d2f39bcd1ff04516591cc18d4027ab186 - ---- - lib/racc/racc.gemspec | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/lib/racc/racc.gemspec b/lib/racc/racc.gemspec -index 6beb16c5b4..6ed031bfe1 100644 ---- a/lib/racc/racc.gemspec -+++ b/lib/racc/racc.gemspec -@@ -16,11 +16,11 @@ - s.email = [nil, "aaron@tenderlovemaking.com"] - s.homepage = "http://i.loveruby.net/en/projects/racc/" - s.licenses = ["MIT"] -- s.executables = ["racc", "racc2y", "y2racc"] -+ s.executables = ["racc"] - s.files = [ - "COPYING", "ChangeLog", "DEPENDS", "Manifest.txt", - "README.ja.rdoc", "README.rdoc", "Rakefile", "TODO", "bin/racc", -- "bin/racc2y", "bin/y2racc", "ext/racc/MANIFEST", -+ "ext/racc/MANIFEST", - "ext/racc/com/headius/racc/Cparse.java", "ext/racc/cparse.c", - "ext/racc/depend", "ext/racc/extconf.rb", "fastcache/extconf.rb", - "fastcache/fastcache.c", "lib/racc.rb", "lib/racc/compat.rb", --- -2.20.1 - diff --git a/td-agent/patches/ruby-3.0/0001-ruby-resolv-Fix-confusion-of-received-response-messa.patch b/td-agent/patches/ruby-3.0/0001-ruby-resolv-Fix-confusion-of-received-response-messa.patch deleted file mode 100644 index b8bc0e3c9..000000000 --- a/td-agent/patches/ruby-3.0/0001-ruby-resolv-Fix-confusion-of-received-response-messa.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 9edc162583a4f685332239f6249745ad9b518cbe Mon Sep 17 00:00:00 2001 -From: Kazuki Yamaguchi -Date: Fri, 26 Mar 2021 18:16:07 +0900 -Subject: [PATCH] [ruby/resolv] Fix confusion of received response message - -This is a follow up for commit 33fb966197f1 ("Remove sender/message_id -pair after response received in resolv", 2020-09-11). - -As the @senders instance variable is also used for tracking transaction -ID allocation, simply removing an entry without releasing the ID would -eventually deplete the ID space and cause -Resolv::DNS.allocate_request_id to hang. - -It seems the intention of the code was to check that the received DNS -message is actually the response for the question made within the method -earlier. Let's have it actually do so. - -[Bug #12838] https://bugs.ruby-lang.org/issues/12838 -[Bug #17748] https://bugs.ruby-lang.org/issues/17748 - -https://github.com/ruby/resolv/commit/53ca9c9209 ---- - lib/resolv.rb | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/lib/resolv.rb b/lib/resolv.rb -index 3ca0f01cfe..b69c7045ca 100644 ---- a/lib/resolv.rb -+++ b/lib/resolv.rb -@@ -696,17 +696,17 @@ def request(sender, tout) - rescue DecodeError - next # broken DNS message ignored - end -- if s = sender_for(from, msg) -+ if sender == sender_for(from, msg) - break - else - # unexpected DNS message ignored - end - end -- return msg, s.data -+ return msg, sender.data - end - - def sender_for(addr, msg) -- @senders.delete([addr,msg.id]) -+ @senders[[addr,msg.id]] - end - - def close --- -2.30.2 - From 4314ccb2e14a5cdc316ce3ed8318fd64941bb15e Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Mon, 16 Jan 2023 14:14:35 +0900 Subject: [PATCH 02/15] Remove debian-buster & ubuntu-bionic from default targets Because they are already or close to EOL, we'll drop supporting them from the next release. Signed-off-by: Takuro Ashie --- .github/workflows/apt-arm.yml | 8 -------- .github/workflows/apt.yml | 8 -------- td-agent/Rakefile | 2 -- 3 files changed, 18 deletions(-) diff --git a/.github/workflows/apt-arm.yml b/.github/workflows/apt-arm.yml index 61024bc03..b6f5d6e43 100644 --- a/.github/workflows/apt-arm.yml +++ b/.github/workflows/apt-arm.yml @@ -10,21 +10,13 @@ jobs: fail-fast: false matrix: label: - - Debian GNU/Linux buster arm64 - Debian GNU/Linux bullseye arm64 - - Ubuntu Bionic arm64 - Ubuntu Focal arm64 - Ubuntu Jammy arm64 include: - - label: Debian GNU/Linux buster arm64 - rake-job: debian-buster - test-docker-image: arm64v8/debian:buster - label: Debian GNU/Linux bullseye arm64 rake-job: debian-bullseye test-docker-image: arm64v8/debian:bullseye - - label: Ubuntu Bionic arm64 - rake-job: ubuntu-bionic - test-docker-image: arm64v8/ubuntu:bionic - label: Ubuntu Focal arm64 rake-job: ubuntu-focal rake-options: LINTIAN=no diff --git a/.github/workflows/apt.yml b/.github/workflows/apt.yml index 3cf3ec4bc..c037c991d 100644 --- a/.github/workflows/apt.yml +++ b/.github/workflows/apt.yml @@ -10,21 +10,13 @@ jobs: fail-fast: false matrix: label: - - Debian GNU/Linux buster amd64 - Debian GNU/Linux bullseye amd64 - - Ubuntu Bionic amd64 - Ubuntu Focal amd64 - Ubuntu Jammy amd64 include: - - label: Debian GNU/Linux buster amd64 - rake-job: debian-buster - test-docker-image: debian:buster - label: Debian GNU/Linux bullseye amd64 rake-job: debian-bullseye test-docker-image: debian:bullseye - - label: Ubuntu Bionic amd64 - rake-job: ubuntu-bionic - test-docker-image: ubuntu:bionic - label: Ubuntu Focal amd64 rake-job: ubuntu-focal test-docker-image: ubuntu:focal diff --git a/td-agent/Rakefile b/td-agent/Rakefile index eed7e7fa3..0b5bad21d 100755 --- a/td-agent/Rakefile +++ b/td-agent/Rakefile @@ -1293,9 +1293,7 @@ EOS def apt_targets_default [ - "debian-buster", "debian-bullseye", - "ubuntu-bionic", "ubuntu-focal", "ubuntu-jammy", ] From b78adbbb2938bd00ed5b8728f31a9b7294d13420 Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Mon, 16 Jan 2023 15:40:02 +0900 Subject: [PATCH 03/15] Use devtoolset-11 for CentOS 7 to build Ruby 3.2 Signed-off-by: Takuro Ashie --- td-agent/yum/centos-7/Dockerfile | 12 +++++++----- td-agent/yum/td-agent.spec.in | 7 +++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/td-agent/yum/centos-7/Dockerfile b/td-agent/yum/centos-7/Dockerfile index b4d109f1f..d3bb1597f 100644 --- a/td-agent/yum/centos-7/Dockerfile +++ b/td-agent/yum/centos-7/Dockerfile @@ -29,7 +29,8 @@ RUN \ yum install -y ${quiet} epel-release && \ yum groupinstall -y ${quiet} "Development Tools" && \ yum install -y ${quiet} \ - rh-ruby26-ruby-devel \ + devtoolset-11 \ + rh-ruby26-ruby-devel \ rh-ruby26-rubygems \ rh-ruby26-rubygem-rake \ rh-ruby26-rubygem-bundler \ @@ -48,8 +49,9 @@ RUN \ zlib-devel \ rpmlint \ cmake3 && \ - # raise IPv4 priority - echo "precedence ::ffff:0:0/96 100" > /etc/gai.conf && \ - # enable multiplatform feature - source /opt/rh/rh-ruby26/enable && gem install --no-document --install-dir /opt/rh/rh-ruby26/root/usr/share/gems bundler builder && \ + # raise IPv4 priority + echo "precedence ::ffff:0:0/96 100" > /etc/gai.conf && \ + # enable multiplatform feature + source /opt/rh/rh-ruby26/enable && gem install --no-document --install-dir /opt/rh/rh-ruby26/root/usr/share/gems bundler builder && \ + scl enable devtoolset-11 bash && \ yum clean ${quiet} all diff --git a/td-agent/yum/td-agent.spec.in b/td-agent/yum/td-agent.spec.in index f65276942..a9bc01c0b 100644 --- a/td-agent/yum/td-agent.spec.in +++ b/td-agent/yum/td-agent.spec.in @@ -21,6 +21,7 @@ %define _amazon_ver %{?amzn:%{amzn}}%{!?amzn:0} %define _suse_ver %{?suse_version:%{suse_version}}%{!?suse_version:0} %define use_suse (%{_suse_ver} >= 1315) +%define use_scl_gcc (%{_centos_ver} <= 7 && %{_amazon_ver} == 0) %define use_scl_ruby (%{_centos_ver} <= 7 && %{_amazon_ver} == 0) %define use_devtoolset (%{_centos_ver} <= 6 && %{_amazon_ver} == 0) %if %{_centos_ver} <= 6 @@ -139,8 +140,14 @@ The stable distribution of Fluentd, called td-agent. %setup -q -n @PACKAGE@-%{version} %build +%if %{use_scl_gcc} +. /opt/rh/devtoolset-11/enable +%endif %install +%if %{use_scl_gcc} +. /opt/rh/devtoolset-11/enable +%endif %if %{use_scl_ruby} . /opt/rh/rh-ruby%{scl_ruby_ver}/enable %endif From 243da62bfb4784c782b4ca2e07f1a32de27f7a29 Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Tue, 17 Jan 2023 01:13:57 +0900 Subject: [PATCH 04/15] yum: Install Rust to build YJIT of Ruby Signed-off-by: Takuro Ashie --- td-agent/yum/almalinux-9/Dockerfile | 3 ++- td-agent/yum/amazonlinux-2/Dockerfile | 3 ++- td-agent/yum/amazonlinux-2022/Dockerfile | 3 ++- td-agent/yum/centos-7/Dockerfile | 3 ++- td-agent/yum/centos-8/Dockerfile | 11 ++++++----- td-agent/yum/centos-stream-8/Dockerfile | 11 ++++++----- td-agent/yum/rockylinux-8/Dockerfile | 3 ++- td-agent/yum/td-agent.spec.in | 4 ++-- 8 files changed, 24 insertions(+), 17 deletions(-) diff --git a/td-agent/yum/almalinux-9/Dockerfile b/td-agent/yum/almalinux-9/Dockerfile index 0fe279033..536c58ebf 100644 --- a/td-agent/yum/almalinux-9/Dockerfile +++ b/td-agent/yum/almalinux-9/Dockerfile @@ -52,4 +52,5 @@ RUN \ echo "precedence ::ffff:0:0/96 100" > /etc/gai.conf && \ # enable multiplatform feature gem install --no-document --install-dir /usr/share/gems bundler builder && \ - yum clean ${quiet} all + yum clean ${quiet} all && \ + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y diff --git a/td-agent/yum/amazonlinux-2/Dockerfile b/td-agent/yum/amazonlinux-2/Dockerfile index 9cf9ac43c..491c4ee34 100644 --- a/td-agent/yum/amazonlinux-2/Dockerfile +++ b/td-agent/yum/amazonlinux-2/Dockerfile @@ -49,4 +49,5 @@ RUN \ echo "precedence ::ffff:0:0/96 100" > /etc/gai.conf && \ # enable multiplatform feature gem install --no-document bundler builder && \ - yum clean ${quiet} all + yum clean ${quiet} all && \ + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y diff --git a/td-agent/yum/amazonlinux-2022/Dockerfile b/td-agent/yum/amazonlinux-2022/Dockerfile index 60dc388ee..f432a1d79 100644 --- a/td-agent/yum/amazonlinux-2022/Dockerfile +++ b/td-agent/yum/amazonlinux-2022/Dockerfile @@ -52,4 +52,5 @@ RUN \ echo "precedence ::ffff:0:0/96 100" > /etc/gai.conf && \ # enable multiplatform feature gem install --no-document bundler builder && \ - yum clean ${quiet} all + yum clean ${quiet} all && \ + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y diff --git a/td-agent/yum/centos-7/Dockerfile b/td-agent/yum/centos-7/Dockerfile index d3bb1597f..673f041a9 100644 --- a/td-agent/yum/centos-7/Dockerfile +++ b/td-agent/yum/centos-7/Dockerfile @@ -54,4 +54,5 @@ RUN \ # enable multiplatform feature source /opt/rh/rh-ruby26/enable && gem install --no-document --install-dir /opt/rh/rh-ruby26/root/usr/share/gems bundler builder && \ scl enable devtoolset-11 bash && \ - yum clean ${quiet} all + yum clean ${quiet} all && \ + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y diff --git a/td-agent/yum/centos-8/Dockerfile b/td-agent/yum/centos-8/Dockerfile index 15ddf944b..0a33e18b6 100644 --- a/td-agent/yum/centos-8/Dockerfile +++ b/td-agent/yum/centos-8/Dockerfile @@ -49,8 +49,9 @@ RUN \ rpmlint \ cmake \ libarchive && \ - # raise IPv4 priority - echo "precedence ::ffff:0:0/96 100" > /etc/gai.conf && \ - # enable multiplatform feature - gem install --no-document --install-dir /usr/share/gems bundler builder && \ - yum clean ${quiet} all + # raise IPv4 priority + echo "precedence ::ffff:0:0/96 100" > /etc/gai.conf && \ + # enable multiplatform feature + gem install --no-document --install-dir /usr/share/gems bundler builder && \ + yum clean ${quiet} all && \ + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y diff --git a/td-agent/yum/centos-stream-8/Dockerfile b/td-agent/yum/centos-stream-8/Dockerfile index 6a8802517..9a39148ae 100644 --- a/td-agent/yum/centos-stream-8/Dockerfile +++ b/td-agent/yum/centos-stream-8/Dockerfile @@ -52,8 +52,9 @@ RUN \ rpmlint \ cmake \ libarchive && \ - # raise IPv4 priority - echo "precedence ::ffff:0:0/96 100" > /etc/gai.conf && \ - # enable multiplatform feature - gem install --no-document --install-dir /usr/share/gems bundler builder && \ - yum clean ${quiet} all + # raise IPv4 priority + echo "precedence ::ffff:0:0/96 100" > /etc/gai.conf && \ + # enable multiplatform feature + gem install --no-document --install-dir /usr/share/gems bundler builder && \ + yum clean ${quiet} all && \ + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y diff --git a/td-agent/yum/rockylinux-8/Dockerfile b/td-agent/yum/rockylinux-8/Dockerfile index eadb86748..6d6604332 100644 --- a/td-agent/yum/rockylinux-8/Dockerfile +++ b/td-agent/yum/rockylinux-8/Dockerfile @@ -52,4 +52,5 @@ RUN \ echo "precedence ::ffff:0:0/96 100" > /etc/gai.conf && \ # enable multiplatform feature gem install --no-document --install-dir /usr/share/gems bundler builder && \ - yum clean ${quiet} all + yum clean ${quiet} all && \ + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y diff --git a/td-agent/yum/td-agent.spec.in b/td-agent/yum/td-agent.spec.in index a9bc01c0b..d45c80834 100644 --- a/td-agent/yum/td-agent.spec.in +++ b/td-agent/yum/td-agent.spec.in @@ -156,11 +156,11 @@ The stable distribution of Fluentd, called td-agent. %endif %if %{use_systemd} rake build:rpm_config TD_AGENT_STAGING_PATH=%{buildroot} NO_VAR_RUN=1 -rake build:all TD_AGENT_STAGING_PATH=%{buildroot} +rake build:all TD_AGENT_STAGING_PATH=%{buildroot} PATH="$HOME/.cargo/bin:$PATH" %else rake build:rpm_old_config TD_AGENT_STAGING_PATH=%{buildroot} NO_VAR_RUN=0 # Fat gem of nokogiri 1.11 requires glibc 2.17 which doesn't exist on CentOS 6 -rake build:all TD_AGENT_STAGING_PATH=%{buildroot} REBUILD_GEMS="nokogiri" +rake build:all TD_AGENT_STAGING_PATH=%{buildroot} REBUILD_GEMS="nokogiri" PATH="$HOME/.cargo/bin:$PATH" %endif mkdir -p %{buildroot}%{_mandir}/man1 cp @PACKAGE@/debian/*.1 %{buildroot}%{_mandir}/man1/ From 0a4e61a223dd70f7ce91bae6ff0feaa3b6dc1fcb Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Tue, 17 Jan 2023 10:16:13 +0900 Subject: [PATCH 05/15] yum: Require libffi-devel to build Fiddle The source code of libffi is no longer bundled as of Ruby 3.2. Signed-off-by: Takuro Ashie --- td-agent/yum/almalinux-9/Dockerfile | 1 + td-agent/yum/amazonlinux-2/Dockerfile | 1 + td-agent/yum/amazonlinux-2022/Dockerfile | 2 +- td-agent/yum/centos-7/Dockerfile | 1 + td-agent/yum/centos-8/Dockerfile | 1 + td-agent/yum/centos-stream-8/Dockerfile | 1 + td-agent/yum/rockylinux-8/Dockerfile | 1 + td-agent/yum/td-agent.spec.in | 2 +- 8 files changed, 8 insertions(+), 2 deletions(-) diff --git a/td-agent/yum/almalinux-9/Dockerfile b/td-agent/yum/almalinux-9/Dockerfile index 536c58ebf..5a3ba3e43 100644 --- a/td-agent/yum/almalinux-9/Dockerfile +++ b/td-agent/yum/almalinux-9/Dockerfile @@ -35,6 +35,7 @@ RUN \ libedit-devel \ ncurses-devel \ libyaml-devel \ + libffi-devel \ git \ cyrus-sasl-devel \ nss-softokn-freebl-devel \ diff --git a/td-agent/yum/amazonlinux-2/Dockerfile b/td-agent/yum/amazonlinux-2/Dockerfile index 491c4ee34..649fe4531 100644 --- a/td-agent/yum/amazonlinux-2/Dockerfile +++ b/td-agent/yum/amazonlinux-2/Dockerfile @@ -32,6 +32,7 @@ RUN \ libedit-devel \ ncurses-devel \ libyaml-devel \ + libffi-devel \ git \ cyrus-sasl-devel \ nss-softokn-freebl-devel \ diff --git a/td-agent/yum/amazonlinux-2022/Dockerfile b/td-agent/yum/amazonlinux-2022/Dockerfile index f432a1d79..57df23794 100644 --- a/td-agent/yum/amazonlinux-2022/Dockerfile +++ b/td-agent/yum/amazonlinux-2022/Dockerfile @@ -31,6 +31,7 @@ RUN \ libedit-devel \ ncurses-devel \ libyaml-devel \ + libffi-devel \ git \ cyrus-sasl-devel \ nss-softokn-freebl-devel \ @@ -46,7 +47,6 @@ RUN \ ruby3.1 \ ruby3.1-rubygems \ ruby3.1-rubygem-rake \ - libffi-devel \ && \ # raise IPv4 priority echo "precedence ::ffff:0:0/96 100" > /etc/gai.conf && \ diff --git a/td-agent/yum/centos-7/Dockerfile b/td-agent/yum/centos-7/Dockerfile index 673f041a9..16eef1436 100644 --- a/td-agent/yum/centos-7/Dockerfile +++ b/td-agent/yum/centos-7/Dockerfile @@ -37,6 +37,7 @@ RUN \ libedit-devel \ ncurses-devel \ libyaml-devel \ + libffi-devel \ git \ cyrus-sasl-devel \ nss-softokn-freebl-devel \ diff --git a/td-agent/yum/centos-8/Dockerfile b/td-agent/yum/centos-8/Dockerfile index 0a33e18b6..8978dcb27 100644 --- a/td-agent/yum/centos-8/Dockerfile +++ b/td-agent/yum/centos-8/Dockerfile @@ -36,6 +36,7 @@ RUN \ libedit-devel \ ncurses-devel \ libyaml-devel \ + libffi-devel \ git \ cyrus-sasl-devel \ nss-softokn-freebl-devel \ diff --git a/td-agent/yum/centos-stream-8/Dockerfile b/td-agent/yum/centos-stream-8/Dockerfile index 9a39148ae..943cb3bb7 100644 --- a/td-agent/yum/centos-stream-8/Dockerfile +++ b/td-agent/yum/centos-stream-8/Dockerfile @@ -39,6 +39,7 @@ RUN \ libedit-devel \ ncurses-devel \ libyaml-devel \ + libffi-devel \ git \ cyrus-sasl-devel \ nss-softokn-freebl-devel \ diff --git a/td-agent/yum/rockylinux-8/Dockerfile b/td-agent/yum/rockylinux-8/Dockerfile index 6d6604332..729ea482d 100644 --- a/td-agent/yum/rockylinux-8/Dockerfile +++ b/td-agent/yum/rockylinux-8/Dockerfile @@ -35,6 +35,7 @@ RUN \ libedit-devel \ ncurses-devel \ libyaml-devel \ + libffi-devel \ git \ cyrus-sasl-devel \ nss-softokn-freebl-devel \ diff --git a/td-agent/yum/td-agent.spec.in b/td-agent/yum/td-agent.spec.in index d45c80834..b0f5bb17b 100644 --- a/td-agent/yum/td-agent.spec.in +++ b/td-agent/yum/td-agent.spec.in @@ -72,6 +72,7 @@ License: ASL 2.0 URL: https://www.treasuredata.com/ Source0: @PACKAGE@-@VERSION@.tar.gz +BuildRequires: libffi-devel %if %{use_scl_ruby} BuildRequires: rh-ruby%{scl_ruby_ver}-ruby-devel BuildRequires: rh-ruby%{scl_ruby_ver}-rubygems @@ -81,7 +82,6 @@ BuildRequires: rh-ruby%{scl_ruby_ver}-rubygem-bundler BuildRequires: ruby3.1 BuildRequires: ruby3.1-rubygems BuildRequires: ruby3.1-rubygem-rake -BuildRequires: libffi-devel %else %if %{_amazon_ver} > 0 BuildRequires: ruby From b7ddd36c664cccbf0895f2445e556661609079ae Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Mon, 16 Jan 2023 15:49:12 +0900 Subject: [PATCH 06/15] Bump up the package version to 5.0 The mater branch is now going to develop v5.0. Signed-off-by: Takuro Ashie --- td-agent/config.rb | 2 +- td-agent/debian/changelog | 6 ++++++ td-agent/yum/td-agent.spec.in | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/td-agent/config.rb b/td-agent/config.rb index 117d14b55..991e3fc86 100644 --- a/td-agent/config.rb +++ b/td-agent/config.rb @@ -1,5 +1,5 @@ PACKAGE_NAME = "td-agent" -PACKAGE_VERSION = "4.4.2" +PACKAGE_VERSION = "5.0.0" FLUENTD_REVISION = 'e89092ce1132a933c12bb23fe8c9323c07ca81f5' # v1.15.3 FLUENTD_LOCAL_GEM_REPO = "file://" + File.expand_path(File.join(__dir__, "local_gem_repo")) diff --git a/td-agent/debian/changelog b/td-agent/debian/changelog index aa7805fff..4da643ca2 100644 --- a/td-agent/debian/changelog +++ b/td-agent/debian/changelog @@ -1,3 +1,9 @@ +td-agent (5.0.0-1) unstable; urgency=low + + * New upstream release. + + -- Takuro Ashie Tue, 17 Jan 2023 02:21:26 -0000 + td-agent (4.4.2-1) unstable; urgency=low * New upstream release. diff --git a/td-agent/yum/td-agent.spec.in b/td-agent/yum/td-agent.spec.in index b0f5bb17b..e2d64d638 100644 --- a/td-agent/yum/td-agent.spec.in +++ b/td-agent/yum/td-agent.spec.in @@ -268,6 +268,9 @@ fi # NOTE: %{_tmpfilesdir} is available since CentOS 7 %attr(0755,td-agent,td-agent) %dir /tmp/@PACKAGE@ %changelog +* Tue Jan 17 2023 Takuro Ashie - 5.0.0-1 +- New upstream release. + * Tue Oct 25 2022 Takuro Ashie - 4.4.2-1 - New upstream release. From 6c37458f2cd208e3ec87aaa99bac8049c27b1341 Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Tue, 17 Jan 2023 14:12:53 +0900 Subject: [PATCH 07/15] apt: Add missing dev pacakges * libffi-dev: Need to build fiddle as of Ruby 3.2 * libreadline-dev: Originally it was not built for Debian based distros but is enabled on Red Hat based distros. Signed-off-by: Takuro Ashie --- td-agent/apt/debian-bullseye/Dockerfile | 2 ++ td-agent/apt/debian-buster/Dockerfile | 2 ++ td-agent/apt/ubuntu-bionic/Dockerfile | 2 ++ td-agent/apt/ubuntu-focal/Dockerfile | 2 ++ td-agent/apt/ubuntu-jammy/Dockerfile | 2 ++ 5 files changed, 10 insertions(+) diff --git a/td-agent/apt/debian-bullseye/Dockerfile b/td-agent/apt/debian-bullseye/Dockerfile index 4faf20493..d3555c4ab 100644 --- a/td-agent/apt/debian-bullseye/Dockerfile +++ b/td-agent/apt/debian-bullseye/Dockerfile @@ -41,6 +41,8 @@ RUN \ libedit2 \ libncurses5-dev \ libyaml-dev \ + libffi-dev \ + libreadline-dev \ git \ pkg-config \ libssl-dev \ diff --git a/td-agent/apt/debian-buster/Dockerfile b/td-agent/apt/debian-buster/Dockerfile index 21b2b4bd9..2beff7a91 100644 --- a/td-agent/apt/debian-buster/Dockerfile +++ b/td-agent/apt/debian-buster/Dockerfile @@ -41,6 +41,8 @@ RUN \ libedit2 \ libncurses5-dev \ libyaml-dev \ + libffi-dev \ + libreadline-dev \ git \ pkg-config \ libssl-dev \ diff --git a/td-agent/apt/ubuntu-bionic/Dockerfile b/td-agent/apt/ubuntu-bionic/Dockerfile index e47c79ffb..11d655b49 100644 --- a/td-agent/apt/ubuntu-bionic/Dockerfile +++ b/td-agent/apt/ubuntu-bionic/Dockerfile @@ -40,6 +40,8 @@ RUN \ libedit2 \ libncurses5-dev \ libyaml-dev \ + libffi-dev \ + libreadline-dev \ git \ pkg-config \ libssl-dev \ diff --git a/td-agent/apt/ubuntu-focal/Dockerfile b/td-agent/apt/ubuntu-focal/Dockerfile index 974e17a6b..a2cbbba83 100644 --- a/td-agent/apt/ubuntu-focal/Dockerfile +++ b/td-agent/apt/ubuntu-focal/Dockerfile @@ -40,6 +40,8 @@ RUN \ libedit2 \ libncurses5-dev \ libyaml-dev \ + libffi-dev \ + libreadline-dev \ git \ pkg-config \ libssl-dev \ diff --git a/td-agent/apt/ubuntu-jammy/Dockerfile b/td-agent/apt/ubuntu-jammy/Dockerfile index 848eedc8c..ea44d62e0 100644 --- a/td-agent/apt/ubuntu-jammy/Dockerfile +++ b/td-agent/apt/ubuntu-jammy/Dockerfile @@ -40,6 +40,8 @@ RUN \ libedit2 \ libncurses5-dev \ libyaml-dev \ + libffi-dev \ + libreadline-dev \ git \ pkg-config \ libssl-dev \ From ee80f48992faeec3e5b61f7b51e70feb230f3da9 Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Tue, 17 Jan 2023 13:04:03 +0900 Subject: [PATCH 08/15] apt: Install Rust to build YJIT of Ruby Signed-off-by: Takuro Ashie --- td-agent/apt/debian-bullseye/Dockerfile | 3 ++- td-agent/apt/debian-buster/Dockerfile | 3 ++- td-agent/apt/ubuntu-bionic/Dockerfile | 3 ++- td-agent/apt/ubuntu-focal/Dockerfile | 3 ++- td-agent/apt/ubuntu-jammy/Dockerfile | 3 ++- td-agent/debian/rules | 2 +- 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/td-agent/apt/debian-bullseye/Dockerfile b/td-agent/apt/debian-bullseye/Dockerfile index d3555c4ab..065cf3398 100644 --- a/td-agent/apt/debian-bullseye/Dockerfile +++ b/td-agent/apt/debian-bullseye/Dockerfile @@ -57,4 +57,5 @@ RUN \ sed -i'' -e 's,#precedence ::ffff:0:0/96 100,precedence ::ffff:0:0/96 100,' /etc/gai.conf && \ # enable multiplatform feature gem install --no-document --install-dir /usr/share/rubygems-integration/all bundler builder && \ - rm -rf /var/lib/apt/lists/* + rm -rf /var/lib/apt/lists/* && \ + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y diff --git a/td-agent/apt/debian-buster/Dockerfile b/td-agent/apt/debian-buster/Dockerfile index 2beff7a91..5bae66b27 100644 --- a/td-agent/apt/debian-buster/Dockerfile +++ b/td-agent/apt/debian-buster/Dockerfile @@ -58,4 +58,5 @@ RUN \ # enable multiplatform feature gem install --no-document --install-dir /usr/share/rubygems-integration/all bundler --version 2.3.26 && \ gem install --no-document --install-dir /usr/share/rubygems-integration/all builder && \ - rm -rf /var/lib/apt/lists/* + rm -rf /var/lib/apt/lists/* && \ + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y diff --git a/td-agent/apt/ubuntu-bionic/Dockerfile b/td-agent/apt/ubuntu-bionic/Dockerfile index 11d655b49..3c20e5cba 100644 --- a/td-agent/apt/ubuntu-bionic/Dockerfile +++ b/td-agent/apt/ubuntu-bionic/Dockerfile @@ -62,4 +62,5 @@ RUN \ # enable multiplatform feature gem install --no-document bundler --version 2.3.26 && \ gem install --no-document builder && \ - rm -rf /var/lib/apt/lists/* + rm -rf /var/lib/apt/lists/* && \ + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y diff --git a/td-agent/apt/ubuntu-focal/Dockerfile b/td-agent/apt/ubuntu-focal/Dockerfile index a2cbbba83..830fa96cc 100644 --- a/td-agent/apt/ubuntu-focal/Dockerfile +++ b/td-agent/apt/ubuntu-focal/Dockerfile @@ -56,4 +56,5 @@ RUN \ sed -i'' -e 's,#precedence ::ffff:0:0/96 100,precedence ::ffff:0:0/96 100,' /etc/gai.conf && \ # enable multiplatform feature gem install --no-document --install-dir /usr/share/rubygems-integration/all bundler builder && \ - rm -rf /var/lib/apt/lists/* + rm -rf /var/lib/apt/lists/* && \ + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y diff --git a/td-agent/apt/ubuntu-jammy/Dockerfile b/td-agent/apt/ubuntu-jammy/Dockerfile index ea44d62e0..a717f4c00 100644 --- a/td-agent/apt/ubuntu-jammy/Dockerfile +++ b/td-agent/apt/ubuntu-jammy/Dockerfile @@ -56,4 +56,5 @@ RUN \ sed -i'' -e 's,#precedence ::ffff:0:0/96 100,precedence ::ffff:0:0/96 100,' /etc/gai.conf && \ # enable multiplatform feature gem install --no-document --install-dir /usr/share/rubygems-integration/all bundler builder && \ - rm -rf /var/lib/apt/lists/* + rm -rf /var/lib/apt/lists/* && \ + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y diff --git a/td-agent/debian/rules b/td-agent/debian/rules index 2f9597697..c1cabec1c 100755 --- a/td-agent/debian/rules +++ b/td-agent/debian/rules @@ -13,7 +13,7 @@ override_dh_builddeb: override_dh_auto_install: rake build:deb_config TD_AGENT_STAGING_PATH="$(CURDIR)/debian/tmp" NO_VAR_RUN=1 - rake build:all TD_AGENT_STAGING_PATH="$(CURDIR)/debian/tmp" + rake build:all TD_AGENT_STAGING_PATH="$(CURDIR)/debian/tmp" PATH="$(HOME)/.cargo/bin:$(PATH)" dh_installman override_dh_auto_clean: From f526f0fb0111dd1d5f9a18b00d0cf78da8616b7d Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Tue, 17 Jan 2023 17:32:25 +0900 Subject: [PATCH 09/15] macOS: Enable Ruby's YJIT Signed-off-by: Takuro Ashie --- .github/workflows/macos.yml | 5 ++++- README.md | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 3d7f3b65b..2e5aecc6a 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -14,6 +14,9 @@ jobs: - name: Install cmake run: | brew install cmake + - name: Install Rust + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - name: Install gems run: | gem install bundler builder @@ -22,7 +25,7 @@ jobs: sudo mkdir /opt/td-agent sudo chown $(whoami) /opt/td-agent rm -rf td-agent/staging - rake dmg:selfbuild + rake dmg:selfbuild PATH="$HOME/.cargo/bin:$PATH" - name: Upload td-agent dmg uses: actions/upload-artifact@master with: diff --git a/README.md b/README.md index 70683e560..dc72f4d1d 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ Then restart Windows. * [Builder](https://rubygems.org/gems/builder) gem * Git * [CMake](https://cmake.org/) + * [Rust](https://www.rust-lang.org/) to enable Ruby's YJIT feature ## How to build .rpm package From 53076e76a1f183ad74b32f964d840b94f5eb50d6 Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Tue, 17 Jan 2023 18:40:53 +0900 Subject: [PATCH 10/15] Relax package size check to introduce Ruby 3.2 Signed-off-by: Takuro Ashie --- td-agent/yum/pkgsize-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/td-agent/yum/pkgsize-test.sh b/td-agent/yum/pkgsize-test.sh index 8cd5fc760..6a1f90213 100755 --- a/td-agent/yum/pkgsize-test.sh +++ b/td-agent/yum/pkgsize-test.sh @@ -65,7 +65,7 @@ for v in "${PREVIOUS_VERSIONS[@]}"; do done PREVIOUS_SIZE=$(stat -c %s $BASE_NAME) -THRESHOLD_SIZE=`echo "$PREVIOUS_SIZE * 1.2" | bc -l | cut -d. -f1` +THRESHOLD_SIZE=`echo "$PREVIOUS_SIZE * 1.3" | bc -l | cut -d. -f1` find $REPOSITORIES_DIR/${DISTRIBUTION} -name td-agent-*.rpm RPM=$(find $REPOSITORIES_DIR/${DISTRIBUTION}/${DISTRO_VERSION}/${ARCH}/Packages/td-agent-*.rpm -not -name '*debuginfo*' -not -name '*debugsource*' | sort -n | tail -1) CURRENT_SIZE=$(stat -c %s $RPM) From 450652dc2bc3e985b58656a28a319c5abb00cceb Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Wed, 18 Jan 2023 11:49:16 +0900 Subject: [PATCH 11/15] msi: Update build env * msys2 20221216.0.0 * Ruby 3.1.3.1 Signed-off-by: Takuro Ashie --- td-agent/msi/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/td-agent/msi/Dockerfile b/td-agent/msi/Dockerfile index 8f7d9dba8..37a00bfd4 100644 --- a/td-agent/msi/Dockerfile +++ b/td-agent/msi/Dockerfile @@ -26,8 +26,8 @@ RUN @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -I RUN \ choco install -y git wixtoolset 7zip & \ choco install -y cmake --installargs 'ADD_CMAKE_TO_PATH=System' && \ - choco install -y msys2 --params /NoUpdate --version=20220904.0.0 && \ - choco install ruby -y --version=3.0.4.1 && \ + choco install -y msys2 --params /NoUpdate --version=20221216.0.0 && \ + choco install ruby -y --version=3.1.3.1 && \ refreshenv && \ ridk install 3 && \ gem install --no-document --force bundler builder From 6c40b9a30c4b966d2c1c1904f3f352506eafca2e Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Wed, 18 Jan 2023 18:19:42 +0900 Subject: [PATCH 12/15] Add nokogiri 1.14.0 Signed-off-by: Takuro Ashie --- td-agent/Gemfile | 6 +++--- td-agent/Gemfile.lock | 30 +++++++++++++++--------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/td-agent/Gemfile b/td-agent/Gemfile index 5ea6e7357..88b3d50d2 100644 --- a/td-agent/Gemfile +++ b/td-agent/Gemfile @@ -74,14 +74,14 @@ gem "fluent-plugin-opensearch", "1.0.8" windows_platforms = [:mingw, :x64_mingw] # :mswin gem "ffi", "1.15.5", platforms: windows_platforms gem "ffi-win32-extensions", "1.0.4", platforms: windows_platforms -gem "nokogiri", "1.13.9", platforms: windows_platforms +gem "nokogiri", "1.14.0", platforms: windows_platforms gem "win32-event", "0.6.3", platforms: windows_platforms gem "win32-ipc", "0.7.0", platforms: windows_platforms gem "win32-service", "2.3.2", platforms: windows_platforms gem "winevt_c", "0.10.1", platforms: windows_platforms gem "win32-eventlog", "0.6.7", platforms: windows_platforms -gem "fluent-plugin-parser-winevt_xml", "0.2.4", platforms: windows_platforms -gem "fluent-plugin-windows-eventlog", "0.8.2", platforms: windows_platforms +gem "fluent-plugin-parser-winevt_xml", "0.2.5", platforms: windows_platforms +gem "fluent-plugin-windows-eventlog", "0.8.3", platforms: windows_platforms gem "fluent-plugin-windows-exporter", "1.0.0", platforms: windows_platforms not_windows_platforms = [:ruby] diff --git a/td-agent/Gemfile.lock b/td-agent/Gemfile.lock index e036cda83..c2bf48a6d 100644 --- a/td-agent/Gemfile.lock +++ b/td-agent/Gemfile.lock @@ -37,7 +37,7 @@ GEM protocol-http1 (~> 0.14.0) protocol-http2 (~> 0.14.0) traces (>= 0.4.0) - async-io (1.34.0) + async-io (1.34.1) async async-pool (0.3.12) async (>= 1.25) @@ -80,8 +80,8 @@ GEM elasticsearch-api (= 8.4.0) elasticsearch-api (8.4.0) multi_json - excon (0.93.1) - faraday (1.10.2) + excon (0.97.1) + faraday (1.10.3) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) @@ -112,7 +112,7 @@ GEM ffi-win32-extensions (1.0.4) ffi fiber-local (1.0.0) - fileutils (1.6.0) + fileutils (1.7.0) fluent-config-regexp-type (1.0.0) fluentd (> 1.0.0, < 2) fluent-diagtool (1.0.1) @@ -144,9 +144,9 @@ GEM faraday_middleware-aws-sigv4 fluentd (>= 0.14.22) opensearch-ruby - fluent-plugin-parser-winevt_xml (0.2.4) + fluent-plugin-parser-winevt_xml (0.2.5) fluentd (>= 0.14.12, < 2) - nokogiri (>= 1.12.5, < 1.14) + nokogiri (>= 1.12.5, < 1.15) fluent-plugin-prometheus (2.0.3) fluentd (>= 1.9.1, < 2) prometheus-client (>= 2.1.0) @@ -175,7 +175,7 @@ GEM fluent-plugin-webhdfs (1.5.0) fluentd (>= 0.14.22) webhdfs (>= 0.10.0) - fluent-plugin-windows-eventlog (0.8.2) + fluent-plugin-windows-eventlog (0.8.3) fluentd (>= 0.14.12, < 2) win32-eventlog winevt_c (>= 0.10.1) @@ -186,7 +186,7 @@ GEM http_parser.rb (0.8.0) httpclient (2.8.3) jmespath (1.6.1) - json (2.6.2) + json (2.6.3) linux-utmpx (0.3.0) bindata (~> 2.4.8) ltsv (0.1.2) @@ -195,7 +195,7 @@ GEM multi_json (1.15.0) multipart-post (2.2.3) nio4r (2.5.8) - nokogiri (1.13.9-x64-mingw32) + nokogiri (1.14.0-x64-mingw32) racc (~> 1.4) oj (3.13.17) opensearch-api (2.0.2) @@ -215,8 +215,8 @@ GEM protocol-http2 (0.14.2) protocol-hpack (~> 1.4) protocol-http (~> 0.18) - public_suffix (5.0.0) - racc (1.6.0) + public_suffix (5.0.1) + racc (1.6.2) rake (13.0.6) rdkafka (0.11.1) ffi (~> 1.15) @@ -251,7 +251,7 @@ GEM msgpack (>= 0.5.6, < 2.0) td-client (>= 0.8.66, < 2.0) timers (4.3.5) - traces (0.7.0) + traces (0.8.0) tzinfo (2.0.5) concurrent-ruby (~> 1.0) tzinfo-data (1.2022.5) @@ -301,7 +301,7 @@ DEPENDENCIES fluent-plugin-kafka (= 0.18.1) fluent-plugin-metrics-cmetrics (= 0.1.2) fluent-plugin-opensearch (= 1.0.8) - fluent-plugin-parser-winevt_xml (= 0.2.4) + fluent-plugin-parser-winevt_xml (= 0.2.5) fluent-plugin-prometheus (= 2.0.3) fluent-plugin-prometheus_pushgateway (= 0.1.0) fluent-plugin-record-modifier (= 2.1.1) @@ -312,7 +312,7 @@ DEPENDENCIES fluent-plugin-td (= 1.2.0) fluent-plugin-utmpx (= 0.5.0) fluent-plugin-webhdfs (= 1.5.0) - fluent-plugin-windows-eventlog (= 0.8.2) + fluent-plugin-windows-eventlog (= 0.8.3) fluent-plugin-windows-exporter (= 1.0.0) fluentd! http_parser.rb (= 0.8.0) @@ -320,7 +320,7 @@ DEPENDENCIES jmespath (= 1.6.1) mini_portile2 (= 2.8.0) msgpack (= 1.6.0) - nokogiri (= 1.13.9) + nokogiri (= 1.14.0) oj (= 3.13.17) opensearch-ruby (= 2.0.3) prometheus-client (= 2.1.0) From a1efa043b00daa7c924794d54922c9cf1b6b1c59 Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Fri, 20 Jan 2023 21:10:01 +0900 Subject: [PATCH 13/15] msi: Stop replacing OpenSSL in RubyInstaller Signed-off-by: Takuro Ashie --- td-agent/Rakefile | 37 ++----------------------------------- td-agent/config.rb | 4 ---- 2 files changed, 2 insertions(+), 39 deletions(-) diff --git a/td-agent/Rakefile b/td-agent/Rakefile index 0b5bad21d..4d5441b0d 100755 --- a/td-agent/Rakefile +++ b/td-agent/Rakefile @@ -175,7 +175,7 @@ class DownloadTask attr_reader :file_ruby_source, :file_ruby_installer_x64 attr_reader :file_fluentd_archive attr_reader :files_ruby_gems - attr_reader :file_openssl_source, :file_mingw_openssl + attr_reader :file_openssl_source def initialize(logger:) @logger = logger || Logger.new(STDOUT, level: Logger::Severity::INFO) @@ -185,7 +185,6 @@ class DownloadTask [ @file_jemalloc_source, @file_openssl_source, - @file_mingw_openssl, @file_ruby_source, @file_ruby_installer_x64, @file_fluentd_archive, @@ -199,7 +198,6 @@ class DownloadTask define_fluentd_archive define_gem_files define_openssl_file - define_mingw_openssl_file namespace :download do desc "Download jemalloc source" @@ -216,9 +214,6 @@ class DownloadTask desc "Download openssl source" task :openssl => @file_openssl_source - - desc "Download MinGW's openssl package" - task :mingw_openssl => @file_mingw_openssl end end @@ -303,20 +298,6 @@ class DownloadTask end end - def define_mingw_openssl_file - version = MINGW_OPENSSL_VERSION - sha256sum = MINGW_OPENSSL_SHA256SUM - filename = "mingw-w64-x86_64-openssl-#{version}-any.pkg.tar.zst" - url_base = "https://mirror.msys2.org/mingw/mingw64/" - url = "#{url_base}#{filename}" - - @file_mingw_openssl = File.join(DOWNLOADS_DIR, filename) - - file @file_mingw_openssl do - download_file(url, filename, sha256sum) - end - end - def define_fluentd_archive @file_fluentd_archive = File.join(DOWNLOADS_DIR, "fluentd-#{FLUENTD_REVISION}.tar.gz") file @file_fluentd_archive do @@ -415,10 +396,9 @@ class BuildTask end desc "Install Ruby for Windows" - task :rubyinstaller => [:"download:ruby", :"download:mingw_openssl"] do + task :rubyinstaller => [:"download:ruby"] do extract_ruby_installer apply_ruby_installer_patches - replace_openssl_in_ruby_installer setup_windows_build_env find_and_put_dynamiclibs end @@ -833,19 +813,6 @@ class BuildTask end end - # Fix memory leak in OpenSSL: https://github.com/fluent/fluent-package-builder/issues/374 - def replace_openssl_in_ruby_installer - tarball = @download_task.file_mingw_openssl - sh(*tar_command, "xvf", tarball, "-C", DOWNLOADS_DIR, "--force-local") - source_dir = File.join(DOWNLOADS_DIR, "mingw64", "bin") - ensure_directory(td_agent_staging_dir) do - dest_dir = File.join(".", "bin", "ruby_builtin_dlls") - cp(File.join(source_dir, "libcrypto-1_1-x64.dll"), dest_dir) - cp(File.join(source_dir, "libssl-1_1-x64.dll"), dest_dir) - end - rm_rf(source_dir) - end - def find_and_put_dynamiclibs begin require 'ruby_installer/runtime' diff --git a/td-agent/config.rb b/td-agent/config.rb index 991e3fc86..8ed825974 100644 --- a/td-agent/config.rb +++ b/td-agent/config.rb @@ -13,10 +13,6 @@ # https://www.openssl.org/source/ OPENSSL_VERSION = "1.1.1q" -# To fix memory leak issue: https://github.com/fluent/fluent-package-builder/issues/374 -MINGW_OPENSSL_VERSION = "1.1.1.q-1" -MINGW_OPENSSL_SHA256SUM = "4fb25397e48f6ab22e8b07d40519fddf3eec3dc6a163b2a1ecc68326d31fcb65" - BUNDLER_VERSION= "2.3.18" # https://www.ruby-lang.org/en/downloads/ (tar.gz) From 07050a4802cdec11744c264db3518f6bd1284834 Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Fri, 20 Jan 2023 21:11:36 +0900 Subject: [PATCH 14/15] msi: Remove needless patch entries for RubyInstaller Signed-off-by: Takuro Ashie --- td-agent/config.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/td-agent/config.rb b/td-agent/config.rb index 8ed825974..5b081616c 100644 --- a/td-agent/config.rb +++ b/td-agent/config.rb @@ -32,6 +32,6 @@ # lib/ruby/x.y.0 in RubyInstaller. So that "-p2" options will be passed # to patch command. BUNDLED_RUBY_INSTALLER_PATCHES = [ - ["ruby-3.0/0001-ruby-resolv-Fix-confusion-of-received-response-messa.patch", ["= 2.7.3"]], - ["ruby-3.0/0001-ruby-resolv-Fix-confusion-of-received-response-messa.patch", ["= 3.0.1"]], + # An example entry: + # ["ruby-3.0/0001-ruby-resolv-Fix-confusion-of-received-response-messa.patch", ["= 3.0.1"]], ] From 2ce445c2d32c6bcbec848af88d513951ba231c94 Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Tue, 31 Jan 2023 18:34:58 +0900 Subject: [PATCH 15/15] Update to msys2 20230127.0.0 to build msi Signed-off-by: Takuro Ashie --- td-agent/msi/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/td-agent/msi/Dockerfile b/td-agent/msi/Dockerfile index 37a00bfd4..7e923427e 100644 --- a/td-agent/msi/Dockerfile +++ b/td-agent/msi/Dockerfile @@ -26,7 +26,7 @@ RUN @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -I RUN \ choco install -y git wixtoolset 7zip & \ choco install -y cmake --installargs 'ADD_CMAKE_TO_PATH=System' && \ - choco install -y msys2 --params /NoUpdate --version=20221216.0.0 && \ + choco install -y msys2 --params /NoUpdate --version=20230127.0.0 && \ choco install ruby -y --version=3.1.3.1 && \ refreshenv && \ ridk install 3 && \