1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-15 11:36:16 +00:00
Commit graph

15910 commits

Author SHA1 Message Date
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
Martin
a577108ccd
README.md: Refer to macOS when talking about the OS, not Mac the hardware 2025-03-16 13:05:14 +01:00
Sylvestre Ledru
87ec8285c3
Merge pull request #7459 from Ecordonnier/eco/musl-utmpx
utmpx.rs: use correct constant names for musl libc
2025-03-16 10:02:41 +01:00
Sylvestre Ledru
d25b8ae935
Merge pull request #7453 from benyaminl/readme-install-fedora-rhel
add fedora and RHEL installation docs
2025-03-16 10:00:54 +01:00
Sylvestre Ledru
91456e4d53
Merge pull request #7460 from ohno418/fix-apple-source-link
CONTRIBUTING: fix broken link to Apple's file_cmds
2025-03-16 09:41:28 +01:00
Benyamin Limanto
598889ad9f add ignore spell in cspell wordlist 2025-03-16 15:04:28 +07:00
Yutaro Ohno
9cdd11668a CONTRIBUTING: fix broken link to Apple's file_cmds 2025-03-16 13:19:42 +09:00
Etienne Cordonnier
f084b7f168 make cargo fmt happy 2025-03-16 00:21:45 +01:00
Etienne Cordonnier
591bef3759 utmpx.rs: use correct constant names for musl libc
Unfortunately, the name of those constants are not standardized:
glibc uses __UT_HOSTSIZE, __UT_LINESIZE, __UT_NAMESIZE
musl uses UT_HOSTSIZE, UT_LINESIZE, UT_NAMESIZE

See:
1. https://git.musl-libc.org/cgit/musl/tree/include/utmpx.h
2. https://github.com/bminor/glibc/blob/master/sysdeps/gnu/bits/utmpx.h#L35

This is a partial fix for https://github.com/uutils/coreutils/issues/1361

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
2025-03-15 22:39:35 +01:00
Sylvestre Ledru
0b228cfd3e
Merge pull request #7441 from cakebaker/all_adapt_version_string
all: add `(uutils coreutils)` to version string
2025-03-15 17:35:09 +01:00
Daniel Hofstetter
7e26f79052
Merge pull request #7456 from uutils/renovate/vmactions-freebsd-vm-1.x
chore(deps): update vmactions/freebsd-vm action to v1.1.9
2025-03-15 16:11:03 +01:00
Daniel Hofstetter
75260a5889 test: adapt test to new version string 2025-03-15 16:03:17 +01:00
Daniel Hofstetter
d34eb25251 all: use crate_version! from uucore 2025-03-15 16:03:17 +01:00
Daniel Hofstetter
12ab9c2c21 uucore: add crate_version macro 2025-03-15 16:03:16 +01:00
renovate[bot]
e760bb802b
chore(deps): update vmactions/freebsd-vm action to v1.1.9 2025-03-15 14:25:39 +00:00
Benyamin Limanto
8e04eb743a
add fedora and RHEL installation docs 2025-03-15 06:55:58 +07:00
Dorian Péron
e147063e26
Merge pull request #7413 from drinkcat/printf-nan
Fix `nan` print, simplify negative number printing.
2025-03-14 14:23:31 +01:00
Daniel Hofstetter
5f6a7d0ffa
Merge pull request #7440 from sylvestre/selinux
CI: add a new job to test with Selinux
2025-03-14 13:40:01 +01:00
Daniel Hofstetter
eb11961329
Merge pull request #7447 from uutils/renovate/linux-raw-sys-0.x-lockfile
chore(deps): update rust crate linux-raw-sys to v0.9.3
2025-03-14 13:34:38 +01:00
Nicolas Boichat
0c0d119413 test: printf: Add a test for scientific printing of negative number
This was broken before the last few commits.
2025-03-14 12:42:00 +01:00
Nicolas Boichat
92a291b71d test: printf: Add nan, inf, negative zero
Add a few end-to-end tests for printf of unusual floats (nan,
infinity, negative zero).
2025-03-14 12:42:00 +01:00
Nicolas Boichat
b7dcaa34da uucore: format: print absolute value of float, then add sign
Simplifies the code, but also fixes printing of negative and positive `NaN`:
`cargo run printf "%f %f\n" nan -nan`

Fixes part 2 of #7412.
2025-03-14 12:42:00 +01:00
Nicolas Boichat
e3872e8e8f uucore: format: force NaN back to lowercase
Fixes formatting of `NaN` to `nan`.

Fixes part 1 of #7412.
2025-03-14 12:42:00 +01:00
renovate[bot]
7b055f10fc
chore(deps): update rust crate linux-raw-sys to v0.9.3 2025-03-14 11:06:34 +00:00
Nicolas Boichat
c0a1179e7c seq: Enable test_auto_precision and test_undefined
Those tests appear to have been fixed, enable them.
2025-03-14 12:05:16 +01:00