Commit graph

839 commits

Author SHA1 Message Date
renovate[bot]
548fa89cde
chore(deps): update rust crate ctor to 0.5.0 2025-08-11 02:37:47 +00:00
renovate[bot]
0195813dcb
chore(deps): update rust crate notify to v8.2.0 2025-08-03 16:57:49 +00:00
Sylvestre Ledru
a432fe811f l10n: use the embedded english strings when relevant 2025-08-03 10:59:38 +02:00
Daniel Hofstetter
7d8c58ad36 Bump parse_datetime from 0.9.0 to 0.11.0 2025-08-01 09:47:49 +02:00
renovate[bot]
001a91fbe6
chore(deps): update rust crate rstest to 0.26.0 2025-07-26 22:00:01 +00:00
Gabriele Belluardo
8c69980c95
chore(cp): simplify return statement in handle_no_preserve_mode function 2025-07-17 12:19:50 +02:00
Yuri Astrakhan
c7b981f260 chore: fix expl_impl_clone_on_copy lint
auto-derived clone generates identical assembly: https://rust.godbolt.org/z/GvenxKcKo
2025-07-10 17:46:01 -04:00
Daniel Hofstetter
745ae4b10f
Merge pull request #8292 from RenjiSann/collating
Some checks are pending
CICD / Style/cargo-deny (push) Waiting to run
CICD / Test all features separately (push) Blocked by required conditions
CICD / Build (push) Blocked by required conditions
CICD / Style/deps (push) Waiting to run
CICD / Documentation/warnings (push) Waiting to run
CICD / MinRustV (push) Waiting to run
CICD / Dependencies (push) Waiting to run
CICD / Build/Makefile (push) Blocked by required conditions
CICD / Build/stable (push) Blocked by required conditions
CICD / Build/nightly (push) Blocked by required conditions
CICD / Binary sizes (push) Blocked by required conditions
CICD / Tests/BusyBox test suite (push) Blocked by required conditions
CICD / Tests/Toybox test suite (push) Blocked by required conditions
CICD / Code Coverage (push) Waiting to run
CICD / Separate Builds (push) Waiting to run
CICD / Build/SELinux (push) Blocked by required conditions
GnuTests / Run GNU tests (push) Waiting to run
Android / Test builds (push) Waiting to run
Code Quality / Style/format (push) Waiting to run
Code Quality / Style/lint (push) Waiting to run
Code Quality / Style/spelling (push) Waiting to run
Code Quality / Style/toml (push) Waiting to run
Code Quality / Style/Python (push) Waiting to run
Code Quality / Pre-commit hooks (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
i18n: further work, expr support
2025-07-09 16:24:13 +02:00
Johnothan King
6d30b9110a
tr: Fix regression causing read error with sockets (#8083)
* tr: Fix regression causing read error with sockets

The test used for determining if a file descriptor
tested with fstat points to a directory is traditionally
done by using the S_IFMT mask[^1][^2], e.g.:
    #define S_ISDIR(m)	(((m) & S_IFMT) == S_IFDIR)
In Rust, this translates to 'm & libc::S_IFMT == libc::S_IFDIR'.
is_stdin_directory() uses 'has!(mode, S_IFDIR)', which is
**not** equivalent and causes non-directory sockets to be
incorrectly recognized as directories. This causes uu-tr
to break when used with all sockets created with socketpair,
including ksh93 pipes[^3]. Below is an example Rust program
demonstrating why the current check is bogus:
  fn main() {
     use nix::sys::socket::{socketpair, SockFlag, AddressFamily, SockType};
     use nix::sys::stat::fstat;
     use libc::{S_IFDIR, S_IFMT, mode_t};
     let (_fd1, fd2) = socketpair(AddressFamily::Unix, SockType::Stream, None, SockFlag::empty()).unwrap();
     let mode = fstat(&fd2).unwrap().st_mode as mode_t;
     if mode & S_IFMT == S_IFDIR {   // Equivalent to S_ISDIR()
         println!("Not reached");    // Not a dir, so unreachable
     }
     if mode & S_IFDIR == S_IFDIR {  // Bogus check for S_IFDIR
         println!("BAD");
     }
  }

- is_stdin_directory(): Fix the regression introduced in 3e4221a4
  by replacing the bogus check with one equivalent to S_ISDIR().
- test_tr.rs: Add a regression test for this bug.

[^1]: https://sourceware.org/git/?p=glibc.git;a=blob;f=io/sys/stat.h;h=4bea9e9a#l123
[^2]: https://git.musl-libc.org/cgit/musl/tree/include/sys/stat.h?id=047a1639#n51
[^3]: cc5e0692/src/cmd/ksh93/sh/io.c (L98-L102)

Fixes https://github.com/uutils/coreutils/issues/7658

* Add comment explaining rationale

Also fix cargo clippy lint.
(In case it isn't obvious, I'm fairly new to Rust)

* Fix more lint
2025-07-09 15:47:16 +02:00
Yuri Astrakhan
206281e29b chore: fix uninlined_format_args lint
I used this command, plus some manual fixes:

```sh
__CARGO_FIX_YOLO=1 cargo clippy --fix --all-targets --workspace --all-features --allow-dirty
```
2025-07-09 10:50:36 +02:00
Yuri Astrakhan
4a2634989c chore: fix unnecessary_semicolon lint
I used this command:

```sh
__CARGO_FIX_YOLO=1 cargo clippy --fix --all-targets --workspace --all-features --allow-dirty
```
2025-07-09 09:43:52 +02:00
Yuri Astrakhan
13861a40f6 chore: minor Cargo.toml linting
sorted and simplified a few minor things in the root Cargo.toml
2025-07-09 00:52:39 -04:00
Dorian Peron
bb8744f115 i18n: small refactor, add decimal stuff 2025-07-08 12:02:48 +02:00
Dorian Péron
5808786642
Merge pull request #8302 from nyurik/map_unwrap_or
Some checks are pending
CICD / Build (push) Blocked by required conditions
CICD / Style/deps (push) Waiting to run
CICD / Style/cargo-deny (push) Waiting to run
CICD / Documentation/warnings (push) Waiting to run
CICD / MinRustV (push) Waiting to run
CICD / Dependencies (push) Waiting to run
CICD / Build/Makefile (push) Blocked by required conditions
CICD / Build/stable (push) Blocked by required conditions
CICD / Build/nightly (push) Blocked by required conditions
CICD / Binary sizes (push) Blocked by required conditions
CICD / Tests/BusyBox test suite (push) Blocked by required conditions
CICD / Tests/Toybox test suite (push) Blocked by required conditions
CICD / Code Coverage (push) Waiting to run
CICD / Separate Builds (push) Waiting to run
CICD / Test all features separately (push) Blocked by required conditions
CICD / Build/SELinux (push) Blocked by required conditions
GnuTests / Run GNU tests (push) Waiting to run
Android / Test builds (push) Waiting to run
Code Quality / Style/format (push) Waiting to run
Code Quality / Style/lint (push) Waiting to run
Code Quality / Style/spelling (push) Waiting to run
Code Quality / Style/toml (push) Waiting to run
Code Quality / Style/Python (push) Waiting to run
Code Quality / Pre-commit hooks (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
chore: cleanup `map_unwrap_or` lint
2025-07-07 23:18:44 +02:00
Dorian Péron
2f16b14d6c
Merge pull request #8303 from nyurik/inefficient_to_string
chore: cleanup `inefficient_to_string` lint
2025-07-07 23:12:33 +02:00
renovate[bot]
13243caa24
chore(deps): update rust crate indicatif to 0.18.0 2025-07-04 12:30:38 +00:00
Yuri Astrakhan
e54d9bd76d chore: cleanup map_unwrap_or lint
Used this command and fixed a few remaining manual ones.

```sh
__CARGO_FIX_YOLO=1 cargo clippy --fix --all-targets --workspace --allow-dirty
```
2025-07-04 00:18:31 -04:00
Yuri Astrakhan
db06c64255 chore: cleanup inefficient_to_string lint
Apparently this causes a slowdown per [docs](https://rust-lang.github.io/rust-clippy/master/index.html#inefficient_to_string).

I used this command and fixed a few remaining manual ones.

```sh
__CARGO_FIX_YOLO=1 cargo clippy --fix --all-targets --workspace --allow-dirty
```
2025-07-03 23:56:16 -04:00
Daniel Hofstetter
931d388664
Merge pull request #8306 from uutils/renovate/notify-8.x
Some checks are pending
CICD / Build (push) Blocked by required conditions
CICD / Style/cargo-deny (push) Waiting to run
CICD / Style/deps (push) Waiting to run
CICD / Documentation/warnings (push) Waiting to run
CICD / MinRustV (push) Waiting to run
CICD / Dependencies (push) Waiting to run
CICD / Build/Makefile (push) Blocked by required conditions
CICD / Build/stable (push) Blocked by required conditions
CICD / Build/nightly (push) Blocked by required conditions
CICD / Binary sizes (push) Blocked by required conditions
CICD / Tests/BusyBox test suite (push) Blocked by required conditions
CICD / Tests/Toybox test suite (push) Blocked by required conditions
CICD / Code Coverage (push) Waiting to run
CICD / Separate Builds (push) Waiting to run
CICD / Test all features separately (push) Blocked by required conditions
CICD / Build/SELinux (push) Blocked by required conditions
GnuTests / Run GNU tests (push) Waiting to run
Android / Test builds (push) Waiting to run
Code Quality / Style/format (push) Waiting to run
Code Quality / Style/lint (push) Waiting to run
Code Quality / Style/spelling (push) Waiting to run
Code Quality / Style/toml (push) Waiting to run
Code Quality / Style/Python (push) Waiting to run
Code Quality / Pre-commit hooks (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
chore(deps): update rust crate notify to v8.1.0
2025-07-03 17:27:29 +02:00
Daniel Hofstetter
faa2dfada8
Merge pull request #8056 from nyurik/udeps
chore: remove unused dependencies
2025-07-03 16:53:17 +02:00
renovate[bot]
aa64151dc0
chore(deps): update rust crate notify to v8.1.0 2025-07-03 14:30:16 +00:00
Yuri Astrakhan
1d39e75b89 chore: a lot of documentation cleanups
Go throgh the `doc_markdown` lint everywhere, fixing code links and some grammar.
2025-07-03 00:05:26 -04:00
Yuri Astrakhan
4fa9af4953 chore: cleanup unused dependencies 2025-07-02 19:47:23 -04:00
Daniel Hofstetter
ff1a211c6a Bump linux-raw-sys from 0.9 to 0.10 2025-06-30 15:28:55 +02:00
Daniel Hofstetter
7ead5121da Cargo.toml/config.toml: format files 2025-06-27 15:11:54 +02:00
Daniel Hofstetter
85952a07a2 Cargo.toml: remove match_on_vec_items lint
it has been removed from clippy
2025-06-27 14:57:40 +02:00
Dorian Peron
231b0e5c59 uucore: retrieve the Locale encoding from env variables 2025-06-25 00:47:51 +02:00
Daniel Hofstetter
9fb8cd2e50 Bump phf & phf_codegen from 0.11.2 to 0.12.1 2025-06-20 17:07:57 +02:00
Daniel Hofstetter
dcbb5936eb Bump selinux crates
selinux from 0.5.1 to 0.5.2, selinux-sys from 0.6.14 to 0.6.15
2025-06-19 10:25:31 +02:00
Sylvestre Ledru
ba1833d39b
Merge pull request #8104 from Ecordonnier/eco/stdbuf-external
stdbuf: add feat_external_libstdbuf
2025-06-18 10:40:05 +02:00
Etienne Cordonnier
99aa51a9a9 stdbuf: add feat_external_stdbuf
Fixes https://github.com/uutils/coreutils/issues/6591

 "feat_external_stdbuf": use an external libstdbuf.so for stdbuf instead of embedding it into
 the stdbuf binary.
 There are 2 use-cases:
 1. Installation of uutils-coreutils using cargo install (e.g. from crates.io
    which supports only "cargo install" as installation method).  In this case,
    installing libstdbuf.so is impossible, because "cargo install" installs
    only binary programs (no cdylib), thus libstdbuf.so must be embedded into
    stdbuf and written to /tmp at runtime.  This is a hack, and may not work
    on some platforms, e.g. because the SELinux permissions may not allow
    stdbuf to write to /tmp, /tmp may be read-only, libstdbuf.so may not work
    at all without SELinux labels, etc.

 2. Installation of uutils-coreutils using an external tool, e.g. dpkg/apt on
    debian. In this case, libstdbuf.so should be installed separately to its
    correct location and the environment variable LIBSTDBUF_PATH configures the
    installation path during the build. E.g. LIBSTDBUF_PATH="/lib/libstdbuf.so"

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
2025-06-13 11:08:00 +02:00
Daniel Hofstetter
3eb1cece30 Bump windows-sys from 0.59.0 to 0.60.1 2025-06-12 11:09:39 +02:00
Yuri Astrakhan
60c55d7c07
chore: cleanup workspace crates (#8058)
Some checks are pending
CICD / Style/cargo-deny (push) Waiting to run
CICD / Style/deps (push) Waiting to run
CICD / Documentation/warnings (push) Waiting to run
CICD / MinRustV (push) Waiting to run
CICD / Dependencies (push) Waiting to run
CICD / Build/Makefile (push) Blocked by required conditions
CICD / Build/stable (push) Blocked by required conditions
CICD / Build/nightly (push) Blocked by required conditions
CICD / Binary sizes (push) Blocked by required conditions
CICD / Build (push) Blocked by required conditions
CICD / Tests/BusyBox test suite (push) Blocked by required conditions
CICD / Tests/Toybox test suite (push) Blocked by required conditions
CICD / Code Coverage (push) Waiting to run
CICD / Separate Builds (push) Waiting to run
CICD / Test all features separately (push) Blocked by required conditions
CICD / Build/SELinux (push) Blocked by required conditions
GnuTests / Run GNU tests (push) Waiting to run
Android / Test builds (push) Waiting to run
Code Quality / Style/format (push) Waiting to run
Code Quality / Style/lint (push) Waiting to run
Code Quality / Style/spelling (push) Waiting to run
Code Quality / Style/toml (push) Waiting to run
Code Quality / Style/Python (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
* chore: cleanup workspace crates

* properly add all crates to the workspace cargo.toml as members
  * except `fuzz` because it still has some issues, TBD
* use quotes around `true` and `false` to ensure there is no bool confusion
* remove a few leftover readme comments
* mark all unpublishable crates as `publish = false` to avoid accidental publishing
* Add `uutests` to the main workspace

* grammar

* a bit more cleanup based on feedback

* revert true/false

* Update tests/benches/factor dependencies
2025-06-06 13:56:08 +02:00
Sylvestre Ledru
a36d5455ab l10n: improve the display when the ftl is invalid 2025-06-04 19:24:03 +02:00
Vikram Kangotra
bfbdd5275d
cp: migrate from quick-error to thiserror (#7989)
* cp: migrate from quick-error to thiserror

fixes: #7916

* Remove quick-error

Now that we have migrated to thiserror, we can remove quick-error

* cp: fix test failures

* cp: fix fmt error
2025-06-03 10:12:36 +02:00
Etienne Cordonnier
35634b46a0 stdbuf: fix cross-compilation
Summary:

Partial fix for https://github.com/uutils/coreutils/issues/6591

The current code declare libstdbuf as a build-dependency of stdbuf as a
workaround to enforce that libstdbuf is compiled before stdbuf. This breaks
cross-compilation, because build-dependencies were compiled for the host
architecture, and not for the target architecture.

The reason this workaround is necessary is that bindeps is available only in nightly at the moment:
https://rust-lang.github.io/rfcs/3028-cargo-binary-dependencies.html

This commit replaces the "build-dependency" workaround with another workaround:
calling cargo manually to build libstdbuf in the build.rs of stdbuf, in order to ensure that libstdbuf is built before stdbuf.

Changes:

- Removed cpp/cpp_build dependencies:

The cpp, cpp_build, and related dependencies were removed because they made cross-compilation in a build.rs file very complex, since you need
to pass proper CXX env variables for cross-compilation, whereas cross-compiling rust code using cargo is quite simple.
Provided Rust implementations for getting stdin, stdout, and stderr pointers.
Switched from C++/cpp macro-based initialization to using the Rust ctor crate for library initialization.

- Remove "feat_require_crate_cpp" which is not needed any more, since stdbuf was the only utility using the cpp crate.

Tests:

This commit fixes e.g. this test:
cross test --target aarch64-unknown-linux-gnu --features stdbuf test_stdbuf::test_libstdbuf_preload -- --nocapture

- The "i686" build of stdbuf was also broken (stdbuf 32 bits, but libstdbuf 64 bits) and test_stdbuf::test_libstdbuf_preload of the i686 builds in github CI serves as regression
test for this issue, no need to add a cross-rs test for aarch64.
- The x86_64 musl build of stdbuf was also broken and was passing tests in CI only because it was compiled with the wrong libc (glibc instead of musl)

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
2025-06-02 10:55:57 +02:00
Daniel Hofstetter
5bbcb4ee63 Cargo.toml: remove procfs dependency 2025-06-02 10:00:49 +02:00
Daniel Hofstetter
dfc2e249ef
Merge pull request #7894 from drinkcat/jiff-date-ls
date/ls: Switch from chrono to jiff
2025-06-02 09:36:27 +02:00
Nicolas Boichat
986bdf545d uucore: Remove custom_tz_fmt, cleanup dependencies
Nobody needs it anymore.
2025-05-29 14:00:25 +02:00
Nicolas Boichat
301e33cfe3 date: switch from chrono to jiff
Also adds cargo dependency.
2025-05-29 14:00:25 +02:00
Daniel Hofstetter
5e92917b6d Cargo.toml: remove unused coz dependency 2025-05-28 19:54:11 +02:00
Sylvestre Ledru
04e7de1546
Merge pull request #7976 from cakebaker/bump_onig
Bump `onig` from `6.4.0` to `6.5.1`
2025-05-25 21:32:41 +02:00
Sylvestre Ledru
7d2644f3a8 move from version 0.0.30 => 0.1.0 2025-05-24 22:28:54 +02:00
Daniel Hofstetter
2a885b8d60 Bump fluent & fluent-bundle
fluent from 0.16.1 to 0.17.0 and fluent-bundle from 0.15.3 to 0.16.0
2025-05-24 14:57:23 +02:00
Daniel Hofstetter
a0cf06ea8c Bump onig from 6.4.0 to 6.5.1 2025-05-24 13:35:55 +02:00
Sylvestre Ledru
5a7c50d64e uucore: add functions to manage translations 2025-05-23 23:37:59 +02:00
Daniel Hofstetter
fd4c315fa3 Bump nix to 0.30.1 and ctrlc to 3.4.7 2025-05-22 16:54:35 +02:00
Daniel Hofstetter
3a05fa92d6
Merge pull request #7908 from sylvestre/selinux-installa
selinux: start the support of install
2025-05-22 15:14:08 +02:00
renovate[bot]
8655e8194d
chore(deps): update rust crate zip to v4 2025-05-22 02:48:34 +00:00
Sylvestre Ledru
38861cc767 selinux: add support for install 2025-05-21 09:51:27 +02:00