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

Use 'yes' instead of 'while-echo' in tests/ui/process/process-sigpipe.rs except 'nto' #136936

Merged
merged 1 commit into from
Feb 19, 2025

Conversation

xingxue-ibm
Copy link
Contributor

@xingxue-ibm xingxue-ibm commented Feb 12, 2025

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). This PR updates the test to use while-echo for QNX Neutrino while reverting to yes for other platforms.

@rustbot
Copy link
Collaborator

rustbot commented Feb 12, 2025

r? @compiler-errors

rustbot has assigned @compiler-errors.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 12, 2025
Comment on lines 30 to 36
// 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"
};
Copy link
Member

@workingjubilee workingjubilee Feb 14, 2025

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed as suggested, thanks!

Comment on lines 30 to 31
// 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,
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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?

Copy link
Contributor Author

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
>

Copy link
Member

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".

Copy link
Contributor Author

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".

Yup, thanks! Our systems are down for maintenance over the long weekend. I'll do it on Tuesday.

@workingjubilee workingjubilee added the O-aix OS: Big Blue's Advanced Interactive eXecutive.. label Feb 14, 2025
@xingxue-ibm xingxue-ibm changed the title [AIX] Use 'yes' instead of 'while-echo' in test tests/ui/process/process-sigpipe.rs Use 'yes' instead of 'while-echo' in tests/ui/process/process-sigpipe.rs except 'nto' Feb 18, 2025
@workingjubilee
Copy link
Member

Cool

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Feb 18, 2025

📌 Commit 0ffb771 has been approved by workingjubilee

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 18, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 19, 2025
…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
@bors bors merged commit 616b6c3 into rust-lang:master Feb 19, 2025
6 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Feb 19, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 19, 2025
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-aix OS: Big Blue's Advanced Interactive eXecutive.. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants