1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-05 23:47:46 +00:00
Commit graph

15884 commits

Author SHA1 Message Date
renovate[bot]
d02f27b84b
chore(deps): update rust crate clap_complete to v4.5.47 2025-03-19 22:22:32 +00:00
Sylvestre Ledru
b8779c5edb
Merge pull request #7368 from bloxx12/main
flake: drop flake-utils, refactor
2025-03-19 11:20:15 +01:00
Sylvestre Ledru
09f4e60e93
Merge pull request #7485 from drinkcat/seq-buffered
seq: Buffer writes to stdout
2025-03-19 11:18:07 +01:00
Nicolas Boichat
6d3c0bee68 seq: Buffer writes to stdout
Use a BufWriter to wrap stdout: reduces the numbers of system calls,
improves performance drastically (2x in some cases).

Also document use cases in src/uu/seq/BENCHMARKING.md, and the
optimization we have just done here.
2025-03-19 10:36:48 +01:00
Sylvestre Ledru
c197a4203c
Merge pull request #7493 from cakebaker/python_fix_formatting
python: fix formatting in `compare_test_results.py`
2025-03-19 09:46:33 +01:00
Daniel Hofstetter
53ed1a58cb python: fix formatting in compare_test_results.py 2025-03-19 09:07:35 +01:00
Daniel Hofstetter
fc46a041f8
Merge pull request #7486 from sylvestre/python
Python: add ruff check and fix the code
2025-03-19 08:07:43 +01:00
Daniel Hofstetter
4df6423ba8
Merge pull request #7491 from uutils/renovate/zip-2.x-lockfile
chore(deps): update rust crate zip to v2.4.2
2025-03-19 07:20:58 +01:00
Sylvestre Ledru
38aee73fe5
GNU/CI: use the aggregated-result.json files and move to python (#7471)
* GNU/CI: use the aggregated-result.json files and move to python

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

* simplify code

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2025-03-19 07:15:11 +01:00
Daniel Hofstetter
c3098cce35
Merge pull request #7489 from uutils/renovate/blake3-1.x-lockfile
chore(deps): update rust crate blake3 to v1.7.0
2025-03-19 07:10:26 +01:00
renovate[bot]
cf54e9b1f9
chore(deps): update rust crate zip to v2.4.2 2025-03-19 02:55:33 +00:00
renovate[bot]
8dd4eb2f21
chore(deps): update rust crate blake3 to v1.7.0 2025-03-18 21:57:51 +00:00
Sylvestre Ledru
b1c3175387 fix ruff warnings 2025-03-18 20:52:46 +01:00
Sylvestre Ledru
663a9202e5 ruff: reformat python code 2025-03-18 20:52:46 +01:00
Sylvestre Ledru
e61898897d Github action: run ruff on the python code 2025-03-18 20:52:46 +01:00
Dorian Péron
2e3da88b78
Merge pull request #7438 from karlmcdowall/head_perf2
head: rework handling of non-seekable files
2025-03-18 18:15:01 +01:00
karlmcdowall
e1275f4ccd
Update src/uu/head/src/take.rs
Co-authored-by: Dorian Péron <72708393+RenjiSann@users.noreply.github.com>
2025-03-18 09:08:21 -06:00
Terakomari
ae6d4dec28
base32/base64/basenc: add -D flag (#7479)
* base32/base64/basenc: add -D flag

* base32/base64/basenc: add test for -D flag

* update extensions.md

* remove redundant parameters

* merge  into a single category

* Update docs/src/extensions.md

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>

---------

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2025-03-18 14:39:53 +01:00
Sylvestre Ledru
eb8928af48
Merge pull request #7478 from uutils/renovate/time-0.x-lockfile
chore(deps): update rust crate time to v0.3.40
2025-03-18 09:30:38 +01:00
renovate[bot]
95fd100d82
chore(deps): update rust crate time to v0.3.40 2025-03-18 07:31:00 +00:00
Sylvestre Ledru
6610e66b0d
Merge pull request #7477 from sylvestre/selinux4
github: fix the name - it is reference/aggregated-result.json/aggregated-result.json otherwise
2025-03-18 08:29:38 +01:00
Sylvestre Ledru
340fafb870 github: fix the name - it is reference/aggregated-result.json/aggregated-result.json otherwise 2025-03-18 07:52:15 +01:00
Daniel Hofstetter
e687a65c88
Merge pull request #7476 from uutils/renovate/zip-2.x-lockfile
chore(deps): update rust crate zip to v2.4.1
2025-03-18 07:15:52 +01:00
renovate[bot]
63a56fbc63
chore(deps): update rust crate zip to v2.4.1 2025-03-17 22:54:26 +00:00
Karl McDowall
29875312a1 head: rework handling of non-seekable files
Fix issue #7372
Rework logic for handling all-but-last-lines and all-but-last-bytes
for non-seekable files. Changes give large performance improvement.
2025-03-17 13:24:10 -06:00
Daniel Hofstetter
62025d862f
Merge pull request #7469 from Ecordonnier/eco/fsid_t-fix
fsext.rs: use type inference fsid_t / __fsid_t
2025-03-17 15:17:27 +01:00
Daniel Hofstetter
e6461269fc
Merge pull request #7448 from sylvestre/selinux2
selinux: run the GNU test too
2025-03-17 15:01:33 +01:00
Daniel Hofstetter
49c52ebb8a
Merge pull request #7470 from uutils/sylvestre-patch-4
bump busybox & toybox reference code
2025-03-17 13:52:45 +01:00
Sylvestre Ledru
2bd7ee972c
Use match in the python script
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2025-03-17 11:51:22 +01:00
Sylvestre Ledru
5486132eaf
bump busybox & toybox 2025-03-17 11:13:39 +01:00
Sylvestre Ledru
2f872860f0 Look at all individual results and summarize 2025-03-17 11:09:18 +01:00
Sylvestre Ledru
59426b779e github action: collect the results of the 4 tasks 2025-03-17 11:09:18 +01:00
Sylvestre Ledru
98cc160e15 github action: use the json file instead of parsing the logs 2025-03-17 11:09:18 +01:00
Sylvestre Ledru
cbca62866d Rewrite analyze-gnu-results in python
This time just analyzing the json result file
2025-03-17 11:09:18 +01:00
Sylvestre Ledru
334e29054e selinux: improve collect of the results 2025-03-17 11:09:18 +01:00
Sylvestre Ledru
1308d89907 gnu-json-result: fix warning 'E722 Do not use bare except' 2025-03-17 11:09:18 +01:00
Sylvestre Ledru
d0201da89d gnu-json-result: add checks to the script 2025-03-17 11:09:18 +01:00
Sylvestre Ledru
4c428ec592 ci: install selinux in other jobs 2025-03-17 11:09:18 +01:00
Sylvestre Ledru
ad6723c44b selinux test: collect and process the results 2025-03-17 11:09:18 +01:00
Sylvestre Ledru
5917a6c99d make: when BUILD_SPEC_FEATURE is set, pass it to the job 2025-03-17 11:09:18 +01:00
Sylvestre Ledru
a9a33543fb build: pass feat_selinux when building with selinux 2025-03-17 11:09:18 +01:00
Sylvestre Ledru
72ad89d956 selinux: run the GNU test too 2025-03-17 11:09:18 +01:00
Etienne Cordonnier
8f17113d61 fsext.rs: use type inference fsid_t / __fsid_t
Commit https://github.com/uutils/coreutils/pull/3396/commits/2a0d58d060eb51ee482e7e8a764f36bda21105e5 (part of https://github.com/uutils/coreutils/pull/3396 which contains a description of the changes) changed this line from libc::fsid_t to nix::sys::statfs::fsid_t.
The pull-request description at https://github.com/uutils/coreutils/pull/3396 indicates that this was done in order to fix the android build, and indeed using a cast to nix::sys::statfs::fsid_t
takes advantage of the definition of nix::sys::statfs::fsid_t which abstracts away the different name on Android:

```
/// Identifies a mounted file system
#[cfg(target_os = "android")]
pub type fsid_t = libc::__fsid_t;
/// Identifies a mounted file system
#[cfg(not(target_os = "android"))]
pub type fsid_t = libc::fsid_t;
```

This cast works as long as the libc version used by nix is the same than the libc version used by coreutils.

This cast becomes invalid when using a local libc version for local debugging, and changing Cargo.toml to point to it:
```
-libc = "0.2.153"
+libc = { path = "../path/to/libc" }
```

The cast becomes invalid because self.f_fsid is of type libc::fsid_t (local version of
libc), whereas nix::sys::statfs::fsid_t still uses the libc version downloaded
by cargo from crates.io in this case.

I was getting this error:

```
coreutils$ cargo build
   Compiling libc v0.2.171 (/home/ecordonnier/dev/libc)
   Compiling uucore v0.0.30 (/home/ecordonnier/dev/coreutils/src/uucore)
error[E0606]: casting `&libc::fsid_t` as `*const nix::libc::fsid_t` is invalid
   --> src/uucore/src/lib/features/fsext.rs:816:25
    |
816 |             unsafe { &*(&self.f_fsid as *const nix::sys::statfs::fsid_t as *const [u32; 2]) };
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0606`.
error: could not compile `uucore` (lib) due to 1 previous error
```

Let's rather use type inference to deal with libc::fsid_t vs libc::__fsid_t.

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
2025-03-17 11:05:02 +01:00
Daniel Hofstetter
12584b7162
Merge pull request #7467 from uutils/renovate/zip-2.x-lockfile
chore(deps): update rust crate zip to v2.3.0
2025-03-17 07:19:41 +01:00
renovate[bot]
9559d7a13f
chore(deps): update rust crate zip to v2.3.0 2025-03-16 22:41:10 +00:00
M Bussonnier
5532891f20
cp: create failing test for #7455 (#7457)
* Create failing test for #7455

Also update existing test to ensure output is empty.

* add ignore until relevant issue is fixed

---------

Co-authored-by: M Bussonnier <mbussonnier@gmail.com>
2025-03-16 15:31:06 +01:00
Jan Verbeek
e830dd45f0 shuf: Use impl return type in trait now that MSRV is high enough 2025-03-16 14:10:31 +01:00
Jan Verbeek
cdd1052cea shuf: Move more file operations into main()
This removes the need for some manually duplicated code and keeps
shuf_exec() (which is generic) smaller, for less binary bloat and
better build times.
2025-03-16 14:10:31 +01:00
Jan Verbeek
f562543b6c shuf: Use OS strings, don't split individual arguments, cleanup
- shuf now uses OS strings, so it can read from filenames that are
  invalid Unicode and it can shuffle arguments that are invalid
  Unicode. `uucore` now has an `OsWrite` trait to support this without
  platform-specific boilerplate.

- shuf no longer tries to split individual command line arguments,
  only bulk input from a file/stdin. (This matches GNU and busybox.)

- More values are parsed inside clap instead of manually, leading to
  better error messages and less code.

- Some code has been simplified or made more idiomatic.
2025-03-16 14:10:31 +01:00
Sylvestre Ledru
ea5d56effd
Merge pull request #7462 from C0rn3j/patch-1
README.md: Refer to macOS when talking about the OS, not Mac (hardware)
2025-03-16 13:31:12 +01:00