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
Specifying an installation directory #618
Comments
|
Hi @AtheMathmo! Today This is not explicitly documented, but should be. Perhaps in the It probably also make sense to add installation options to the installer, both interactive and non-interactive. What do you think @Diggsey @alexcrichton ? |
|
Hm, changing the installation dir in the installer comes with some complexity because after installation the environment should be configured with custom values for |
|
Sounds good to me! |
|
Thanks for the reply. I managed to get this working locally with the following command
I had to use However this didn't work as expected. Though rustup is added to the path if I try to uninstall I see the following:
And if I try to use cargo:
I am using windows with MINGW64, which may be adding some complication. I'll try doing this on my ubuntu machine in a little while. Edit: Managed to get past the uninstall error by setting CARGO_HOME/RUSTUP_HOME again. I then faced a permissions issue so I had to brute force it. |
|
Similar issues on Ubuntu. I install with:
Calling Calling Trying to uninstall with The The biggest issue here for me seems to be the toolchain problems. From what I understand there should always be a global toolchain set? I suppose for now I could just override the directory toolchain in the heroku build pack. Let me know if I'm misunderstanding anything. EDIT: Sorry for the information overload. I managed to fix the toolchain issue just by adding Looks like it is usable for what I need - albeit with a few quirks. |
|
Thanks for the further investigation @AtheMathmo. This does indeed look all kinds of buggy. I am not sure what's happening offhand but I will try to investigate ... sometime |
|
No problem. I'm happy to put a little more time in trying to figure this out. If you know the relevant areas of code I can dig around a little - though I'm not sure I'll be of too much use. |
|
Setting My personal use case for this is that Version: |
|
@ruuda I personally installed rustup.rs normally, and then set |
|
@retep998 great idea! Now that I check, it looks like Rustup put the toolchains in my configured |
|
@ruuda |
Unfortunately, it seems like Edit: my mistake - my rustup was old and had an old directory structure, upgrading fixed it |
…richton Give a hint of what to do if rustup is installed cc #618 (comment)
|
Choosing where to install something is pretty basic functionality.
So just print a message telling the user to set those variables ? I mean, the installer already sets the PATH for the user, which is extremely fishy since chances are this will be lost on re-loggin. We should just be printing a message here telling the user that for everything to work correctly these variables must be set. Ideally, in an easy to copy-paste way. That's pretty much what all installers do that install something that require setting the environment in any particular way. There is no reliably way for the installer to set these, so this is something that users just have to do or else nothing will work. |
|
What is the status on this? At work, I have a very small |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Moderator note Please don't pile on on issues pressuring people to fix them. Rust is a volunteer-run project and sometimes things just take time. If you want to help it might be possible to ask the maintainers to provide pointers for what code specifically needs fixing. Thanks! (Please do not reply to this comment, if you have questions email rust-mods@rust-lang.org) |
|
For those interested, you can amend the place that Documentation to this effect is in https://github.com/rust-lang/rustup.rs/#choosing-where-to-install As such, I'm going to close this issue. |
|
@kinnison Does the installer already tell users that this can be done, and how to do it, or does the installer ask the user if they want to install rustup in a non-default location, and let them specify a path ? An installer that does not do that gives a pretty bad impression, particularly if the user needs to install things first, then search for where the things got installed, then find out whether that installation path can be changed, then remove the installation, and then reinstall things again. IMO the installer should be at least telling users where it is going to install things, and whether that can be changed, and how to change it. Something like:
|
|
Currently we only report the I'm not sure quite what the best way to provide this is, but if you feel your example is sufficient then please open a fresh issue to request that directly. |
- Add rust env variables: CARGO_HOME, RUSTUP_HOME. More detail to rust-lang/rustup#618. - Add cargo install directory variable: CARGO_INSTALL_ROOT. More detail to https://doc.rust-lang.org/cargo/commands/cargo-install.html.
|
With your hints managed to get it working and successfully build projects like libredirectionio. |
|
I just found the issue here. My use case is a bit different - I install everything into versioned Rust would reside at e. g. That directory ( /home/Programs/ ) I also regularly back up, install onto other GoboLinux uses a simpler scheme, with only /Programs/. I was also using I suppose I could find all files rust installs and use a script to relocate all (The issue here is quite long; I think it would be best if somewhere there A configure option such as --prefix or --installation-prefix or something Hmm tried it. The target ended up being: There are the bin/ lib/ etc... subdirectories. I suppose the toolchains/ directory is hardcoded. If this is the case |
|
No, |
|
I read every comment on this issue and did some web searches. I have concluded that RUSTUP_HOME is not documented except here. I'm probably wrong, but I don't currently see how. So, I recommend documenting that! |
|
|
|
For Windows users
|
|
@pcdinh I don't think this is correct. I just tried it, but after installing it this way, any new process that opens still uses the wrong You need to set these variables globally and permanently like this, then restart your PC. Then, install rustup the usual way. Then it works properly. |
A quick search through the issue tracker came up short - my apologies if this has been asked before.
I'm wondering if there is a way to specify an installation directory other than e.g.
$HOME/.cargo.I'm faced with a situation right now where it would be useful. I'm using a custom buildpack to deploy a Rust app to Heroku. Heroku provides a Cache directory which persists between builds - but as I am unable to install to this directory I have to reinstall my toolchain and dependencies each time.
If this isn't currently possible and is deemed useful I'd be happy to take a crack at it.
The text was updated successfully, but these errors were encountered: