Skip to content

Conversation

@Watson1978
Copy link
Contributor

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

What this PR does / why we need it:

Since Ruby 4.0, When we give pipe command in Kernel.open, it causes an error.

$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 3.4.7 (2025-10-08 revision 7a5688e2a2) +PRISM [x86_64-linux]
-e:1: warning: Calling Kernel#open with a leading '|' is deprecated and will be removed in Ruby 4.0; use IO.popen instead
"Linux UM890 6.17.1-0-MANJARO #1 SMP PREEMPT_DYNAMIC Tue, 07 Oct 2025 07:57:35 +0000 x86_64 GNU/Linux\n"

$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 4.0.0dev (2025-11-20T00:03:23Z master 167c3dbaa0) +PRISM [x86_64-linux]
-e:1:in 'File#initialize': No such file or directory @ rb_sysopen - | uname -a (Errno::ENOENT)
	from -e:1:in 'Kernel.open'
	from -e:1:in '<main>'

This path will save the command's result in temporary files and use them instead due to avoid the error.

Docs Changes:
N/A

Release Note:
N/A

@daipom
Copy link
Contributor

daipom commented Nov 20, 2025

Thanks! How about using Kernel.` instead of Kernel.open?
(Although it is not important since the DSL config format is deprecated)

uname_str = ruby.` 'uname -a'

@Watson1978
Copy link
Contributor Author

Watson1978 commented Nov 20, 2025

Thanks! How about using Kernel.` instead of Kernel.open? (Although it is not important since the DSL config format is deprecated)

I this this test was introduced to verify that ruby correctly uses methods from ::Kernel.

411b263

Hmm, I don't like the ruby. 'uname -a' syntax because it's unclear what exactly will be executed, syntax highlighting will become incorrect...

@daipom
Copy link
Contributor

daipom commented Nov 20, 2025

It looks like this is a test for executing external commands, so changing it to open a temporary file would make it unclear what the test is actually verifying.
It seems that Kernel.open was used for running commands, but nowadays we would either use ` or call IO.popen() inside a ruby {}.
However, since this is already deprecated, it’s not very important.
So it might be best to either simply use ` or remove this test.

@daipom
Copy link
Contributor

daipom commented Nov 20, 2025

Well, I guess it's okay to turn it into a file-opening test since this DSL config feature is deprecated.

@daipom daipom added this to the v1.20.0 milestone Nov 20, 2025
@daipom daipom added the CI Test/CI issues label Nov 20, 2025
@daipom daipom merged commit 8ac9690 into fluent:master Nov 20, 2025
17 checks passed
@Watson1978 Watson1978 deleted the test_configdsl branch November 20, 2025 10:43
Watson1978 added a commit that referenced this pull request Nov 21, 2025
**Which issue(s) this PR fixes**: 
Fixes #5148

**What this PR does / why we need it**: 
Related to #5159
I overlooked the fact that there were also tests using pipe commands in
another file.

Since Ruby 4.0, When we give pipe command in `Kernel.open`, it causes an
error.

```
$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 3.4.7 (2025-10-08 revision 7a5688e2a2) +PRISM [x86_64-linux]
-e:1: warning: Calling Kernel#open with a leading '|' is deprecated and will be removed in Ruby 4.0; use IO.popen instead
"Linux UM890 6.17.1-0-MANJARO #1 SMP PREEMPT_DYNAMIC Tue, 07 Oct 2025 07:57:35 +0000 x86_64 GNU/Linux\n"

$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 4.0.0dev (2025-11-20T00:03:23Z master 167c3dbaa0) +PRISM [x86_64-linux]
-e:1:in 'File#initialize': No such file or directory @ rb_sysopen - | uname -a (Errno::ENOENT)
	from -e:1:in 'Kernel.open'
	from -e:1:in '<main>'
