Skip to content

Fixing issues with users that have no active pid - #9442

Open
ChrisDryden wants to merge 14 commits into
uutils:mainfrom
ChrisDryden:who_check_pid
Open

ChrisDryden wants to merge 14 commits into
uutils:mainfrom
ChrisDryden:who_check_pid

Conversation

@ChrisDryden

@ChrisDryden ChrisDryden commented Nov 22, 2025 •

Copy link
Copy Markdown
Collaborator

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: #3219

This causing issues with the code coverage is documented here: #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.

Comment thread .github/workflows/CICD.yml Outdated
@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

@ChrisDryden
ChrisDryden marked this pull request as draft November 22, 2025 15:49
@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@codspeed

codspeed Bot commented Nov 22, 2025 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 138 untouched benchmarks
⏩ 37 skipped benchmarks1


Comparing ChrisDryden:who_check_pid (e0c1ad4) with main (2da2c90)

Open in CodSpeed

Footnotes

  1. 37 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. ↩

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@jtracey jtracey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, all my comments are minor.

Kill is a pretty safe function (from a Rust safety guarantee perspective—it just takes two integers, no pointers or raw indexes), so if the nix dependency ends up causing problems in uucore, I'd say just use the unsafe libc calls. Otherwise, we already use nix in a bunch of utils, so if it works, it works.

Comment thread src/uu/users/src/users.rs Outdated
Comment thread src/uu/who/src/platform/unix.rs Outdated
Comment thread src/uu/users/src/users.rs Outdated
@github-actions

Copy link
Copy Markdown

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)

@jtracey jtracey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@ChrisDryden

Copy link
Copy Markdown
Collaborator Author

@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?

@sylvestre

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Dec 5, 2025

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

@ChrisDryden

Copy link
Copy Markdown
Collaborator Author

My bad that was from the rebase just now and I just added the fix

Comment thread src/uucore/src/lib/features/process.rs Outdated
@github-actions

github-actions Bot commented Dec 7, 2025

Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@github-actions

github-actions Bot commented Dec 7, 2025

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

Comment thread .github/workflows/CICD.yml Outdated
Comment thread src/uu/who/src/platform/unix.rs Outdated
Comment thread src/uu/users/src/users.rs Outdated

@sylvestre sylvestre left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

see comments

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Note: The gnu test tests/pr/pr-tests was skipped on 'main' but is now failing.

@github-actions

github-actions Bot commented Jan 5, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/dd/nocache_eof is no longer failing!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants