Fix profile install for symlinked directories#93
Merged
bartolli merged 3 commits intoMar 14, 2026
Conversation
be27778 to
b2c6aef
Compare
Owner
|
Thanks for your patience. I was dealing with some health issues over the past couple of months and couldn’t spend much time reviewing PRs or bug reports. I’m back now and will start going through them shortly. |
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.
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.
a4aa970 to
5fc5d07
Compare
Owner
|
Thanks for the fix and for your patience waiting on the review. Merged with a few small additions on our end: reverted the version bump (we handle versioning during releases) and added the path_owned_by_profile check to check_all_conflicts for consistency with install_files. Appreciate the contribution. |
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