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 improve performance by ×2.2

⚡ 7 improved benchmarks
✅ 354 untouched benchmarks
⏩ 50 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Memory cp_recursive_wide_tree[(6000, 800)] 4,376.8 KB 182.5 KB ×24
Memory cp_preserve_metadata[(5, 4, 10)] 1,357.3 KB 416.6 KB ×3.3
Memory cp_recursive_balanced_tree[(5, 4, 10)] 1,438.5 KB 497.8 KB ×2.9
Simulation cp_recursive_wide_tree[(6000, 800)] 236.1 ms 221.3 ms +6.71%
Simulation cp_preserve_metadata[(5, 4, 10)] 102.4 ms 97.4 ms +5.15%
Simulation cp_recursive_balanced_tree[(5, 4, 10)] 96.5 ms 91.9 ms +5.09%
Simulation cp_recursive_deep_tree[(120, 4)] 18.1 ms 17.3 ms +4.59%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing DePasqualeOrg:cp-wasi-file-symlink-timestamps (f65f68f) with main (dfb953d)2

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.

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

@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/cut/bounded-memory (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/pid-pipe (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)

@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
@DePasqualeOrg
DePasqualeOrg force-pushed the cp-wasi-file-symlink-timestamps branch from 51b913a to 7b5e2b1 Compare September 1, 2026 16:29
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