-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
nohup: added a bunch of nohup fixes based on the failures in the GNU tests #9628
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
base: main
Are you sure you want to change the base?
Conversation
|
GNU testsuite comparison: |
316faef to
f8ddc57
Compare
CodSpeed Performance ReportMerging #9628 will not alter performanceComparing Summary
Footnotes
|
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
f8ddc57 to
3dd84fa
Compare
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
I'm going to try and split this up into many smaller PR's to make it easier to review. |
src/uu/nohup/src/nohup.rs
Outdated
| let exit_code = failure_code(); | ||
|
|
||
| match open_nohup_file(Path::new(NOHUP_OUT)) { | ||
| Ok(t) => Ok((t, NOHUP_OUT.to_string())), |
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.
maybe
| Ok(t) => Ok((t, NOHUP_OUT.to_string())), | |
| Ok(t) => Ok((t, NOHUP_OUT.to_owned())), |
src/uu/nohup/src/nohup.rs
Outdated
| e2, | ||
| ) | ||
| .into()), | ||
| let homeout_str = homeout.to_str().unwrap().to_string(); |
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.
as ride along, maybe remove the unwrap()
|
GNU testsuite comparison: |
This is a bit of a bigger PR but the original goal was to try and add the support of always setting the umask of the output file and when running the tests against the GNU tests I found a few inconsistencies that I'm going to summarize below:
First is that the GNU implementation will always try to set umask of nohop.out to 600 which we werent doing in our tests, I added a wrapper to it to make it always set that way.
Second the error message is based on whether the input or/and the output terminal is a terminal, the current implementation printed the same error message for all use cases and I added error messages specific to each use case.
Third, the error code for failure is set based on the ENV variable POSIXLY_CORRECT which we were already doing in some cases but we need to do that for all cases where it would return a 125 failure
Lastly the show_error macro didn't work for this use case because its possible to fail the output to stdout and then its expected to give a different error code based on whether the stderr was written successfully.
I added rust integ tests for each of these scenarios too, the way the tests are set up in nohup is a bit all over the place, when this gets merged in I'd like to make them all use the same macros and reduce the verbosity a bit
This PR has been broken into some smaller PR's to make this PR easier to review: #9684 and #9685