There's an issue on GitHub about rustup.sh
- that it could detect installation by non-root user and switch to single-user installation mode automatically.
I think it's a good idea to install stuff locally - it's easier to manage and remove, users can have different installations, etc.
It could use $HOME/install
or something similar as prefix if the user is not root, but there are several problems.
If we are to install to user directory, we need to update user's environment. Meaning, we need at least to add $HOME/install/bin
to $PATH
and $HOME/install/lib
to $LD_LIBRARY_PATH
. There are several options on doing that:
- We could update
.profile
, but it's not run in all situations, and order and set of startup files is heavily dependent on current login shell and other setup. - We could update
.*rc
file corresponding to current shell (e.g..zshrc
for ZSH), but this way set of shells is hand-picked and seems fragile. - We could ask the user to update the variables, but it would defeat the purpose of one-line installation. I'd like to not do anything manually.
I'm not sure what's the proper way of doing such kind of thing, as updating user's .rc
files feels like an intrusion into user's settings.
Then, man
simply doesn't work with off-system manual files. It can be pointed to manuals using command line option. Then we either:
- Add an alias which would supply necessary options to
man
, so that something likeuserman rustc
would work. Feels awkward. - Ignore the issue and tell users to point their
man
to installation directory if they want Rust manuals.
Maybe I miss another option?
What's your opinion on whether user installation should be implemented? What are your preferences on different options outlined above?