rust-lang / rust-lang/rustup

CARGO_HOME and RUSTUP_HOME should be included in .cargo/env

Open
#2,842 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Problem
Installing to a custom location works fine with
export CARGO_HOME=custom/.cargo export RUSTUP_HOME=custom/.rustup
.bashrc is then updated to source custom/.cargo/env. But then, if the latter file doesn't re-export the custom env vars, cargo and the other tools won't recognise the installation path. This was already mentioned here https://github.com/rust-lang/rustup/issues/2656#issuecomment-890401936

Possible Solution(s)

At least if those env vars haven't got their default values, exporting them from .cargo/env should do the trick, shouldn't it?

Notes

Output of rustup --version: rustup 1.24.3 (ce5817a94 2021-05-31)
Output of rustup show: Default host: x86_64-unknown-linux-gnu

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

Inspect how rustup generates the .cargo/env file, then reproduce an installation using custom CARGO_HOME and RUSTUP_HOME values. Confirm that sourcing the generated file preserves those non-default paths so cargo and related tools recognize the installation; add or run the relevant existing tests if the generation path identifies them.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.