Skip to content

cp: support symlinks and timestamps on WASI - #13804

Open
DePasqualeOrg wants to merge 11 commits into
uutils:mainfrom
DePasqualeOrg:codex/wasi-cp-symlinks-timestamps
Open

cp: support symlinks and timestamps on WASI#13804
DePasqualeOrg wants to merge 11 commits into
uutils:mainfrom
DePasqualeOrg:codex/wasi-cp-symlinks-timestamps

Conversation

@DePasqualeOrg

@DePasqualeOrg DePasqualeOrg commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

This is ready for review.

Two existing issues were found while preparing this PR. I'm flagging them for future work, since I didn't address them here:

  • This PR fixes recursive timestamp preservation copying a traversal-updated directory atime. The current implementation causes about a 9% slowdown in affected benchmarks; avoiding it would require a different traversal design.
  • On Android, cp -aL can suppress a hard-link failure for a dereferenced symlink. Two existing tests can still pass when the destination is missing because they only assert that it is not a symlink.

@xtqqczze

xtqqczze commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Worth noting that we probably want to remove the filetime crate (#13808). If that would simplify these changes in any way, it might be worth considering here.

Comment thread src/uu/cp/src/cp.rs Outdated
// file that was distributed with this source code.
// spell-checker:ignore (ToDO) copydir fiemap ftruncate linkgs lstat nlink nlinks pathbuf pwrite reflink strs xattrs symlinked deduplicated advcpmv nushell IRWXG IRWXO IRWXU IRWXUGO IRWXU IRWXG IRWXO IRWXUGO sflag
// spell-checker:ignore RDONLY futimens utimensat
// spell-checker:ignore (ToDO) copydir ficlone fiemap filestat ftruncate linkgs lstat nlink nlinks pathbuf pwrite reflink strs utimensat xattrs symlinked deduplicated advcpmv nushell IRWXG IRWXO IRWXU IRWXUGO IRWXU IRWXG IRWXO IRWXUGO sflag

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.

Suggested change
// spell-checker:ignore (ToDO) copydir ficlone fiemap filestat ftruncate linkgs lstat nlink nlinks pathbuf pwrite reflink strs utimensat xattrs symlinked deduplicated advcpmv nushell IRWXG IRWXO IRWXU IRWXUGO IRWXU IRWXG IRWXO IRWXUGO sflag
// spell-checker:ignore (ToDO) copydir fiemap filestat ftruncate linkgs lstat nlink nlinks pathbuf pwrite reflink strs utimensat xattrs symlinked deduplicated advcpmv nushell IRWXG IRWXO IRWXU IRWXUGO IRWXU IRWXG IRWXO IRWXUGO sflag

part of global config

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/cp/sparse-to-pipe. tests/cp/sparse-to-pipe is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/cut/bounded-memory (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/tail/symlink (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/misc/write-errors was skipped on 'main' but is now failing.

@codspeed-hq

codspeed-hq Bot commented Aug 8, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 9.42%

⚠️ 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 regressed benchmarks
✅ 345 untouched benchmarks
⏩ 46 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation cp_preserve_metadata[(5, 4, 10)] 162.4 ms 179.9 ms -9.76%
Simulation cp_archive_balanced_tree[(5, 4, 10)] 174.9 ms 192.4 ms -9.08%

Tip

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


Comparing DePasqualeOrg:codex/wasi-cp-symlinks-timestamps (c80eae6) with main (f2c5fec)

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.

@DePasqualeOrg
DePasqualeOrg marked this pull request as ready for review August 8, 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.

3 participants