GithubHelp home page GithubHelp logo

Comments (7)

djc avatar djc commented on August 16, 2024 1

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.

djc avatar djc commented on August 16, 2024 1

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.

rami3l avatar rami3l commented on August 16, 2024

@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.

w1redch4d avatar w1redch4d commented on August 16, 2024

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.

rami3l avatar rami3l commented on August 16, 2024

@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 and RUSTUP_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.

rbtcollins avatar rbtcollins commented on August 16, 2024

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.

rbtcollins avatar rbtcollins commented on August 16, 2024

And the docs were added 4 years back. #618 (comment)

from rustup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.