Skip to content

Unable to relocate install location #4222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
douglas-raillard-arm opened this issue Mar 4, 2025 · 1 comment · Fixed by #4226
Closed
2 tasks done

Unable to relocate install location #4222

douglas-raillard-arm opened this issue Mar 4, 2025 · 1 comment · Fixed by #4226
Labels

Comments

@douglas-raillard-arm
Copy link

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
@ChrisDenton
Copy link
Member

Thanks for the report, I agree we should use relative paths for binary symlinks where possible. Especially if it's linking within the same parent directory (which proxies should do).

@djc djc closed this as completed in #4226 Mar 5, 2025
douglas-raillard-arm added a commit to ARM-software/lisa that referenced this issue Mar 5, 2025
FIX

rustup 1.28.0 started using absolute symlinks for some toolchain files
rather than using hardlinks. That is a problem for LISA as the Rust
toolchain is installed in a temporary folder that is then moved under a
long-term name. When the folder gets rename, all symlinks break as they
are absolute:

    rust-lang/rustup#4222

Fix that by adding a post-processing pass after running rustup so that
symlinks get re-written as relative links.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants