Skip to content

Conversation

@sgmarz
Copy link

@sgmarz sgmarz commented Jan 2, 2026

Fixes #9934

This PR will update the failed-to-remove error message to better align with GNU coreutils. Furthermore, it adds "cannot stat" for when looking for a file to see if it exists fails. This can fail for myriad of reasons, including permission denied.

Test: original issue request

$ uu-install /dev/null /dev/full
install: failed to remove existing file '/dev/full': Permission denied (os error 13)
$ gnu-install /dev/null /dev/full
install: cannot remove '/dev/full': Permission denied

The original issue was due to the way Rust's standard library calculates is_file. It only checks for regular files to be file, but on a UNIX configuration, the files could include block and character devices as well as a FIFO device. This patch now checks the metadata to check specifically for block, character, and FIFO devices on UNIX configurations. If the configuration is not UNIX, it reverts to the original behavior.

Test: cannot stat due to permission error

$ uu-install /dev/null /root/file
install: cannot stat '/root/file': Permission denied (os error 13)
$ gnu-install /dev/null /root/file
install: cannot stat '/root/file': Permission denied

The issue here was due to the way the main branch does remove_file. Since no checks are done before this function call, we get too granular of an error: was it due to not found or not? In this patch, there is an additional check using Rust's standard try_exists. This will tell us if the actual calculation of a file existing failed.

@sylvestre
Copy link
Contributor

lot of jobs failing

@github-actions
Copy link

github-actions bot commented Jan 3, 2026

GNU testsuite comparison:

Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@github-actions
Copy link

github-actions bot commented Jan 4, 2026

GNU testsuite comparison:

Congrats! The gnu test tests/printf/printf-surprise is now passing!

@sylvestre
Copy link
Contributor

please add tests to verify the errors & messages
thanks

nutthawit and others added 21 commits January 7, 2026 07:52
…s#9136)

* feat(dd): add comprehensive benchmark suite for O_DIRECT optimization

- Create dd's first benchmark suite using divan framework
- Benchmark various block sizes (4K, 8K, 64K, 1M) to measure performance
- Test different dd scenarios: default, partial copy, skip, seek operations
- Measure impact of separate input/output block sizes
- All benchmarks use status=none to avoid output noise
- Benchmarks verify the O_DIRECT buffer alignment optimization
- Follows existing uutils benchmark patterns and conventions

* bench(dd): increase dataset sizes for consistent timing

Increase benchmark dataset sizes to achieve consistent 100-300ms timing:
- dd_copy_default: 16 -> 32 MB
- dd_copy_4k_blocks: 16 -> 24 MB
- dd_copy_64k_blocks: 16 -> 64 MB
- dd_copy_1m_blocks: 16 -> 128 MB
- dd_copy_separate_blocks: 16 -> 48 MB
- dd_copy_partial: 16 -> 32 MB
- dd_copy_with_skip: 16 -> 48 MB
- dd_copy_with_seek: 16 -> 48 MB
- dd_copy_8k_blocks: 16 -> 32 MB

This ensures stable, repeatable benchmark measurements across different systems.

---------

Co-authored-by: Sylvestre Ledru <[email protected]>
No need to use the unsafe `libc::execvp()`, the standard rust library provides
the functionality via the safe function `Command::exec()`.

Signed-off-by: Etienne Cordonnier <[email protected]>
Co-authored-by: Sylvestre Ledru <[email protected]>
…tils#9884)

* du: fix -l/--count-links option not counting hardlinks separately

* du: add test for -l/--count-links counting hardlinks separately

---------

Co-authored-by: Sylvestre Ledru <[email protected]>
GnuTests.yml: Stop manpage generation to reduce size of log
* tac: fix error message

* tac: Remove obsolete error messages from locales
* stty: use stdin for TTY operations instead of /dev/tty

* Add tests for stty stdin behavior and fix platform-specific error messages

---------

Co-authored-by: Sylvestre Ledru <[email protected]>
* Use libc::UTIME_NOW in touch when updating time to now

* Explicit libc import to satisfy clippy

* Fix location of cfg in touch

* Add cfg gate to libc import to satisfy clippy on windows

* Change cfg gates in touch near libc::UTIME_NOW from unix to linux

---------

Co-authored-by: Sylvestre Ledru <[email protected]>
* csplit: detect and report write errors

* Add Rust integration tests for csplit write error detection

* csplit: fix doc comment for finish_split
…Y delay (uutils#9629)

* test(more): Fix test_from_line_option race condition by increasing PTY delay

Increased the delay in run_more_with_pty() from 100ms to 500ms to allow
more time to fully render output before the test reads from the PTY.

The test was failing because it was reading too early, before more could
initialize the terminal and render the file content. The -F flag itself
works correctly.

* test_more: decrease the delay

---------

Co-authored-by: Sylvestre Ledru <[email protected]>
max-amb and others added 25 commits January 7, 2026 07:52
* dd: fix nocache flag handling at EOF

* Add tests for nocache EOF handling

---------

Co-authored-by: Sylvestre Ledru <[email protected]>
…#9757)

* cp: set exit code when encountering circular symbolic links error when copying directory

* cp: add test to ensure that cp sets the status code when encountering circular symbolic links during directory copy

* cp: check that the output of circular symbolic link test has the correct message

* cp: update check for stderr message

* cp: update circular symbolic link test to account for directory format in windows

* cp: use std::path::MAIN_SEPARATOR_STR for test
and adapt the code accordingly
Fixes uutils#9769

Changed error.print().unwrap() to let _ = error.print() to prevent
panic when writing to /dev/full. Added regression test in test_cat.rs.
…heck to match GNU behaviour for test/nfs-removal-race (uutils#10086)

* cp: use lstat for destination check to support LD_PRELOAD tests

* fs: fix Windows is_symlink type mismatch and add explanatory comment

* cp: use stat for dest existence check to support LD_PRELOAD
* chmod: Fix --preserve-root not being bypassed by path that resolves to root

* chmod: Regression tests for --preserve-root not being bypassed by path that resolves to root
…for failing to remove an existing file and one for trying to stat a file in /root.
…ms (e.g., (os error 13)) by using UIoError to print the error message.
@github-actions
Copy link

github-actions bot commented Jan 7, 2026

GNU testsuite comparison:

GNU test failed: tests/shuf/shuf-reservoir. tests/shuf/shuf-reservoir is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/sort/sort-stale-thread-mem. tests/sort/sort-stale-thread-mem is passing on 'main'. Maybe you have to rebase?

@sylvestre
Copy link
Contributor

i think the rebase went wrong

renovate bot and others added 2 commits January 7, 2026 09:49
…ted_loadavg

Refactored the `get_formatted_loadavg` function to explicitly build a `FluentArgs` struct with load average values formatted to two decimal places, then pass it to `crate::locale::get_message_with_args` instead of using the `translate!` macro inline. This improves argument handling for fluent localization, enhancing code structure and maintainability without altering functionality.
@github-actions
Copy link

github-actions bot commented Jan 7, 2026

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

install /dev/null /dev/full has wrong error message