After the addition of utmpx, feat_os_unix_musl is now identical to feat_os_unix and is thus not needed any more.
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
bump libc to 0.2.172
musl provides stubs of utmpx functions, and those stubs are available in the
libc crate version 0.2.172. Thus let's enable the feature so that it can
compile with musl. Note that those stubs always return a success exit value,
and commands such as "users" will report an empty list of users, when calling
those stubs.
This is consistent with the behavior of GNU coreutils which does the same thing.
The coreutils utillities using utmpx are "pinky", "uptime", "users", "who".
This is the expected behavior when using those utilities compiled with those musl utmpx stubs:
```
root@qemuarm64:~# users
root@qemuarm64:~# echo $?
0
root@qemuarm64:~# pinky
Login Name TTY Idle When Where
root@qemuarm64:~# echo $?
0
root@qemuarm64:~# uptime
12:58:47 up 0 min, 0 users, load average: 0.07, 0.02, 0.00
root@qemuarm64:~# echo $?
0
root@qemuarm64:~# who
root@qemuarm64:~# echo $?
0
```
Closes#1361
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
Running this command showed a list of all lints across all crates:
```shell
cargo clippy --all-targets --workspace --message-format=json --quiet | jq -r '.message.code.code | select(. != null and startswith("clippy::"))' | sort | uniq -c | sort -h -r
```
This resulted in a list that I added to the `[workspace.lints.clippy]` in the root Cargo.toml. Afterwards, I commented out a few simpler lints. Subsequentely, I will go through this list, trying to address items in smaller batches.
I am not sure what the original issue was, but it seems to work:
```
cargo build --target=x86_64-unknown-linux-musl --features feat_os_unix_musl
...
coreutils$ ./target/x86_64-unknown-linux-musl/debug/coreutils stdbuf -o L echo "foobar"
foobar
```
At the moment, most crates rely on build scripts and other methods to keep lint-consistency. As of recent, Rust can use workspaces to globally set all the lint configurations.
This PR only adds lint configuration to each crate, but it does not introduce any changes to the code or lint configuration. In the subsequent PRs, I plan to gradually move lints from `uucore` to workspace, making all code consistent.
Note that `seq` relies on a custom lint config - which means its configuration may need to be managed by hand until Cargo introduces per-crate overrides.
The current ioctl operation code for FICLONE is fully open-coded instead
of using the ioctl macros, which makes it non-portable to other
architectures including mips, arm & powerpc. Get the constant from the
linux-raw-sys crate instead, which is already a transitive dependency.
Add dependencies on third-party packages `chrono-tz` and
`iana-time-zone` to our `date` package. Together, these two packages
allow us to produce time zone abbreviations (like `UTC`) from numeric
timezone offsets.