rust-lang / rust-lang/rustup

improve custom installation experience / docs

Open
#2,479 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
22h 40m
Merged PRs (30d)
46

Description

Describe the problem you are trying to solve

Install Rust tooling in custom locations on my file system via env vars.

Describe the solution you'd like

I'd like rustup to not error if installed somewhere other than ~/.cargo.

Notes

$ echo $RUSTUP_HOME $CARGO_HOME $CARGO_INSTALL_ROOT
/Users/taryn/.data/rustup /Users/taryn/.data/cargo /Users/taryn/.bin

$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | RUSTUP_HOME="$RUSTUP_HOME" CARGO_HOME="$CARGO_HOME" sh

[..snip..]

Rustup metadata and toolchains will be installed into the Rustup
home directory, located at:

  /Users/taryn/.data/rustup

This can be modified with the RUSTUP_HOME environment variable.

The Cargo home directory located at:

  /Users/taryn/.data/cargo

This can be modified with the CARGO_HOME environment variable.

The cargo, rustc, rustup and other commands will be added to
Cargo's bin directory, located at:

  /Users/taryn/.data/cargo/bin

[..snip..]

  stable installed - rustc 1.46.0 (04488afe3 2020-08-24)


Rust is installed now. Great!

To get started you need Cargo's bin directory (/Users/taryn/.data/cargo/bin) in
your PATH
environment variable.

To configure your current shell run source /Users/taryn/.data/cargo/env

$ which rustup cargo rustc
/Users/taryn/.data/cargo/bin/rustup
/Users/taryn/.data/cargo/bin/cargo
/Users/taryn/.data/cargo/bin/rustc

$ rustup self update
error: rustup is not installed at '/Users/taryn/.cargo'

If rustup must be installed at ~/.cargo, why have the home env vars at all?
If I need to do something else that hasn't been shown here, the docs don't make that clear to me.
AFAICT I've done everything correctly but cannot use Rust tooling.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no repository files or tests. Start by reproducing the shown RUSTUP_HOME and CARGO_HOME installation, then trace the rustup self update path and existing installation documentation. Done means custom locations work consistently, or the documented setup and limitations clearly match the observed behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.