Skip to content

Fix utils::copy_file for symlink.#1521

Merged
nrc merged 1 commit intorust-lang:masterfrom
reitermarkus:fix-symlink
Jan 14, 2019
Merged

Fix utils::copy_file for symlink.#1521
nrc merged 1 commit intorust-lang:masterfrom
reitermarkus:fix-symlink

Conversation

@reitermarkus
Copy link
Copy Markdown
Contributor

@reitermarkus reitermarkus commented Oct 4, 2018

When rustup-init is a symlink, create a symlink to that symlink instead of resolving it first. This is also in line with using the no-self-update feature, to allow managing the rustup version with Homebrew.

Fixes #1512.

@reitermarkus
Copy link
Copy Markdown
Contributor Author

Ping.

2 similar comments
@reitermarkus
Copy link
Copy Markdown
Contributor Author

Ping.

@reitermarkus
Copy link
Copy Markdown
Contributor Author

Ping.

@reitermarkus
Copy link
Copy Markdown
Contributor Author

@alexcrichton, anything I can do to move this along?

@alexcrichton
Copy link
Copy Markdown
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)

@reitermarkus
Copy link
Copy Markdown
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.

@nrc
Copy link
Copy Markdown
Member

nrc commented Jan 14, 2019

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 !

@nrc nrc merged commit edf7206 into rust-lang:master Jan 14, 2019
@reitermarkus reitermarkus deleted the fix-symlink branch January 14, 2019 01:20
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants