Commit graph

9016 commits

Author SHA1 Message Date
Daniel Hofstetter
19284dec18 seq: fix warnings from workspace lints 2025-10-09 17:42:07 +02:00
Daniel Hofstetter
5b5eed4bbd clippy: move unexpected_cfgs to workspace lints
and use workspace lints in seq
2025-10-09 17:42:06 +02:00
Daniel Hofstetter
61df13a2ce clippy: move use_self lint to workspace lints 2025-10-07 14:49:39 +02:00
Daniel Hofstetter
cd2e64d48f
Merge pull request #8820 from Misakait/fix/reference-calculate
Some checks are pending
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 / Build/SELinux (push) Blocked by required conditions
CICD / Build/SELinux-Stubs (Non-Linux) (push) Blocked by required conditions
CICD / Safe Traversal Security Check (push) Blocked by required conditions
CICD / Run benchmarks (CodSpeed) (push) Blocked by required conditions
GnuTests / Run GNU tests (native) (push) Waiting to run
GnuTests / Run GNU tests (SELinux) (push) Waiting to run
GnuTests / Aggregate GNU test results (push) Blocked by required conditions
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
Devcontainer / Verify devcontainer (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
WSL2 / Test (push) Waiting to run
fix(ptx): Align text wrapping behavior with GNU in traditional mode
2025-10-07 09:19:11 +02:00
Daniel Hofstetter
802e25cc62 unexpand: add support for non-utf8 filenames 2025-10-07 07:32:52 +02:00
Sylvestre Ledru
33ac2cf6e9 base58: it wasn't working properly with long input 2025-10-06 15:53:56 +02:00
Sylvestre Ledru
5cbe2cc3a9 CI: unbreak the l10n job 2025-10-06 13:58:00 +02:00
Sylvestre Ledru
fba43f4330 improve code 2025-10-06 13:58:00 +02:00
Sylvestre Ledru
5551c6a7ec Fix the last rm tests + add tests 2025-10-06 13:58:00 +02:00
Sylvestre Ledru
45e6cbd109 rm: remove the unsafe code and move the rm linux functions in a dedicated file 2025-10-06 13:58:00 +02:00
Sylvestre Ledru
e773c95c4e rm: on linux use the safe traversal in all cases 2025-10-06 13:58:00 +02:00
Sylvestre Ledru
e4b86542d6 safe-traversal is always used on linux, adjust the cfg 2025-10-06 13:53:05 +02:00
Sylvestre Ledru
0e484200d2 chmod: on linux use the safe traversal functions 2025-10-06 13:53:05 +02:00
Misakait
4b1163890f fix(ptx): Align text wrapping behavior with GNU in traditional mode and add related test
In traditional mode (-G) with references enabled, `uutils/ptx` failed
to wrap long lines in the same way as the GNU `ptx` reference
implementation.

This was due to the layout algorithm operating on an incorrectly large
line width, as the space for the reference column was not being
subtracted from the total width budget.

This commit implements the correct line width adjustment by subtracting
the reference width. This aligns the wrapping behavior and
makes the output identical to GNU `ptx` for the tested cases.
2025-10-06 00:17:50 +08:00
Sylvestre Ledru
137b2ce960
Merge pull request #8822 from cakebaker/unexpand_remove_unnecessary_condition
Some checks failed
GnuTests / Run GNU tests (native) (push) Waiting to run
GnuTests / Run GNU tests (SELinux) (push) Waiting to run
GnuTests / Aggregate GNU test results (push) Blocked by required conditions
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
Devcontainer / Verify devcontainer (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
WSL2 / Test (push) Waiting to run
Check uudoc Documentation Generation / Verify uudoc generates correct documentation (push) Has been cancelled
unexpand: remove unnecessary condition
2025-10-05 17:55:54 +02:00
Daniel Hofstetter
658e0d8796 unexpand: remove unnecessary condition 2025-10-05 17:04:33 +02:00
Sylvestre Ledru
5e076fe5cf
Merge pull request #8821 from cakebaker/uucore_parse_time_very_small_number
uucore/parse_time: return 1ns for small numbers
2025-10-05 17:03:48 +02:00
Daniel Hofstetter
c05aca85ed uucore/parse_time: return 1ns for small numbers 2025-10-05 15:54:51 +02:00
Sylvestre Ledru
687716cab3 unexpand: improve performances 2025-10-05 15:10:40 +02:00
Cả thế giới là Rust
02312bfffd
fix: Gate SELinux to Linux and add cross-platform CI tests (#8795)
Gate SELinux functionality to Linux-only and provide stub implementations
for chcon/runcon on non-Linux platforms to maintain cross-platform builds.

Changes:
- Gate all SELinux code with target_os = "linux" checks
- Add stub main() for chcon/runcon on non-Linux with user-friendly errors
- Add CI job to verify stubs build correctly on macOS and Windows
- Update ls to check both selinux feature AND target_os

Benefits:
- Fixes build failures on macOS/Windows (#8581, #7996, #7695, #6491)
- Maintains workspace buildability across all platforms
- Provides clear error messages instead of silent failures
- Prevents accidental SELinux usage on unsupported platforms

CI Testing:
- New 'Build/SELinux-Stubs (Non-Linux)' job tests macOS and Windows
- Verifies stub binaries are created and compilation succeeds
- Validates full workspace builds with stubs present

Addresses maintainer feedback in PR #8795
2025-10-05 14:23:59 +02:00
AnarchistHoneybun
e16ce60a38
basenc: implement --base58 encoding option (#8751)
* basenc: implement --base58 encoding option

Add support for Base58 encoding to basenc as per GNU coreutils 9.8.
Base58 uses the alphabet '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
which excludes visually ambiguous characters (0, O, I, l).

Resolves issue #8744.

* basenc: fix clippy warnings and spelling issues

Fix explicit iteration clippy warnings. Add Base58 alphabet to spell-checker ignore list to resolve cspell errors.
2025-10-05 14:03:45 +02:00
Daniel Hofstetter
c0cdd904b8
Merge pull request #8803 from sylvestre/expand-perf
expand: improve the performances - 1.80 faster than GNU
2025-10-05 13:57:56 +02:00
Daniel Hofstetter
d7fb7b71d7
Merge pull request #8811 from sylvestre/perf-nl
nl: improve the performances
2025-10-05 13:47:15 +02:00
Sylvestre Ledru
8d12700cd3 unexpand: add a benchmark 2025-10-05 11:50:47 +02:00
Sylvestre Ledru
fb5f4d8c28 expand: improve the performances - 1.80 faster than GNU 2025-10-05 10:27:46 +02:00
mattsu
013a385789
feat(cp): optimize directory copy by caching file checks and refactoring calls (#8805)
Some checks are pending
CICD / Build/SELinux (push) Blocked by required conditions
CICD / Run benchmarks (CodSpeed) (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/nightly (push) Blocked by required conditions
CICD / Build/stable (push) Blocked by required conditions
CICD / Binary sizes (push) Blocked by required conditions
CICD / Build (push) Blocked by required conditions
GnuTests / Run GNU tests (native) (push) Waiting to run
GnuTests / Run GNU tests (SELinux) (push) Waiting to run
GnuTests / Aggregate GNU test results (push) Blocked by required conditions
Code Quality / Style/lint (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
CICD / Build/Makefile (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
Android / Test builds (push) Waiting to run
Code Quality / Style/format (push) Waiting to run
Code Quality / Style/spelling (push) Waiting to run
Code Quality / Style/toml (push) Waiting to run
Devcontainer / Verify devcontainer (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
WSL2 / Test (push) Waiting to run
* feat: optimize directory copy by caching file checks and refactoring calls

- Add `target_is_file` field to Context to avoid repeated `stat` calls on target
- Refactor `copy_direntry` to accept `&Entry` and additional bool params for symlink/directory handling
- Use cached value and local variables for cleaner access to entry properties
- Pass `created_parent_dirs` to `copy_file` for improved directory creation tracking

This reduces filesystem overhead in cp operations when copying directories.
2025-10-04 17:14:09 +02:00
Sylvestre Ledru
8ec28bbd32 nl: improve the performances 2025-10-04 17:00:04 +02:00
Daniel Hofstetter
94b6544561
Merge pull request #8806 from Misakait/fix/reference-stdin
fix(ptx): Correct reference format for stdin
2025-10-04 16:04:39 +02:00
Daniel Hofstetter
f08f4d018f
Merge pull request #8804 from sylvestre/fold-perf
fold: improve the performances - now same as GNU
2025-10-04 15:18:53 +02:00
Sylvestre Ledru
03f160c3c1
nl: add a benchmark (#8808) 2025-10-04 14:53:42 +02:00
Misakait
124d787045 fix(ptx): Correct reference format for stdin 2025-10-04 20:53:41 +08:00
mattsu
1331ff19f5
docs: add benchmarking guidelines for cp (#8807) 2025-10-04 14:53:08 +02:00
Sylvestre Ledru
b3d16cc0e1 fold: improve the performances - now same as GNU 2025-10-04 09:42:50 +02:00
Sylvestre Ledru
be2534409b
Merge pull request #8800 from sylvestre/bench-expand
Some checks are pending
CICD / Binary sizes (push) Blocked by required conditions
CICD / Build (push) Blocked by required conditions
CICD / Test all features separately (push) Blocked by required conditions
CICD / Build/SELinux (push) Blocked by required conditions
CICD / Run benchmarks (CodSpeed) (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 / 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
GnuTests / Run GNU tests (native) (push) Waiting to run
GnuTests / Run GNU tests (SELinux) (push) Waiting to run
GnuTests / Aggregate GNU test results (push) Blocked by required conditions
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
Devcontainer / Verify devcontainer (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
WSL2 / Test (push) Waiting to run
expand: add a benchmark
2025-10-04 08:37:52 +02:00
Sylvestre Ledru
7120f85d97 fold: add a benchmark 2025-10-03 23:59:22 +02:00
Sylvestre Ledru
c17f0ac2c8 expand: add a benchmark 2025-10-03 23:54:49 +02:00
Misakait
6327810b03 fix(ptx): Prevent text chunks from over-reading at boundaries
Fixes a bug in `get_output_chunks` where calculated text chunks
(e.g., `tail`) would incorrectly include a trailing space and the first
character of the next word.

The fix explicitly checks for and trims this pattern to ensure
chunk boundaries are respected, matching GNU ptx behavior.
2025-10-03 10:53:16 +02:00
Misakait
bdd8939d1b fix(ptx): Remove truncation characters from TeX output
The GNU `ptx` implementation does not display truncation markers (e.g., "/")
when using the TeX (`--format=tex`) output format.

This change updates the `format_tex_line` function to prevent truncation
markers from being included in the TeX output, aligning uutils'
behavior with GNU's.
2025-10-03 10:53:16 +02:00
Misakait
9064619efd
fix(ptx): Remove extra space before truncation marker and add a related test (#8784)
Some checks are pending
Code Quality / Style/toml (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
CICD / Run benchmarks (CodSpeed) (push) Blocked by required conditions
GnuTests / Run GNU tests (native) (push) Waiting to run
GnuTests / Run GNU tests (SELinux) (push) Waiting to run
GnuTests / Aggregate GNU test results (push) Blocked by required conditions
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/Python (push) Waiting to run
Devcontainer / Verify devcontainer (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
WSL2 / Test (push) Waiting to run
Code Quality / Pre-commit hooks (push) Waiting to run
* fix(ptx): Remove extra space before truncation marker and a regression test (`test_truncation_no_extra_space_in_after`) has been added. Close#8783

* fix(ptx): Remove extra space before truncation marker and a regression test (`test_truncation_no_extra_space_in_after`) has been added. Close#8783
2025-10-02 15:32:29 +02:00
Zhang Wen
73764c6a12 uucore: handle situation using digital format username 2025-10-02 16:19:03 +08:00
Sylvestre Ledru
c883445bfe
Merge pull request #8780 from uutils/sylvestre-patch-2
Some checks failed
CICD / Style/deps (push) Has been cancelled
CICD / Documentation/warnings (push) Has been cancelled
CICD / MinRustV (push) Has been cancelled
CICD / Dependencies (push) Has been cancelled
CICD / Code Coverage (push) Has been cancelled
CICD / Separate Builds (push) Has been cancelled
GnuTests / Run GNU tests (native) (push) Has been cancelled
GnuTests / Run GNU tests (SELinux) (push) Has been cancelled
Android / Test builds (push) Has been cancelled
Code Quality / Style/format (push) Has been cancelled
Code Quality / Style/lint (push) Has been cancelled
Code Quality / Style/spelling (push) Has been cancelled
Code Quality / Style/toml (push) Has been cancelled
Code Quality / Style/Python (push) Has been cancelled
Code Quality / Pre-commit hooks (push) Has been cancelled
Devcontainer / Verify devcontainer (push) Has been cancelled
FreeBSD / Style and Lint (push) Has been cancelled
FreeBSD / Tests (push) Has been cancelled
WSL2 / Test (push) Has been cancelled
CICD / Build/Makefile (push) Has been cancelled
CICD / Build/stable (push) Has been cancelled
CICD / Build/nightly (push) Has been cancelled
CICD / Binary sizes (push) Has been cancelled
CICD / Build (push) Has been cancelled
CICD / Tests/BusyBox test suite (push) Has been cancelled
CICD / Tests/Toybox test suite (push) Has been cancelled
CICD / Test all features separately (push) Has been cancelled
CICD / Build/SELinux (push) Has been cancelled
CICD / Run benchmarks (CodSpeed) (push) Has been cancelled
GnuTests / Aggregate GNU test results (push) Has been cancelled
sort: also declare sort_locale_bench as benchmark
2025-10-01 07:58:13 +02:00
Sylvestre Ledru
4b35731e45
Merge pull request #8781 from sylvestre/refac-branch
bench: remove some duplication
2025-10-01 07:57:44 +02:00
Sylvestre Ledru
17d3a9868c sort: also declare sort_locale_bench as benchmark 2025-09-30 22:40:18 +02:00
Connor-GH
6df1f80126 ls: remove unnecessary getgrgid handling for Redox OS
Redox OS now has getgrgid as seen in https://gitlab.redox-os.org/redox-os/relibc/-/blob/master/src/header/grp/mod.rs?ref_type=0636af21a468f04971bad11eb4571bcb94fdfa81#L253, so we can remove this special handling. This allows the group name to show up on Redox OS, instead of just the group id.
2025-09-30 10:14:11 -05:00
Sylvestre Ledru
bfaf5f7aef bench: remove some duplication 2025-09-30 15:35:59 +02:00
Daniel Hofstetter
42c7746a99 uucore/fsext: recognize magic number for cgroup2fs 2025-09-30 14:28:52 +02:00
Sylvestre Ledru
c16698fc62
Merge pull request #8768 from ThePseudo/b64_benchmarks
Add benchmark for base64
2025-09-30 11:57:28 +02:00
Daniel Hofstetter
8421df8fe1 clippy: re-enable bool_to_int_with_if lint 2025-09-30 11:04:21 +02:00
Daniel Hofstetter
081e29c106 clippy: re-enable single_char_pattern lint 2025-09-30 10:49:46 +02:00
Daniel Hofstetter
7b77e57601 clippy: re-enable if_not_else lint 2025-09-30 10:43:16 +02:00