Debian Codegraph @

src/uu/tail/README.md

raw
1 <!-- spell-checker:ignore markdownlint ; (misc) backends kqueue Testsuite ksyms stdlib -->
2
3 # Notes / ToDO
4
5 ## Missing features
6
7 * `--max-unchanged-stats`
8
9 Note:
10 There's a stub for `--max-unchanged-stats` so GNU test-suite checks using it
11 can run, however this flag has no functionality yet.
12
13 ### Platform support for `--follow` and `--retry`
14
15 The `--follow=descriptor`, `--follow=name` and `--retry` flags have very good
16 support on Linux (inotify backend).
17 They work good enough on macOS/BSD (kqueue backend) with some tests failing due
18 to differences of how kqueue works compared to inotify.
19 Windows support is there in theory due to ReadDirectoryChanges support by the
20 notify-crate, however these flags are completely untested on Windows.
21
22 Note:
23 The undocumented `---disable-inotify` flag is used to disable the inotify
24 backend to test polling.
25 However inotify is a Linux only backend and polling is now supported also
26 for the other backends.
27 Because of this, `disable-inotify` is now an alias to the new and more versatile
28 flag name: `--use-polling`.
29
30 ## Possible optimizations
31
32 * Don't read the whole file if not using `-f` and input is regular file.
33 Read in chunks from the end going backwards, reading each individual chunk
34 forward.
35 * Reduce number of system calls to e.g. `fstat`
36 * Improve resource management by adding more system calls to `inotify_rm_watch`
37 when appropriate.
38
39 ## GNU test-suite results (9.1.8-e08752)
40
41 The functionality for the test "gnu/tests/tail-2/follow-stdin.sh" is implemented.
42 It fails because it is provoking closing a file descriptor with `tail -f <&-`
43 and as part of a workaround, Rust's stdlib reopens closed FDs as `/dev/null`
44 which means uu_tail cannot detect this.
45 See also, e.g. the discussion at:
46 <https://github.com/uutils/coreutils/issues/2873>
47
48 The functionality for the test "gnu/tests/tail-2/inotify-rotate-resources.sh"
49 is implemented.
50 It fails with an error because it is using `strace` to look for calls to
51 `inotify_add_watch` and `inotify_rm_watch`,
52 however in uu_tail these system calls are invoked from a separate thread.
53 If the GNU test would follow threads, i.e. use `strace -f`, this issue could be
54 resolved.
55
56 There are 5 tests which are fixed but do not (always) pass the test suite
57 if it's run inside the CI.
58 The reason for this is probably related to load/scheduling on the CI test VM.
59 The tests in question are:
60
61 * [x] `tail-2/F-vs-rename.sh`
62 * [x] `tail-2/follow-name.sh`
63 * [x] `tail-2/inotify-rotate.sh`
64 * [x] `tail-2/overlay-headers.sh`
65 * [x] `tail-2/retry.sh`