Skip to content

cp: implement sparse copy support for windows#12686

Open
nikolalukovic wants to merge 7 commits into
uutils:mainfrom
nikolalukovic:fix/12186
Open

cp: implement sparse copy support for windows#12686
nikolalukovic wants to merge 7 commits into
uutils:mainfrom
nikolalukovic:fix/12186

Conversation

@nikolalukovic

Copy link
Copy Markdown
Contributor

Attempts to fix: #12186

@oech3

This comment was marked as resolved.

@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/date/resolution (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/misc/io-errors (fails in this run but passes 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/sparse-to-pipe is no longer failing!
Note: The gnu test tests/cut/bounded-memory is now being skipped but was previously passing.
Note: The gnu test tests/dd/no-allocate is now being skipped but was previously passing.
Note: The gnu test tests/expand/bounded-memory is now being skipped but was previously passing.

@nikolalukovic

Copy link
Copy Markdown
Contributor Author

@oech3 Ready for review. Failing check is unrelated to these changes.

@sylvestre

Copy link
Copy Markdown
Contributor

please add or enable relevant tests, thanks

@nikolalukovic

Copy link
Copy Markdown
Contributor Author

please add or enable relevant tests, thanks

There are three new tests for this feature on windows, since this is windows specific PR. Is there anything else I could have done that I missed?

@nikolalukovic

Copy link
Copy Markdown
Contributor Author

@sylvestre bump

1 similar comment
@nikolalukovic

Copy link
Copy Markdown
Contributor Author

@sylvestre bump

@Alonely0 Alonely0 left a comment

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.

Barring a few issues, this looks like a great addition. However, I find myself wishing we could use a safe API of the windows-*/winapi_util crates, instead of raw win32 unsafe calls. If it's not available there, would you add safe wrappers of these to uucore::fs and use them here?

Also, can someone more familiar with Windows I/O take a second look? I can only comment on my limited experience here.

Comment thread src/uu/cp/src/platform/windows.rs Outdated
Comment thread src/uu/cp/src/platform/windows.rs Outdated
Comment thread src/uu/cp/src/platform/windows.rs Outdated
Comment thread src/uu/cp/src/platform/windows.rs Outdated
Comment thread src/uu/cp/src/platform/windows.rs Outdated
Comment thread src/uu/cp/src/platform/windows.rs Outdated
Comment thread src/uu/cp/src/platform/windows.rs
@nikolalukovic nikolalukovic requested review from Alonely0 and oech3 July 5, 2026 17:34
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.

truncate and cp: sparse could be supported on Windows

4 participants