Skip to content

cat: replace nix with rustix#11567

Merged
sylvestre merged 1 commit intouutils:mainfrom
oech3:cat-r
Mar 31, 2026
Merged

cat: replace nix with rustix#11567
sylvestre merged 1 commit intouutils:mainfrom
oech3:cat-r

Conversation

@oech3
Copy link
Copy Markdown
Contributor

@oech3 oech3 commented Mar 31, 2026

depends on #11566
split #11548

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 31, 2026

Merging this PR will not alter performance

✅ 304 untouched benchmarks
⏩ 46 skipped benchmarks1


Comparing oech3:cat-r (5a9b8c6) with main (3b2a09c)2

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.

  2. No successful run was found on main (04b1585) during the generation of this report, so 3b2a09c was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/tail/follow-name (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/unexpand/bounded-memory is now passing!

@oech3 oech3 marked this pull request as ready for review March 31, 2026 19:00
@sylvestre sylvestre merged commit 7ec8dc1 into uutils:main Mar 31, 2026
161 of 162 checks passed
@oech3 oech3 deleted the cat-r branch March 31, 2026 20:03
@xtqqczze

This comment was marked as resolved.

@oech3
Copy link
Copy Markdown
Contributor Author

oech3 commented Apr 3, 2026

macOS's rustix does not have raw backend helping binary size. Also we need to remove nix from uucore since cat deps on it.

@oech3
Copy link
Copy Markdown
Contributor Author

oech3 commented Apr 3, 2026

Also it is known that raw backend is sometimes bad perf compared with nix. So we might switch to use-libc backend and revert binary size. Even so, we reduce 1 dep needed to build.

#[cfg(any(target_os = "linux", target_os = "android"))]
#[error("{0}")]
Nix(#[from] nix::Error),
Rustix(#[from] rustix::io::Errno),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is CatError::Rustix used?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't know. But clippy did not say anything about unused import.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Clippy doesn't warn about unused enum variants.

@xtqqczze
Copy link
Copy Markdown
Contributor

xtqqczze commented Apr 3, 2026

is there a difference in Linux binary size, I'm just interested...?

@oech3

This comment was marked as outdated.

@oech3
Copy link
Copy Markdown
Contributor Author

oech3 commented Apr 3, 2026

I did git reset --hard
rustix (raw) 1201576
nix 1219232
rusitx (use-libc) 1202512

@oech3
Copy link
Copy Markdown
Contributor Author

oech3 commented Apr 3, 2026

Did you strip binaries?

@xtqqczze
Copy link
Copy Markdown
Contributor

xtqqczze commented Apr 3, 2026

Did you strip binaries?

No, these are the stripped sizes:

--profile release-small (aarch64-apple-darwin): 817760 -> 817776

@xtqqczze
Copy link
Copy Markdown
Contributor

xtqqczze commented Apr 3, 2026

I did git reset --hard rustix (raw) 1201576 nix 1219232 rusitx (use-libc) 1202512

So rustix (especially raw) may be a good size improvement.

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.

3 participants