```

**Docs Changes**:
N/A

**Release Note**: 
N/A

Signed-off-by: Shizuo Fujita <[email protected]>
@Watson1978 Watson1978 mentioned this pull request Dec 5, 2025
@Watson1978 Watson1978 added backport to v1.16 We will backport this fix to the LTS branch backport to v1.19 We will backport this fix to the LTS branch labels Dec 5, 2025
Watson1978 added a commit to Watson1978/fluentd that referenced this pull request Dec 5, 2025
**Which issue(s) this PR fixes**:
Fixes fluent#5148

**What this PR does / why we need it**:
Related to fluent#5159
I overlooked the fact that there were also tests using pipe commands in
another file.

Since Ruby 4.0, When we give pipe command in `Kernel.open`, it causes an
error.

```
$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 3.4.7 (2025-10-08 revision 7a5688e2a2) +PRISM [x86_64-linux]
-e:1: warning: Calling Kernel#open with a leading '|' is deprecated and will be removed in Ruby 4.0; use IO.popen instead
"Linux UM890 6.17.1-0-MANJARO #1 SMP PREEMPT_DYNAMIC Tue, 07 Oct 2025 07:57:35 +0000 x86_64 GNU/Linux\n"

$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 4.0.0dev (2025-11-20T00:03:23Z master 167c3dbaa0) +PRISM [x86_64-linux]
-e:1:in 'File#initialize': No such file or directory @ rb_sysopen - | uname -a (Errno::ENOENT)
	from -e:1:in 'Kernel.open'
	from -e:1:in '<main>'
```

**Docs Changes**:
N/A

**Release Note**:
N/A

Signed-off-by: Shizuo Fujita <[email protected]>
Watson1978 added a commit to Watson1978/fluentd that referenced this pull request Dec 5, 2025
**Which issue(s) this PR fixes**:
Fixes fluent#5148

**What this PR does / why we need it**:

Since Ruby 4.0, When we give pipe command in `Kernel.open`, it causes an
error.

```
$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 3.4.7 (2025-10-08 revision 7a5688e2a2) +PRISM [x86_64-linux]
-e:1: warning: Calling Kernel#open with a leading '|' is deprecated and will be removed in Ruby 4.0; use IO.popen instead
"Linux UM890 6.17.1-0-MANJARO #1 SMP PREEMPT_DYNAMIC Tue, 07 Oct 2025 07:57:35 +0000 x86_64 GNU/Linux\n"

$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 4.0.0dev (2025-11-20T00:03:23Z master 167c3dbaa0) +PRISM [x86_64-linux]
-e:1:in 'File#initialize': No such file or directory @ rb_sysopen - | uname -a (Errno::ENOENT)
	from -e:1:in 'Kernel.open'
	from -e:1:in '<main>'
```

This path will save the command's result in temporary files and use them
instead due to avoid the error.

**Docs Changes**:
N/A

**Release Note**:
N/A

Signed-off-by: Shizuo Fujita <[email protected]>
Watson1978 added a commit to Watson1978/fluentd that referenced this pull request Dec 8, 2025
**Which issue(s) this PR fixes**: 
Fixes fluent#5148

**What this PR does / why we need it**: 
Related to fluent#5159
I overlooked the fact that there were also tests using pipe commands in
another file.

Since Ruby 4.0, When we give pipe command in `Kernel.open`, it causes an
error.

```
$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 3.4.7 (2025-10-08 revision 7a5688e2a2) +PRISM [x86_64-linux]
-e:1: warning: Calling Kernel#open with a leading '|' is deprecated and will be removed in Ruby 4.0; use IO.popen instead
"Linux UM890 6.17.1-0-MANJARO #1 SMP PREEMPT_DYNAMIC Tue, 07 Oct 2025 07:57:35 +0000 x86_64 GNU/Linux\n"

$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 4.0.0dev (2025-11-20T00:03:23Z master 167c3dbaa0) +PRISM [x86_64-linux]
-e:1:in 'File#initialize': No such file or directory @ rb_sysopen - | uname -a (Errno::ENOENT)
	from -e:1:in 'Kernel.open'
	from -e:1:in '<main>'
