fix: patch copied files in place for prefix replacements#2283
fix: patch copied files in place for prefix replacements#2283TTTPOB wants to merge 6 commits intoconda:mainfrom
Conversation
|
@hunger @wolfv This fixes an issue in the pixi store install path where files are currently patched before hardlink/reflink is applied. As a result, the link step cannot fully preserve the intended space-saving behavior, so in many real cases the deduplication benefits are lost. I’d appreciate a review when convenient. Thanks! |
baszalmstra
left a comment
There was a problem hiding this comment.
What I dont quite understand is why we need the sink and everything? It looks overengineered. I also dont understand how this now works? Because you still just copy a file to the destination and then seem to patch that? That still doesnt preserve the COW semantics does it?
Here are some links: Rust For btrfs If this PR makes sense to you, I will simplify the overengineered abstraction and clean up those tests and helpers. |
|
We also have a crate specifically to do reflinks, also on windows, I would prefer to use that instead. |
Summary
Closes #2282
Testing
CARGO_HOME=/tmp/cargo-container cargo fmt --all --checkCARGO_HOME=/tmp/cargo-container CARGO_TARGET_DIR=/tmp/rattler-target cargo test -p rattler test_patch_copied_destination_updates_only_changed_ranges_when_lengths_match --lib -j1CARGO_HOME=/tmp/cargo-container CARGO_TARGET_DIR=/tmp/rattler-target cargo test -p rattler test_patch_copied_destination_rewrites_from_first_difference_when_length_changes --lib -j1CARGO_HOME=/tmp/cargo-container CARGO_TARGET_DIR=/tmp/rattler-target cargo test -p rattler test_patched_read_only_file_restores_permissions --lib -j1CARGO_HOME=/tmp/cargo-container CARGO_TARGET_DIR=/tmp/rattler-target cargo test -p rattler test_patched_file_receives_modification_time --lib -j1CARGO_HOME=/tmp/cargo-container CARGO_TARGET_DIR=/tmp/rattler-target cargo test -p rattler test_unpatched_file_keeps_source_mtime --lib -j1