Commit graph

16789 commits

Author SHA1 Message Date
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
Sylvestre Ledru
56c9be3e19
Merge pull request #8836 from cakebaker/unexpand_non_utf8_filenames
unexpand: add support for non-utf8 filenames
2025-10-07 09:16:57 +02:00
Daniel Hofstetter
802e25cc62 unexpand: add support for non-utf8 filenames 2025-10-07 07:32:52 +02:00
Daniel Hofstetter
c6f646f478
Merge pull request #8818 from sylvestre/fix-base58
Some checks failed
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
Code Quality / Style/Python (push) Waiting to run
Code Quality / Style/format (push) Waiting to run
CICD / Dependencies (push) Waiting to run
GnuTests / Aggregate GNU test results (push) Blocked by required conditions
Android / Test builds (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 / 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
CheckScripts / ShellScript/Check (push) Has been cancelled
CheckScripts / ShellScript/Format (push) Has been cancelled
base58: it wasn't working properly with long input
2025-10-06 17:38:22 +02:00
Sylvestre Ledru
33ac2cf6e9 base58: it wasn't working properly with long input 2025-10-06 15:53:56 +02:00
Daniel Hofstetter
e59685da79
Merge pull request #8698 from sylvestre/check-tra
add a github check for programs not using traversal
2025-10-06 14:57:43 +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
d4e47861bb add a github check for programs not using traversal 2025-10-06 13:57:50 +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
Sylvestre Ledru
1b74e7d2aa
Merge pull request #8831 from cakebaker/ci_fix_cicd_workflow
ci: fix broken CICD workflow
2025-10-06 12:00:29 +02:00
Daniel Hofstetter
98f617a29c ci: fix "a sequence was not expected" error
in the CICD workflow
2025-10-06 11:31:44 +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
Sylvestre Ledru
8b6613782b
Merge pull request #8810 from oech3/ln
Allow to replace ln -fs and hardlink on Windows by default
2025-10-05 17:45:52 +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
af27562af9
Merge pull request #8815 from sylvestre/perf-unexpand
unexpand: improve performances (1.50 faster than GNU)
2025-10-05 16:52:05 +02:00
Daniel Hofstetter
c05aca85ed uucore/parse_time: return 1ns for small numbers 2025-10-05 15:54:51 +02:00
E
788bf9259e
Document how to generate prefixed completions (#8817)
* Document how to generate prefixed completions
2025-10-05 15:13:03 +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
17ddf290ed
unexpand: add a benchmark (#8813) 2025-10-05 13:06:32 +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
Cả thế giới là Rust
f86061076b
tests(tee): Add GNU-compat write-error and broken-pipe tests (#4627) (#8797)
Some checks failed
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
CICD / Style/cargo-deny (push) Has been cancelled
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
CICD / Test all features separately (push) Has been cancelled
CICD / Build/SELinux (push) Has been cancelled
CICD / Run benchmarks (CodSpeed) (push) Has been cancelled
CICD / Build (push) Has been cancelled
CICD / Tests/Toybox test suite (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 / Tests/BusyBox test suite (push) Has been cancelled
Add comprehensive test coverage for tee --output-error and broken pipe behavior:

- test_output_error_flag_without_value_defaults_warn_nopipe: Verify default behavior
- test_output_error_presence_only_broken_pipe_unix: Non-crash on SIGPIPE
- test_broken_pipe_early_termination_stdout_only: Early termination robustness
- test_write_failure_reports_error_and_nonzero_exit: Error reporting validation

These tests address remaining gaps from GNU test suite tests/misc/tee.sh and
tests/misc/write-errors.sh highlighted in #4627. Platform-specific guards
(#[cfg(unix)], FreeBSD exclusion) ensure cross-platform compatibility.
2025-10-04 21:20:54 +02:00
E
0fc825bcb9
Add test for LN=
Add test for make LN="ln -svf" and make LN="ln -vf"
2025-10-05 01:02:08 +09: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
e131d31486 test(ptx): Add regression test for stdin reference format 2025-10-04 20:53:41 +08: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
E
6cdf6aa0de
Allow to replace ln -fs and hardlink on Windows by default 2025-10-04 20:37:23 +09: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
b48fb17142
Merge pull request #8801 from sylvestre/bench-fold
fold: add a benchmark
2025-10-04 08:37:32 +02:00
Cả thế giới là Rust
0554a20474
tests(ls): Add GNU-compat TIME_STYLE tests (#8796)
* tests(ls): Add GNU-compat TIME_STYLE tests (#4627)

Add comprehensive test coverage for ls TIME_STYLE behavior to align with GNU coreutils:

- test_ls_time_style_env_full_iso: TIME_STYLE environment variable with full-iso format
- test_ls_time_style_iso_recent_and_older: --time-style=iso formatting for recent vs older files
- test_ls_time_style_posix_locale_override: Locale-based fallback with LC_ALL=POSIX
- test_ls_time_style_precedence_last_wins: Precedence between --full-time and --time-style
- test_ls_time_sort_without_long: Time-based sorting without -l flag

These tests directly address remaining gaps highlighted in #4627 for tests/ls/ls-time.sh
from the GNU test suite.

* tests(ls): use set_modified instead of touch; simplify assertions

- Replace #[cfg(feature = "touch")] with set_modified(UNIX_EPOCH) in test_ls_time_style_iso_recent_and_older
- Remove conditional blocks in test_ls_time_sort_without_long and set mtimes via set_modified
- Simplify assertion to assert_ne!(def, t) to compare full outputs

Rationale: Improves determinism, portability, and reduces branching as suggested by maintainer cakebaker in PR review comments.
2025-10-04 07:42:15 +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
Daniel Hofstetter
b4f8eac90c
Merge pull request #8794 from oech3/codegen-units
Some checks failed
CICD / Build/nightly (push) Blocked by required conditions
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 / 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 / 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/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
Code Quality / Style/format (push) Waiting to run
Code Quality / Style/lint (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
codegen-units = 1 at release-{fast,small} profile
2025-10-03 15:58:27 +02:00