coreutils
coreutils copied to clipboard
``uptime``: Support files in uptime
Fixes #6393
Edit1 : I strace-d the whole thing , we seem to use more than 2x amount of read sys calls (will result in more than 100 extra read calls for very large iterations)compared to GNU uptime, which i believe is due to iter_all_records_from function in uucore::src::lib::features::utmpx
GNU testsuite comparison:
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)
GNU testsuite comparison:
GNU test failed: tests/timeout/timeout. tests/timeout/timeout is passing on 'main'. Maybe you have to rebase?
GNU testsuite comparison:
Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)
GNU test failed: tests/timeout/timeout. tests/timeout/timeout is passing on 'main'. Maybe you have to rebase?
Changes summary since last review.
- Testing using file with dynamically created binary utmp records. Not testing for macos , since i don't have access to make to figure out creation of the binaries. Added a todo for anyone who owns a mac.
- Added utmpxname() detection since it returns an error in mac systems when the filename doesn't end up 'x'.
- Some lint stuff.
Changes since last push:
The test test_uptime::test_uptime_for_file_without_utmpx_records has been disabled for freebsd , our uucore::utmpx module uses utmpxname() sys call to set the file from which we iterate through, freebsd uses different sets of syscall which function somewhat similarly yet have differences. Comments have been added to the tests which may pass the CI but they don't function as intended.
GNU testsuite comparison:
Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)
The failing CI tests are unrelated to my PR.
GNU testsuite comparison:
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)
GNU testsuite comparison:
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)
GNU testsuite comparison:
Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)
@sylvestre does this require any more changes ?
GNU testsuite comparison:
Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)
GNU testsuite comparison:
Congrats! The gnu test tests/timeout/timeout is no longer failing!
Changes since last push:
- Removed quick_error in favor of thiserror
- Added some documentation on the added dependencies. The clippy error seems to be unrelated to my pr
thanks!