Fix profile install for symlinked directories#93
Open
jasantunes wants to merge 2 commits intobartolli:mainfrom
Open
Fix profile install for symlinked directories#93jasantunes wants to merge 2 commits intobartolli:mainfrom
jasantunes wants to merge 2 commits intobartolli:mainfrom
Conversation
Support profile installs when entries resolve to symlinked directories and track copied nested files in the lockfile. Also avoid a panic in walkdir path handling by returning a structured IO error, keeping failures recoverable. Adds regression tests for install and forced reinstall behavior.
be27778 to
b2c6aef
Compare
Updates crate version from 0.9.14 to 0.9.15 in Cargo.toml and\nCargo.lock so this branch and its PR carry the next patch release.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes issue #90 where profile installation fails when a profile contains a symlink to a directory.
It fixes the bug in two core ways:
- Previously, install used
std::fs::copy(...)directly, which fails when source resolves to a directory.- Now it routes through
copy_source_entry(...), which detects directories and callscopy_directory_contents(...)withWalkDir::new(...).follow_links(true).- Copied nested files are tracked in installed (so lockfile gets actual file paths under the symlinked dir).
- Conflict handling treats a path as owned if any tracked child file is under that path (
path_owned_by_profile), avoiding false sidecar creation during --force reinstall.Fixes #90
Type of Change
Testing
cargo test symlinked_directory)Performance impact
No material impact expected for normal installs.
The change applies to profile entries that resolve to directories.
Breaking changes
None.
Examples
test_install_profile_supports_symlinked_directorytest_force_reinstall_symlinked_directory_overwrites_owned_filesChecklist