Skip to content

Conversation

@Watson1978
Copy link
Contributor

Which issue(s) this PR fixes:
Fixes #

What this PR does / why we need it:
When edit Windows registry like ruby bin/fluentd --reg-winsvc-fluentdopt "-c '$current_path/duplicated_id.conf' -o '$log_path'",
Ruby 4.0 causes uninitialized constant Win32::Registry (NameError).

Ref. https://github.com/fluent/fluentd/actions/runs/20650937408/job/59296698869

Ruby 3.4 has bundled resolv v0.6.2, which loads win32/registry.
https://github.com/ruby/resolv/blob/a28aaed4cb700303227f0e81178baf93d6221621/ext/win32/resolv/lib/resolv.rb#L46C15-L46C31
Therefore, we can use Win32::Registry implicitly after loading resolv.

It has been removed in the latest version of resolv gem.

Docs Changes:

Release Note:

Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
@Watson1978 Watson1978 mentioned this pull request Jan 5, 2026
Copy link
Member

@ashie ashie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Watson1978 Watson1978 added this to the v1.20.0 milestone Jan 5, 2026
@Watson1978 Watson1978 added the backport to v1.19 We will backport this fix to the LTS branch label Jan 5, 2026
@ashie ashie merged commit 63ee9eb into fluent:master Jan 5, 2026
17 checks passed
@Watson1978 Watson1978 deleted the command branch January 5, 2026 04:03
kenhys pushed a commit that referenced this pull request Jan 6, 2026
…5213)

**Which issue(s) this PR fixes**:
Fixes #

**What this PR does / why we need it**:
When edit Windows registry like `ruby bin/fluentd
--reg-winsvc-fluentdopt "-c '$current_path/duplicated_id.conf' -o
'$log_path'"`,
Ruby 4.0 causes `uninitialized constant Win32::Registry (NameError)`.

Ref.
https://github.com/fluent/fluentd/actions/runs/20650937408/job/59296698869

Ruby 3.4 has bundled resolv v0.6.2, which loads `win32/registry`.

https://github.com/ruby/resolv/blob/a28aaed4cb700303227f0e81178baf93d6221621/ext/win32/resolv/lib/resolv.rb#L46C15-L46C31
Therefore, we can use `Win32::Registry` implicitly after loading resolv.

It has been removed in the latest version of resolv gem.

**Docs Changes**:

**Release Note**:

Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
kenhys pushed a commit that referenced this pull request Jan 6, 2026
…5213)

**Which issue(s) this PR fixes**:
Fixes #

**What this PR does / why we need it**:
When edit Windows registry like `ruby bin/fluentd
--reg-winsvc-fluentdopt "-c '$current_path/duplicated_id.conf' -o
'$log_path'"`,
Ruby 4.0 causes `uninitialized constant Win32::Registry (NameError)`.

Ref.
https://github.com/fluent/fluentd/actions/runs/20650937408/job/59296698869

Ruby 3.4 has bundled resolv v0.6.2, which loads `win32/registry`.

https://github.com/ruby/resolv/blob/a28aaed4cb700303227f0e81178baf93d6221621/ext/win32/resolv/lib/resolv.rb#L46C15-L46C31
Therefore, we can use `Win32::Registry` implicitly after loading resolv.

It has been removed in the latest version of resolv gem.

**Docs Changes**:

**Release Note**:

Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
github-actions bot pushed a commit that referenced this pull request Jan 7, 2026
…5213)

**Which issue(s) this PR fixes**:
Fixes #

**What this PR does / why we need it**:
When edit Windows registry like `ruby bin/fluentd
--reg-winsvc-fluentdopt "-c '$current_path/duplicated_id.conf' -o
'$log_path'"`,
Ruby 4.0 causes `uninitialized constant Win32::Registry (NameError)`.

Ref.
https://github.com/fluent/fluentd/actions/runs/20650937408/job/59296698869

Ruby 3.4 has bundled resolv v0.6.2, which loads `win32/registry`.

https://github.com/ruby/resolv/blob/a28aaed4cb700303227f0e81178baf93d6221621/ext/win32/resolv/lib/resolv.rb#L46C15-L46C31
Therefore, we can use `Win32::Registry` implicitly after loading resolv.

It has been removed in the latest version of resolv gem.

**Docs Changes**:

**Release Note**:

Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Watson1978 added a commit that referenced this pull request Jan 8, 2026
…try for Ruby 4.0 (#5213) (#5221)

**Which issue(s) this PR fixes**: 
Backport #5213
Fixes #

**What this PR does / why we need it**: 
When edit Windows registry like `ruby bin/fluentd
--reg-winsvc-fluentdopt "-c '$current_path/duplicated_id.conf' -o
'$log_path'"`,
Ruby 4.0 causes `uninitialized constant Win32::Registry (NameError)`.

Ref.
https://github.com/fluent/fluentd/actions/runs/20650937408/job/59296698869

Ruby 3.4 has bundled resolv v0.6.2, which loads `win32/registry`.

https://github.com/ruby/resolv/blob/a28aaed4cb700303227f0e81178baf93d6221621/ext/win32/resolv/lib/resolv.rb#L46C15-L46C31
Therefore, we can use `Win32::Registry` implicitly after loading resolv.

It has been removed in the latest version of resolv gem.

**Docs Changes**:

**Release Note**:

Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Shizuo Fujita <fujita@clear-code.com>
@Watson1978 Watson1978 added the backported "backport to LTS" is done label Jan 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport to v1.19 We will backport this fix to the LTS branch backported "backport to LTS" is done

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants