-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Use 'yes' instead of 'while-echo' in tests/ui/process/process-sigpipe.rs except 'nto' #136936
Conversation
rustbot has assigned @compiler-errors. Use |
tests/ui/process/process-sigpipe.rs
Outdated
// The 'sh' of AIX prints a message about a broken pipe with the command | ||
// using 'while-echo'. It works as expected when using 'yes' instead, | ||
// which was originally used in this test but later changed because some | ||
// platforms do not have 'yes'. Therefore, use 'yes' for AIX. | ||
let command = if cfg!(target_os = "aix") { | ||
"yes | head" | ||
} else { | ||
"while echo y ; do : ; done | head" | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please invert this. If we're going to do this, it should cfg!
for target_os = "nto"
, giving us the while echo y
form, and everyone else should go back to using yes
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed as suggested, thanks!
tests/ui/process/process-sigpipe.rs
Outdated
// The 'sh' of AIX prints a message about a broken pipe with the command | ||
// using 'while-echo'. It works as expected when using 'yes' instead, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which assert!
actually fails? the output.status.success()
one or the 0-len one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is the 0-len one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so on AIX, the shell prints some extra advisory without causing failure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so on AIX, the shell prints some extra advisory without causing failure?
Yeah, unlike the sh
of Linux, the sh
of AIX prints a message and therefore, fails the test case. Seems there is a problem with the sh
builtins since yes
works fine.
> sh -c "while echo y ; do : ; done | head"
y
...
y
> sh: There is no process to read data written to a pipe.
The ksh
of AIX behaves the same as sh
. However, the behavior of bash
of the AIX Toolbox for Linux applications built off OSS is consistent with the Linux's. The reason to fix the problem by using yes
is yes
is installed on AIX by default but the the AIX Toolbox for Linux applications is not and yes
was used by the test case before it was changed for target nto
.
> bash -c "while echo y ; do : ; done | head"
y
...
y
>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Righto, then my previous review applies: everyone should use yes
except target_os = "nto"
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Righto, then my previous review applies: everyone should use
yes
excepttarget_os = "nto"
.
Yup, thanks! Our systems are down for maintenance over the long weekend. I'll do it on Tuesday.
e79ccee
to
0ffb771
Compare
Cool @bors r+ rollup |
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#136936 (Use 'yes' instead of 'while-echo' in tests/ui/process/process-sigpipe.rs except 'nto') - rust-lang#137026 (Stabilize (and const-stabilize) `integer_sign_cast`) - rust-lang#137059 (fix: Alloc new errorcode E0803 for E0495) - rust-lang#137177 (Update `minifier-rs` version to `0.3.5`) - rust-lang#137210 (compiler: Stop reexporting stuff in cg_llvm::abi) - rust-lang#137213 (Remove `rustc_middle::mir::tcx` module.) - rust-lang#137216 (eval_outlives: bail out early if both regions are in the same SCC) - rust-lang#137228 (Fix typo in hidden internal docs of `TrustedRandomAccess`) - rust-lang#137242 (Add reference annotations for the `do_not_recommend` attribute) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#136936 - xingxue-ibm:sigpipe-test, r=workingjubilee Use 'yes' instead of 'while-echo' in tests/ui/process/process-sigpipe.rs except 'nto' The `sh` of AIX prints a message about a broken pipe when using the `while-echo` command. It works as expected when using the `yes` command instead. `yes` was originally used in this test but was later replaced with `while-echo` because QNX Neutrino does not have `yes` ([Replace yes command by while-echo in test tests/ui/process/process-sigpipe.rs](rust-lang#109379)). This PR updates the test to use `while-echo` for QNX Neutrino while reverting to `yes` for other platforms.
The
sh
of AIX prints a message about a broken pipe when using thewhile-echo
command. It works as expected when using theyes
command instead.yes
was originally used in this test but was later replaced withwhile-echo
because QNX Neutrino does not haveyes
(Replace yes command by while-echo in test tests/ui/process/process-sigpipe.rs). This PR updates the test to usewhile-echo
for QNX Neutrino while reverting toyes
for other platforms.