Skip to content

Unable to relocate install location #4222

@douglas-raillard-arm

Description

@douglas-raillard-arm

Verification

Problem

rustup 1.28.0 has started using symlinks for proxy links. Unfortunately, the links are absolute symlinks, so they break when moving that install folder around.

The use case is a caching system that installs the rust toolchain in a temp folder, then moves it to a folder named after a hash key. Installing under the final location is not possible as that would expose a half-installed toolchain to concurrent users of the cache, hence the use of a temp folder and an atomic rename of it.

Steps

rustup toolchain install {quote(rust_version)} --profile minimal {components} with CARGO_HOME and RUSTUP_HOME set to point at the folder to install into.

Possible Solution(s)

  • An option to revert to using hardlinks
  • make rustup use relative symlinks rather than absolute

Notes

I'm not sure if relocating the install folder is really supported.

Rustup version

1.28.0

Installed toolchains

Default host: x86_64-unknown-linux-gnu
rustup home:  /home/dourai01/.rustup

installed toolchains
--------------------

nightly-2025-01-28-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)
1.81.0-x86_64-unknown-linux-gnu

active toolchain
----------------

nightly-x86_64-unknown-linux-gnu (default)
rustc 1.87.0-nightly (f04bbc60f 2025-02-20)

OS version

Ubuntu 24.04.2 LTS

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions