Skip to content

install: allow non-directory special files as targets - #13791

Open
MsfPablo wants to merge 1 commit into
uutils:mainfrom
MsfPablo:install-dev-full-error-message
Open

install: allow non-directory special files as targets#13791
MsfPablo wants to merge 1 commit into
uutils:mainfrom
MsfPablo:install-dev-full-error-message

Conversation

@MsfPablo

@MsfPablo MsfPablo commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

install /dev/null /dev/full currently fails with:

install: invalid target '/dev/full': No such file or directory

GNU install treats /dev/full as a valid target and reports the actual failure when trying to remove/replace it:

install: cannot remove '/dev/full': Permission denied

Changes:

  • Introduce is_valid_target() which accepts existing non-directory entries (device files, FIFOs, sockets, symlinks) in addition to regular files and new file paths.
  • Use it in standard() so special files proceed to copy_file() instead of being rejected as invalid targets.
  • Add a Linux-only regression test for install /dev/null /dev/full.

Fixes #9934.


🤖 This PR was generated with Claude Code.

…val errors

`install /dev/null /dev/full` previously failed with:

    install: invalid target '/dev/full': No such file or directory

Because the target check only accepted regular files or new file
paths, existing device files like /dev/full were rejected before the
install logic could attempt to replace them. GNU install treats such
paths as valid targets and reports the actual removal failure.

Changes:
- Add is_valid_target() which also accepts existing non-directory
  entries (device files, FIFOs, sockets, symlinks) as install targets.
- Use it in standard() so special files proceed to copy_file().
- Add a Linux-only regression test for install /dev/null /dev/full.

Fixes uutils#9934
@codspeed-hq

codspeed-hq Bot commented Aug 7, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 0.57%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 2 improved benchmarks
❌ 2 regressed benchmarks
✅ 343 untouched benchmarks
⏩ 46 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation complex_relative_date 316.1 µs 335.4 µs -5.75%
Simulation ls_recursive_deep_tree[(200, 2)] 3.5 ms 3.6 ms -3.76%
Simulation du_max_depth_balanced_tree[(6, 4, 10)] 62.6 ms 60.3 ms +3.83%
Simulation du_summarize_balanced_tree[(5, 4, 10)] 16.2 ms 15.6 ms +3.78%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing MsfPablo:install-dev-full-error-message (8c1a009) with main (cedb4ce)

Open in CodSpeed

Footnotes

  1. 46 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/tail/retry (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/tail/tail-n0f is now passing!
Note: The gnu test tests/env/env-signal-handler was skipped on 'main' but is now failing.

/// A valid target is a regular file, a path that can be created as a new file,
/// or any existing non-directory entry (including device files, FIFOs, sockets
/// and symlinks). Directories are handled by `copy_files_into_dir`.
fn is_valid_target(path: &Path) -> bool {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest #[inline]'ing this function

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

2 participants