```

**Docs Changes**:
N/A

**Release Note**: 
N/A

Signed-off-by: Shizuo Fujita <[email protected]>
Watson1978 added a commit to Watson1978/fluentd that referenced this pull request Dec 8, 2025
**Which issue(s) this PR fixes**: 
Fixes fluent#5148

**What this PR does / why we need it**: 

Since Ruby 4.0, When we give pipe command in `Kernel.open`, it causes an
error.

```
$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 3.4.7 (2025-10-08 revision 7a5688e2a2) +PRISM [x86_64-linux]
-e:1: warning: Calling Kernel#open with a leading '|' is deprecated and will be removed in Ruby 4.0; use IO.popen instead
"Linux UM890 6.17.1-0-MANJARO #1 SMP PREEMPT_DYNAMIC Tue, 07 Oct 2025 07:57:35 +0000 x86_64 GNU/Linux\n"

$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 4.0.0dev (2025-11-20T00:03:23Z master 167c3dbaa0) +PRISM [x86_64-linux]
-e:1:in 'File#initialize': No such file or directory @ rb_sysopen - | uname -a (Errno::ENOENT)
	from -e:1:in 'Kernel.open'
	from -e:1:in '<main>'
```

This path will save the command's result in temporary files and use them
instead due to avoid the error.


**Docs Changes**:
N/A

**Release Note**: 
N/A

Signed-off-by: Shizuo Fujita <[email protected]>
Watson1978 added a commit that referenced this pull request Dec 9, 2025
**Which issue(s) this PR fixes**:
Fixes #5148

**What this PR does / why we need it**:
Related to #5159
I overlooked the fact that there were also tests using pipe commands in
another file.

Since Ruby 4.0, When we give pipe command in `Kernel.open`, it causes an
error.

```
$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 3.4.7 (2025-10-08 revision 7a5688e2a2) +PRISM [x86_64-linux]
-e:1: warning: Calling Kernel#open with a leading '|' is deprecated and will be removed in Ruby 4.0; use IO.popen instead
"Linux UM890 6.17.1-0-MANJARO #1 SMP PREEMPT_DYNAMIC Tue, 07 Oct 2025 07:57:35 +0000 x86_64 GNU/Linux\n"

$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 4.0.0dev (2025-11-20T00:03:23Z master 167c3dbaa0) +PRISM [x86_64-linux]
-e:1:in 'File#initialize': No such file or directory @ rb_sysopen - | uname -a (Errno::ENOENT)
	from -e:1:in 'Kernel.open'
	from -e:1:in '<main>'
```

**Docs Changes**:
N/A

**Release Note**:
N/A

Signed-off-by: Shizuo Fujita <[email protected]>
Watson1978 added a commit that referenced this pull request Dec 9, 2025
**Which issue(s) this PR fixes**:
Fixes #5148

**What this PR does / why we need it**:
Related to #5159
I overlooked the fact that there were also tests using pipe commands in
another file.

Since Ruby 4.0, When we give pipe command in `Kernel.open`, it causes an
error.

```
$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 3.4.7 (2025-10-08 revision 7a5688e2a2) +PRISM [x86_64-linux]
-e:1: warning: Calling Kernel#open with a leading '|' is deprecated and will be removed in Ruby 4.0; use IO.popen instead
"Linux UM890 6.17.1-0-MANJARO #1 SMP PREEMPT_DYNAMIC Tue, 07 Oct 2025 07:57:35 +0000 x86_64 GNU/Linux\n"

$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 4.0.0dev (2025-11-20T00:03:23Z master 167c3dbaa0) +PRISM [x86_64-linux]
-e:1:in 'File#initialize': No such file or directory @ rb_sysopen - | uname -a (Errno::ENOENT)
	from -e:1:in 'Kernel.open'
	from -e:1:in '<main>'
