-
Notifications
You must be signed in to change notification settings - Fork 904
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
A more robust post-install environment setup #1881
Comments
I think this is very reasonable. Currently we add Regarding the expansion or otherwise of ### BEGIN:RUSTUP Added by rustup, do not change this section by hand
if test "x$CARGO_HOME" = "x"; then
CARGO_HOME="/expanded/cargo/home/from/install/time"
export CARGO_HOME
fi
if ! command -v rustup >/dev/null 2>&1; then
PATH="${CARGO_HOME}/bin:$PATH"
export PATH
fi
### END:RUSTUP Added by rustup, do not change this section by hand That would cover all shells which are at least POSIX compatible, including ones which don't actually support We'd need to convert from the old string to the new one, but the markers would make it clearer what was going on perhaps? I don't like the idea of spawning a new shell immediately because that would play badly with some people's terminal expectations. I think it's sufficient to make it clear what to do to make the current shell work (which we print out anyway) and to make it more likely that a newly opened shell will do the right thing via your points about the RC files. I think, since I started writing this, you removed mention of the ### BEGIN:RUSTUP Added by rustup, do not change this section by hand
if ! command -v rustup >/dev/null 2>&1; then
PATH="/cargo/home/from/install/time/bin:$PATH"
export PATH
fi
### END:RUSTUP Added by rustup, do not change this section by hand |
Ah, I removed my comments about On the other hand though, I'm not sure if that's the best use of |
@98982872 if that is after creating a new login session then please open a new ticket about installation on your distro. This ticket is about the requirement for starting new login sessions before rustup is actually usable. |
This is being worked on, also. |
This is based on my recent frustration reinstalling WSL and rustup, and subsequent discussion here: #975 (comment)
The rustup install experience is still frustrating. Ever since modifying rustup to modify only
.profile
instead of the rc files, I don't particularly know how to get cargo to work on my WSL install, and always end up modifying.bashrc
.I don't know when or if
.profile
is executed by default on WSL, but some cursory googling suggests it is not. I have only just today figured out how to open a WSL terminal to a login shell.And I suspect many users don't understand the difference between a login shell and non-login shell. That they have to log out of their GUI and back in (as I understand it - or understand what a login shell is and launch one) is obnoxious. I just want to start working in Rust immediately.
I know that the "correct" thing to do is to modify
.profile
,.bash_profile
, and maybe.bash_login
(which is not modified today), but I don't think it provides a good experience, and I'd like to propose a more rubust solution.~/.cargo/env
to conditionally modify $PATH if it is not already set..profile
,.bash_profile
,.bash_login
,.bashrc
, and.zshrc
, any of those that exist.For purists who don't like this, they can configure the installer to not touch their dotfiles.
It was additionally suggested in the above mentioned thread that the rustup installer itself could immediately spawn a new shell so that the current terminal works immediately. I think this is worth considering. (Edit: though there are challenges here with non-interactive installs, installs that prefer non-bash environments, maybe others. It would also need to be a config option).
It is embarrassing that rust does not "just work" after install. It is the first impression of the rust experience.
Edit: removed some unrelated comments about $CARGO_HOME
The text was updated successfully, but these errors were encountered: