Skip to content

fix(wasi): cp attribute preservation and reflink handling - #13685

Merged
sylvestre merged 1 commit into
uutils:mainfrom
eduardomourar:wasi-cp-fixes
Sep 7, 2026
Merged

fix(wasi): cp attribute preservation and reflink handling#13685
sylvestre merged 1 commit into
uutils:mainfrom
eduardomourar:wasi-cp-fixes

Conversation

@eduardomourar

@eduardomourar eduardomourar commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

cp treats ENOSYS like EOPNOTSUPP when skipping optional attribute preservation (WASI has no chmod/chown at all), reads timestamps via Metadata::accessed/modified instead of the filetime crate (which panics there), and only errors out of --reflink when explicitly requested rather than whenever it isn't Never.

Rebased onto main now that #13804 covers WASI symlink support separately.

@github-actions

github-actions Bot commented Aug 1, 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/cut/bounded-memory (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/tail-n0f (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/cp/link-heap is now passing!
Congrats! The gnu test tests/tail/pipe-f is now passing!

Comment thread src/uu/cp/src/cp.rs Outdated
Comment thread src/uu/cp/src/cp.rs
@sylvestre

Copy link
Copy Markdown
Contributor

i am surprised that you didn't enable more tests in test_cp.rs ?!

@eduardomourar

Copy link
Copy Markdown
Contributor Author

I avoided adding more coverage as it makes rebasing all the changes back in the original branch harder. As soon as the rest of improvements are merged into main, I will gradually try to fix the tests being skipped for WASI and, if possible, increase coverage as well.

@sylvestre

Copy link
Copy Markdown
Contributor

I am sorry but it is a requirement. I don't land changes without tests

@eduardomourar
eduardomourar marked this pull request as draft August 11, 2026 11:56
@eduardomourar

eduardomourar commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Priority given to #13804. I have put this one to draft and will close it as soon as the necessary changes have been merged to main. I have only kept the fix missing from that other PR already merged into main.

@eduardomourar eduardomourar changed the title fix(wasi): cp attribute preservation and symlink handling fix(wasi): cp attribute preservation and reflink handling Sep 7, 2026
@eduardomourar
eduardomourar marked this pull request as ready for review September 7, 2026 00:31
@eduardomourar
eduardomourar force-pushed the wasi-cp-fixes branch 2 times, most recently from 0fbb538 to 03e405b Compare September 7, 2026 11:57
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

Binary size comparison:

Individual binary size comparison VS main (threshold: >=5% AND >=4 KB).

Total size of compared binaries: 153.09 MB (+904 KB, +0.58%)

Significant per-binary changes:
  expr     2.76 MB ->    3.65 MB  (+908 KB, +32.11%)

@sylvestre

Copy link
Copy Markdown
Contributor

i am not a fan of this long list of deactivation of tests for wasi :/
maybe we should split test_cp.rs with test_cp_XX.rs, etc to avoid this

@eduardomourar

eduardomourar commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

i am not a fan of this long list of deactivation of tests for wasi :/ maybe we should split test_cp.rs with test_cp_XX.rs, etc to avoid this

I agree. Let me finish all the pending PRs to get WASI Preview 2 testing enabled. I will leave the test for cp in single file for now and evaluate when everything is merged into main if we can create a separate file only for WASI (both p1 and p2). My objective is to ensure most of the tests can be executed for WASI and not skip them.

cp treats ENOSYS like EOPNOTSUPP when skipping optional attribute
preservation (WASI has no chmod/chown at all), reads timestamps via
Metadata::accessed/modified instead of the filetime crate (which
panics there), and only errors out of --reflink when explicitly
requested rather than whenever it isn't Never.
@sylvestre
sylvestre enabled auto-merge (rebase) September 7, 2026 16:15
@sylvestre
sylvestre merged commit 13deb96 into uutils:main Sep 7, 2026
103 checks passed
@eduardomourar
eduardomourar deleted the wasi-cp-fixes branch September 7, 2026 17:41
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.

2 participants