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

Support Ruby 3.1 on Windows #3766

Merged
merged 5 commits into from May 31, 2022
Merged

Support Ruby 3.1 on Windows #3766

merged 5 commits into from May 31, 2022

Commits on May 30, 2022

  1. test_out_forward: Use assert_rr

    For avoiding the following error on Ruby-3.1 on Windows:
    
    ```
    2022-02-18T01:36:00.3691879Z ===============================================================================
    2022-02-18T01:36:00.3692453Z Failure: test: send tags in str (utf-8 strings)(ForwardOutputTest):
    2022-02-18T01:36:00.3692799Z   On subject ,
    2022-02-18T01:36:00.3693302Z   unexpected method invocation:
    2022-02-18T01:36:00.3693595Z     process_wait(2088, 0)
    2022-02-18T01:36:00.3702794Z   expected invocations:
    2022-02-18T01:36:00.3703495Z C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/gems/3.1.0/gems/serverengine-2.2.5/lib/serverengine/socket_manager.rb:79:in ``'
    2022-02-18T01:36:00.3704338Z C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/gems/3.1.0/gems/serverengine-2.2.5/lib/serverengine/socket_manager.rb:79:in `block in generate_path'
    2022-02-18T01:36:00.3705025Z C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/gems/3.1.0/gems/serverengine-2.2.5/lib/serverengine/socket_manager.rb:78:in `each'
    2022-02-18T01:36:00.3705695Z C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/gems/3.1.0/gems/serverengine-2.2.5/lib/serverengine/socket_manager.rb:78:in `generate_path'
    2022-02-18T01:36:00.3706156Z D:/a/fluentd/fluentd/lib/fluent/test/driver/base.rb:105:in `instance_start'
    2022-02-18T01:36:00.3706550Z D:/a/fluentd/fluentd/lib/fluent/test/driver/base.rb:77:in `run'
    2022-02-18T01:36:00.3706945Z D:/a/fluentd/fluentd/lib/fluent/test/driver/base_owner.rb:130:in `run'
    2022-02-18T01:36:00.3707422Z D:/a/fluentd/fluentd/test/plugin/test_out_forward.rb:434:in `block in <class:ForwardOutputTest>'
    2022-02-18T01:36:00.3707780Z      431:     ]
    2022-02-18T01:36:00.3708021Z      432:
    2022-02-18T01:36:00.3708366Z      433:     stub(d.instance.ack_handler).read_ack_from_sock(anything).never
    2022-02-18T01:36:00.3708758Z   => 434:     target_input_driver.run(expect_records: 2) do
    2022-02-18T01:36:00.3709053Z      435:       d.run do
    2022-02-18T01:36:00.3709364Z      436:         emit_events.each do |tag, t, record|
    2022-02-18T01:36:00.3709681Z      437:           d.feed(tag, t, record)
    2022-02-18T01:36:00.3709997Z ===============================================================================
    ```
    
    Signed-off-by: Takuro Ashie <ashie@clear-code.com>
    ashie committed May 30, 2022
    Copy the full SHA
    6c91576 View commit details
    Browse the repository at this point in the history
  2. Fix broken Fluent::FileWrapper on Ruby 3.1 on UCRT

    Although we have used WindowsFile as altenertive of File mainly for
    specifying FILE_SHARE_DELETE to CreateFile, WindowsFile#io always
    raises Errno::EBADF on Ruby 3.1 on UCRT.
    Instead we can use File.open with File::Constants::SHARE_DELETE to
    avoid it. It was introduced for Fluentd, so we should use it :D
    https://bugs.ruby-lang.org/issues/11218
    
    Signed-off-by: Takuro Ashie <ashie@clear-code.com>
    ashie committed May 30, 2022
    Copy the full SHA
    3e0688f View commit details
    Browse the repository at this point in the history
  3. GitHub Actions: Add Ruby 3.1 & head for Windows

    Signed-off-by: Takuro Ashie <ashie@clear-code.com>
    ashie committed May 30, 2022
    Copy the full SHA
    cde1391 View commit details
    Browse the repository at this point in the history

Commits on May 31, 2022

  1. FileWrapper: Use File.open also on older Ruby

    It seems work fine than WindowsFile, so remove old code to simplify the
    code.
    
    Signed-off-by: Takuro Ashie <ashie@clear-code.com>
    ashie committed May 31, 2022
    Copy the full SHA
    71f6fb3 View commit details
    Browse the repository at this point in the history
  2. Add a missing blank line

    Signed-off-by: Takuro Ashie <ashie@clear-code.com>
    ashie committed May 31, 2022
    Copy the full SHA
    c471cfc View commit details
    Browse the repository at this point in the history