Comments (7)
I don't think we should offer functionality within rustup to manipulate the environment like that, that feels like opening a can of worms in complexity at a time when we're already quite limited in development capacity. But adding better inline guidance and documentation sounds great to me!
from rustup.
Current docs:
djc-2021 update-deps pulumi $ ./rustup-init
Welcome to Rust!
This will download and install the official compiler for the Rust
programming language, and its package manager, Cargo.
Rustup metadata and toolchains will be installed into the Rustup
home directory, located at:
/Users/djc/.rustup
This can be modified with the RUSTUP_HOME environment variable.
The Cargo home directory is located at:
/Users/djc/.cargo
This can be modified with the CARGO_HOME environment variable.
So yes, this seems pretty friendly to me already.
from rustup.
@w1redch4d Hi! Currently the installation path selection is implemented via environment variables.
Have you tried setting CARGO_HOME
and/or RUSTUP_HOME
to somewhere else?
from rustup.
Yep, ik that as mentioned in #618 , but ig an installation path prompt in rustup-init might be more helpful for people who are just getting started ?
from rustup.
@w1redch4d Thanks for your willingness to contribute on this issue! However, there is indeed a reason why options/prompts haven't been provided for this one:
Hm, changing the installation dir in the installer comes with some complexity because after installation the environment should be configured with custom values for
CARGO_HOME
andRUSTUP_HOME
or else it won't work right. Think we should hold off on that.
Originally posted by @brson in #618 (comment)
I see what you mean, but IIUC it is still the case that CARGO_HOME
is used not only by rustup
, but also by cargo
and others. Thus, passing an option to rustup
indicating what CARGO_HOME
should be is not very effective: this must be done before even launching rustup-init
and it must somehow persist, otherwise certain things might go wrong.
Maybe the best thing that we can do currently (without breaking our compatibility promises) could be something like the following:
The Rust toolchain will be installed in {RUSTUP_HOME} and cargo will use {CARGO_HOME}.
Are these directories ok?[Input:] Y/n
(on
n
): To install the Rust toolchain in a different directory, set the RUSTUP_HOME and/or CARGO_HOME environment variables to appropriate values before running the installer. (program exit).
Originally posted by @gnzlbg in #618 (comment)
As a point of improvement, in a subsequent PR, you can make rustup-init
offer to make this change for you (which you can refuse, or course) via something like [Environment]::SetEnvironmentVariable('Foo', 'Bar', 'Machine')
on Windows or by appending to the current .profile
on Unix, after which it might say restart `rustup-init` to proceed with the installation
and exits.
I'm not sure if this will break anything though... cc @rbtcollins
from rustup.
I concur.
There is a UI principle: make the common case easy, make the rare case possible.
This case is already possible.
It is not (based on how often it is asked for, and the context when it is asked for) a common case.
So - if it isn't documented, lets document it better. But I don't think we should make the common case harder by adding more prompts.
from rustup.
And the docs were added 4 years back. #618 (comment)
from rustup.
Related Issues (20)
- target 'csky-unknown-linux-gnuabiv2hf' not found in channel HOT 12
- Remove frequent single semver-compatible dependent Renovate PRs HOT 2
- Support for more NetBSD architectures HOT 3
- rustup can only be named "rustup-init". HOT 1
- Rustup should not perform implicit installations HOT 5
- Cannot update on Windows due to renaming issues HOT 2
- $HOME/.cargo/env missing on Windows HOT 1
- warning: spurious network error (3 tries remaining): [7] Couldn't connect to server (Failed to connect to 127.0.0.1 port 4780 after 0 ms: Couldn't connect to server) HOT 9
- warning: spurious network error (3 tries remaining): [7] Couldn't connect to server (Failed to connect to 127.0.0.1 port 4780 after 0 ms: Couldn't connect to server) HOT 3
- `rustup set default-host` does not change the default toolchain HOT 2
- `rustup` installation broken after upgrading from macOS 13.6 to 14.2 HOT 6
- Warnings from running `rustup update` command
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh HOT 1
- MacOS, RustUp installation doesn't work as expected. HOT 2
- i can't rustup update HOT 5
- tauri ios init fails with "failed to install target with rustup" HOT 1
- Say what ought to happen when running rustup doc. HOT 3
- windows-gnu: Allow installing rust-mingw as a target component HOT 2
- Add `cargo` sh-completions to install guide
- Meta: Update `release-process.md` to match the new workflow based on GitHub Merge Queue HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rustup.