```

**Docs Changes**:
N/A

**Release Note**:
N/A

Signed-off-by: Shizuo Fujita <[email protected]>
Watson1978 added a commit that referenced this pull request Dec 9, 2025
**Which issue(s) this PR fixes**:
Fixes #5148

**What this PR does / why we need it**:

Since Ruby 4.0, When we give pipe command in `Kernel.open`, it causes an
error.

```
$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 3.4.7 (2025-10-08 revision 7a5688e2a2) +PRISM [x86_64-linux]
-e:1: warning: Calling Kernel#open with a leading '|' is deprecated and will be removed in Ruby 4.0; use IO.popen instead
"Linux UM890 6.17.1-0-MANJARO #1 SMP PREEMPT_DYNAMIC Tue, 07 Oct 2025 07:57:35 +0000 x86_64 GNU/Linux\n"

$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 4.0.0dev (2025-11-20T00:03:23Z master 167c3dbaa0) +PRISM [x86_64-linux]
-e:1:in 'File#initialize': No such file or directory @ rb_sysopen - | uname -a (Errno::ENOENT)
	from -e:1:in 'Kernel.open'
	from -e:1:in '<main>'
```

This path will save the command's result in temporary files and use them
instead due to avoid the error.

**Docs Changes**:
N/A

**Release Note**:
N/A

Signed-off-by: Shizuo Fujita <[email protected]>
Watson1978 added a commit that referenced this pull request Dec 9, 2025
**Which issue(s) this PR fixes**:
Fixes #5148

**What this PR does / why we need it**:

Since Ruby 4.0, When we give pipe command in `Kernel.open`, it causes an
error.

```
$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 3.4.7 (2025-10-08 revision 7a5688e2a2) +PRISM [x86_64-linux]
-e:1: warning: Calling Kernel#open with a leading '|' is deprecated and will be removed in Ruby 4.0; use IO.popen instead
"Linux UM890 6.17.1-0-MANJARO #1 SMP PREEMPT_DYNAMIC Tue, 07 Oct 2025 07:57:35 +0000 x86_64 GNU/Linux\n"

$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 4.0.0dev (2025-11-20T00:03:23Z master 167c3dbaa0) +PRISM [x86_64-linux]
-e:1:in 'File#initialize': No such file or directory @ rb_sysopen - | uname -a (Errno::ENOENT)
	from -e:1:in 'Kernel.open'
	from -e:1:in '<main>'
```

This path will save the command's result in temporary files and use them
instead due to avoid the error.

**Docs Changes**:
N/A

**Release Note**:
N/A

Signed-off-by: Shizuo Fujita <[email protected]>
@Watson1978 Watson1978 added the backported "backport to LTS" is done label Dec 9, 2025
daipom pushed a commit that referenced this pull request Dec 9, 2025
Backport #5160

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

**What this PR does / why we need it**:
Related to #5159
I overlooked the fact that there were also tests using pipe commands in
another file.

Since Ruby 4.0, When we give pipe command in `Kernel.open`, it causes an
error.

```
$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 3.4.7 (2025-10-08 revision 7a5688e2a2) +PRISM [x86_64-linux]
-e:1: warning: Calling Kernel#open with a leading '|' is deprecated and will be removed in Ruby 4.0; use IO.popen instead
"Linux UM890 6.17.1-0-MANJARO #1 SMP PREEMPT_DYNAMIC Tue, 07 Oct 2025 07:57:35 +0000 x86_64 GNU/Linux\n"

$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 4.0.0dev (2025-11-20T00:03:23Z master 167c3dbaa0) +PRISM [x86_64-linux]
-e:1:in 'File#initialize': No such file or directory @ rb_sysopen - | uname -a (Errno::ENOENT)
	from -e:1:in 'Kernel.open'
	from -e:1:in '<main>'
