fix: copy_dir and copy_file to preserve symlinks instead of following them.
#4671
+153
−6
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.
This PR employs symlink preservation in
copy_fileand adds it tocopy_dir.PR #1504 added symlink preservation to fix crashes in lldb-preview, which contains internal symlinks (liblldb was loading twice due to broken symlinks). Then, PR #1521 later changed
copy_fileto create symlinks pointing to the source path (for Homebrew integration), which may have regressed #1504.This PR restores #1504's behavior: read the symlink target and preserve it. What I'm curious about is what the intended behavior for #1521 was because shouldn't users be able to run
rustup-init --no-self-update? Is that not the recommended way to managerustupvia external package managers?If this PR steers out of scope of the goals of
rustupI'm happy to close it but I feel like the former behavior is preferable for most use cases.