Skip to content

Conversation

@cachebag
Copy link
Contributor

@cachebag cachebag commented Jan 6, 2026

This PR employs symlink preservation in copy_file and adds it to copy_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_file to 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 manage rustup via external package managers?

If this PR steers out of scope of the goals of rustup I'm happy to close it but I feel like the former behavior is preferable for most use cases.

Previously, copy_dir would follow symlinks and copy the target
contents. Now it preserves symlinks by reading the link target
and creating a new symlink with the same target.

Adds regression test copy_dir_preserves_symlinks.
Previously, copy_file created a symlink pointing to the source
path rather than preserving the original symlink's target.
Now it reads the link target and creates a symlink with that
same target.

Adds regression test copy_file_preserves_symlinks.
@rami3l rami3l self-assigned this Jan 8, 2026
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.

2 participants