Fixing issues with users that have no active pid
There's been an open issue for a while where a bunch of tests have been disabled in users and who because when going through the file lists of users it will return users that do not have an active PID. This issue is documented here and outlines that two things need to be fixed, first using the kill command to tell if a user is active and then adding an entry into the CICD yml so that the tests can run: https://github.com/uutils/coreutils/issues/3219
This causing issues with the code coverage is documented here: https://github.com/uutils/coreutils/issues/9060
The main functionality changes are that it now runs kill for the users with the 0 flag to be able to determine whether the user is active. To be able to run this without having to use unsafe I have included the nix library. Other than that the changes are to add the user fix in the yml thats decribed in the issue 3219 and re-enabled the tests.
A follow up would be to make the tests across the suite follow the new macro conventions. Theres a discrepancy in the one test that was disabled in 2022 that checks the version of GNU, the current tests ignore this and just flag a warning but this one was not updated to use the new macro.
GNU testsuite comparison:
Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)
GNU testsuite comparison:
Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)
GNU testsuite comparison:
Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)
CodSpeed Performance Report
Merging #9442 will improve performances by 2.21%
Comparing ChrisDryden:who_check_pid (4b4f5af) with main (64203e3)
Summary
⚡ 2 improvements
✅ 125 untouched
⏩ 6 skipped[^skipped]
Benchmarks breakdown
| Benchmark | BASE |
HEAD |
Change | |
|---|---|---|---|---|
| ⚡ | du_summarize_balanced_tree[(5, 4, 10)] |
8.5 ms | 8.3 ms | +2.11% |
| ⚡ | du_max_depth_balanced_tree[(6, 4, 10)] |
33.1 ms | 32.4 ms | +2.21% |
| [^skipped]: 6 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. |
GNU testsuite comparison:
Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)
GNU testsuite comparison:
Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)
GNU testsuite comparison:
Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)
@cakebaker @sylvestre is there anything I could do to make these PR's easier to review? theres a few in the backlog along with this one and the stty ones that was hoping to get reviewed. Are they too large?
fixing the build issue would help :)
Compiling coreutils v0.4.0 (/home/runner/work/coreutils/coreutils)
warning: ignoring -C extra-filename flag due to -o flag
error[E0433]: failed to resolve: use of undeclared type `Errno`
--> src/uucore/src/lib/features/process.rs:75:41
|
75 | unsafe { libc::kill(pid, 0) == 0 || Errno::last() != Errno::ESRCH }
| ^^^^^ use of undeclared type `Errno`
|
help: consider importing one of these enums
|
10 + use crate::Errno;
|
10 + use nix::errno::Errno;
|
error[E0433]: failed to resolve: use of undeclared type `Errno`
--> src/uucore/src/lib/features/process.rs:75:58
|
75 | unsafe { libc::kill(pid, 0) == 0 || Errno::last() != Errno::ESRCH }
| ^^^^^ use of undeclared type `Errno`
|
help: consider importing one of these enums
|
10 + use crate::Errno;
|
10 + use nix::errno::Errno;
|
For more information about this error, try `rustc --explain E0433`.
warning: `uucore` (lib) generated 1 warning
error: could not compile `uucore` (lib) due to 2 previous errors; 1 warning emitted
GNU testsuite comparison:
Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)
My bad that was from the rebase just now and I just added the fix
GNU testsuite comparison:
Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)
GNU testsuite comparison:
Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)
GNU testsuite comparison:
Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)