Fix utils::copy_file for symlink.#1521
Merged
nrc merged 1 commit intorust-lang:masterfrom Jan 14, 2019
Merged
Conversation
Contributor
Author
|
Ping. |
2 similar comments
Contributor
Author
|
Ping. |
Contributor
Author
|
Ping. |
Contributor
Author
|
@alexcrichton, anything I can do to move this along? |
Member
|
@reitermarkus unfortunately rustup doesn't have a lot of active development and I don't personally have enough time to take a deep dive here to see if this is the correct fix or not (or what sort of unintended fallout this might have) |
Contributor
Author
|
@alexcrichton, no worries. For what it's worth, this patch has been integrated into the Homebrew package for a month now without any bug reports, if that is any indication on correctness. |
Member
|
Given this fixes an issue that is affecting several people and seems to be working for Homebrew, I'm going to merge this. Thanks for the PR @reitermarkus ! |
cachebag
added a commit
to cachebag/rustup
that referenced
this pull request
Jan 16, 2026
Adds copy_file_preserving_symlink that preserves symlink targets instead of creating symlinks to the source path. Uses it in Transaction::copy_file, Transaction::modify_file, and copy_and_delete. Leaves utils::copy_file unchanged for self-installation (per rust-lang#1521). Adds regression test copy_file_preserves_symlinks.
cachebag
added a commit
to cachebag/rustup
that referenced
this pull request
Jan 16, 2026
Adds copy_file_preserving_symlink that preserves symlink targets instead of creating symlinks to the source path. Uses it in Transaction::copy_file, Transaction::modify_file, and copy_and_delete. Leaves utils::copy_file unchanged for self-installation (per rust-lang#1521). Adds regression test copy_file_preserves_symlinks.
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.
When
rustup-initis a symlink, create a symlink to that symlink instead of resolving it first. This is also in line with using theno-self-updatefeature, to allow managing therustupversion with Homebrew.Fixes #1512.