coreutils
coreutils copied to clipboard
tail: show end of device
gnu coreutils will show end of device for block devices. In current implementation this is skipped as a block devices are recognized as untailable.
The change ensures that we first try to output the end of any file and only then tell the observer that the file is not observable.
GNU testsuite comparison:
GNU test failed: tests/df/df-output. tests/df/df-output is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/sort/sort-stale-thread-mem. tests/sort/sort-stale-thread-mem is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/tail/tail-sysfs. tests/tail/tail-sysfs is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/tail/end-of-device is no longer failing!
GNU testsuite comparison:
GNU test failed: tests/du/8gb. tests/du/8gb is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/sort/sort-stale-thread-mem. tests/sort/sort-stale-thread-mem is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/tail/end-of-device is no longer failing!
Note: The gnu test tests/du/2g is now being skipped but was previously passing.
GNU testsuite comparison:
GNU test failed: tests/sort/sort-stale-thread-mem. tests/sort/sort-stale-thread-mem is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/tail/end-of-device is no longer failing!
Note: The gnu test tests/du/2g is now being skipped but was previously passing.
GNU testsuite comparison:
GNU test failed: tests/cp/same-file. tests/cp/same-file is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/cp/sparse. tests/cp/sparse is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/cp/sparse-to-pipe. tests/cp/sparse-to-pipe is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/sort/sort-stale-thread-mem. tests/sort/sort-stale-thread-mem is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/tail/truncate. tests/tail/truncate is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/tail/end-of-device is no longer failing!
Sorry, but you need to rebase again.
I think after this rebase, you will no longer need to change the if statement that chooses between unbounded_tail and bounded_tail.
I am in full support of moving the is_tailable check down to observer.add_path. I came to this same conclusion myself.
And if anyone asks for a unit test: I'm not sure how you would test tailing a block device. This is currently a root-only test in the GNU coreutils. The GNU test finds a mounted block device and tails it, which is generally something that only root can do.
Sorry, but you need to rebase again.
I think after this rebase, you will no longer need to change the if statement that chooses between
unbounded_tailandbounded_tail.I am in full support of moving the
is_tailablecheck down toobserver.add_path. I came to this same conclusion myself.And if anyone asks for a unit test: I'm not sure how you would test tailing a block device. This is currently a root-only test in the GNU coreutils. The GNU test finds a mounted block device and tails it, which is generally something that only root can do.
Thank you for the updates. I rebased and can confirm: the if statement is not required anymore.
GNU testsuite comparison:
Congrats! The gnu test tests/tail/end-of-device is no longer failing!
I tried to add a test, see https://github.com/uutils/coreutils/commit/facc7c5d059bae8d9a9989cec9ca9cd4180cb1ae.
But the test is not very portable, e.g. on SELinux CI job, this happens:
tail: cannot open 'tmpfs' for reading: No such file or directory
I think a test is somehow pointless here. We would need to accept almost any failure as "ok".
This PR is ready from my side. Please review.
GNU testsuite comparison:
Congrats! The gnu test tests/tail/end-of-device is no longer failing!
Congrats! The gnu test tests/tail/end-of-device is no longer failing!
Kudos and thanks!