```

**Docs Changes**:
N/A

**Release Note**:
N/A

Signed-off-by: Shizuo Fujita <[email protected]>
daipom pushed a commit that referenced this pull request Dec 9, 2025
Backport #5160

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

**What this PR does / why we need it**:
Related to #5159
I overlooked the fact that there were also tests using pipe commands in
another file.

Since Ruby 4.0, When we give pipe command in `Kernel.open`, it causes an
error.

```
$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 3.4.7 (2025-10-08 revision 7a5688e2a2) +PRISM [x86_64-linux]
-e:1: warning: Calling Kernel#open with a leading '|' is deprecated and will be removed in Ruby 4.0; use IO.popen instead
"Linux UM890 6.17.1-0-MANJARO #1 SMP PREEMPT_DYNAMIC Tue, 07 Oct 2025 07:57:35 +0000 x86_64 GNU/Linux\n"

$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 4.0.0dev (2025-11-20T00:03:23Z master 167c3dbaa0) +PRISM [x86_64-linux]
-e:1:in 'File#initialize': No such file or directory @ rb_sysopen - | uname -a (Errno::ENOENT)
	from -e:1:in 'Kernel.open'
	from -e:1:in '<main>'
```

**Docs Changes**:
N/A

**Release Note**:
N/A

Signed-off-by: Shizuo Fujita <[email protected]>
daipom pushed a commit that referenced this pull request Dec 9, 2025
…5186)

Backport #5159

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

**What this PR does / why we need it**:

Since Ruby 4.0, When we give pipe command in `Kernel.open`, it causes an
error.

```
$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 3.4.7 (2025-10-08 revision 7a5688e2a2) +PRISM [x86_64-linux]
-e:1: warning: Calling Kernel#open with a leading '|' is deprecated and will be removed in Ruby 4.0; use IO.popen instead
"Linux UM890 6.17.1-0-MANJARO #1 SMP PREEMPT_DYNAMIC Tue, 07 Oct 2025 07:57:35 +0000 x86_64 GNU/Linux\n"

$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 4.0.0dev (2025-11-20T00:03:23Z master 167c3dbaa0) +PRISM [x86_64-linux]
-e:1:in 'File#initialize': No such file or directory @ rb_sysopen - | uname -a (Errno::ENOENT)
	from -e:1:in 'Kernel.open'
	from -e:1:in '<main>'
```

This path will save the command's result in temporary files and use them
instead due to avoid the error.

**Docs Changes**:
N/A

**Release Note**:
N/A

Signed-off-by: Shizuo Fujita <[email protected]>
daipom pushed a commit that referenced this pull request Dec 9, 2025
…5185)

Backport #5159

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

**What this PR does / why we need it**:

Since Ruby 4.0, When we give pipe command in `Kernel.open`, it causes an
error.

```
$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 3.4.7 (2025-10-08 revision 7a5688e2a2) +PRISM [x86_64-linux]
-e:1: warning: Calling Kernel#open with a leading '|' is deprecated and will be removed in Ruby 4.0; use IO.popen instead
"Linux UM890 6.17.1-0-MANJARO #1 SMP PREEMPT_DYNAMIC Tue, 07 Oct 2025 07:57:35 +0000 x86_64 GNU/Linux\n"

$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 4.0.0dev (2025-11-20T00:03:23Z master 167c3dbaa0) +PRISM [x86_64-linux]
-e:1:in 'File#initialize': No such file or directory @ rb_sysopen - | uname -a (Errno::ENOENT)
	from -e:1:in 'Kernel.open'
	from -e:1:in '<main>'
```

This path will save the command's result in temporary files and use them
instead due to avoid the error.

**Docs Changes**:
N/A

**Release Note**:
N/A

Signed-off-by: Shizuo Fujita <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport to v1.16 We will backport this fix to the LTS branch backport to v1.19 We will backport this fix to the LTS branch backported "backport to LTS" is done CI Test/CI issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: Failed test_with_ruby_keyword(ConfigDSLTest) with Ruby HEAD

2 participants