Skip to content

cp: fix metadata handling on WASI - #13913

Draft
DePasqualeOrg wants to merge 5 commits into
uutils:mainfrom
DePasqualeOrg:cp-wasi-file-symlink-timestamps
Draft

cp: fix metadata handling on WASI#13913
DePasqualeOrg wants to merge 5 commits into
uutils:mainfrom
DePasqualeOrg:cp-wasi-file-symlink-timestamps

Conversation

@DePasqualeOrg

@DePasqualeOrg DePasqualeOrg commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Correcting cp metadata handling on WASI requires extensive changes. I’m offering this as a possible reference implementation. It was developed over multiple rounds of review with Codex, and I don’t claim to fully understand everything. I’ll maintain this as a private patch for my own use until the issues are addressed here.

Changes:

  • Timestamp preservation for files, symlinks, and recursive directories
  • Pre---progress timestamp capture and stale-snapshot checks
  • Correct --update skip behavior, including recursive copies
  • Optional metadata error handling on WASI
  • No-follow source safety on WASI

@codspeed-hq

codspeed-hq Bot commented Aug 13, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 7.37%

❌ 5 regressed benchmarks
✅ 348 untouched benchmarks
⏩ 50 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation cp_recursive_deep_tree[(120, 4)] 25.4 ms 27.8 ms -8.55%
Simulation cp_recursive_balanced_tree[(5, 4, 10)] 150.4 ms 163.6 ms -8.1%
Simulation cp_preserve_metadata[(5, 4, 10)] 164.9 ms 178.1 ms -7.43%
Simulation cp_archive_balanced_tree[(5, 4, 10)] 176.6 ms 189 ms -6.54%
Simulation cp_recursive_wide_tree[(6000, 800)] 388.4 ms 414 ms -6.18%

Tip

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


Comparing DePasqualeOrg:cp-wasi-file-symlink-timestamps (51b913a) with main (a56bff2)

Open in CodSpeed

Footnotes

  1. 50 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 13, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/cp/preserve-link. tests/cp/preserve-link 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)
Skip an intermittent issue tests/tail/symlink (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/tail-n0f (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/cat/splice is no longer failing!
Congrats! The gnu test tests/chmod/only-op is no longer failing!
Congrats! The gnu test tests/cp/preserve-mode is no longer failing!
Congrats! The gnu test tests/cut/mb-non-utf8 is no longer failing!
Congrats! The gnu test tests/du/files0-from is no longer failing!
Congrats! The gnu test tests/expand/mb is no longer failing!
Congrats! The gnu test tests/install/install-C is no longer failing!
Congrats! The gnu test tests/ls/quoting-utf8 is no longer failing!
Congrats! The gnu test tests/ls/stat-free-symlinks is no longer failing!
Congrats! The gnu test tests/misc/selinux is no longer failing!
Congrats! The gnu test tests/mv/dir2dir is no longer failing!
Congrats! The gnu test tests/mv/mv-exchange is no longer failing!
Congrats! The gnu test tests/nl/multibyte is no longer failing!
Congrats! The gnu test tests/od/od-j is no longer failing!
Congrats! The gnu test tests/split/split-io-err is no longer failing!
Congrats! The gnu test tests/unexpand/mb is no longer failing!
Note: The gnu test tests/mv/i-3 is now being skipped but was previously passing.
Note: The gnu test tests/stty/bad-speed is now being skipped but was previously passing.
Note: The gnu test tests/stty/stty is now being skipped but was previously passing.
Note: The gnu test tests/stty/stty-invalid is now being skipped but was previously passing.
Note: The gnu test tests/stty/stty-pairs is now being skipped but was previously passing.
Note: The gnu test tests/stty/stty-row-col is now being skipped but was previously passing.
Skip an intermittent issue tests/pr/bounded-memory (was skipped on 'main', now failing)

@DePasqualeOrg
DePasqualeOrg force-pushed the cp-wasi-file-symlink-timestamps branch from 9544b4f to 4b6a382 Compare August 13, 2026 13:46
@DePasqualeOrg DePasqualeOrg changed the title cp: preserve file and symlink timestamps on WASI cp: preserve file timestamps on WASI Aug 13, 2026
@DePasqualeOrg
DePasqualeOrg force-pushed the cp-wasi-file-symlink-timestamps branch from 4b6a382 to b0fb181 Compare August 13, 2026 14:15
@DePasqualeOrg DePasqualeOrg changed the title cp: preserve file timestamps on WASI cp: fix metadata handling on WASI Aug 13, 2026
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.

1 participant