-
Notifications
You must be signed in to change notification settings - Fork 888
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
Does rustup.rs support shared .multirust (or whatever) directory? #313
Comments
It does not support it now, and I haven't considered exactly this scenario before. It is related to the use case of installing rustup globally, or toolchains globally. Is it mostly the toolchains you want to share? I'm not sure if there's a use case for sharing anything else. |
I'd like to install rustup.rs globally & install toolchains globally as well. The Rust installers can't install multiple targets on a host, so rustup.rs is really the only reliable way of installing and maintaining multiple Rust targets/toolchains. And it's critical to install globally on multi-user machines, because I don't want to use |
Thanks for the feedback @alexchandel! I'm afraid I still haven't put much thought into how global installation might work. Offhand I might expect that global rustup installation and global toolchain installation are two independent things. Maybe the |
There's also two types of global toolchain installation:
In both cases, you'd want those toolchains to be "inherited" so that a user can still have a user-specific set of toolchains, and can switch between global and local toolchains easily. One thing we should be very careful about is permissioning: whatever we do, we should make sure never to put root-owned files in the user's home directory, and should never do what |
Yep, this is an easy mistake to make. Run |
@brson Provisionally, I'd just like globally accessible toolchains. If I move rustup's folders from |
Any updates on this? |
Has anyone found a way to install rustup for all users so that it works? |
@brson What do you think of this strategy: Non-windows:
Windows:
Both:
|
@Diggsey , Is modifying un- This seems to be the only missing piece for sharing Rust between two accounts (both having write access) without root by using sticky bit on directories. |
@vi I was focusing on global toolchains in the style of npm, where root is required to install globally. You seem to be suggesting a different feature - the ability to have two or more users share the same |
@Diggsey, Unpacking crates (tar archives) should ignore file modes except of +x. In other words, behave like in Git. Shared group, g+rwx, sticky group bit and umask |
@Diggsey, It looks like a rustup.rs's pull request, but the problem is in Cargo. |
@vi I'm not sure I follow: we were talking about a shared
This is the rustup issue tracker 😛 |
I though for a moment that it is about multi-user strategy for entire Rust, not just rustup.rs. |
Any progress on this, @brson? I remember discussing this idea with you some time ago, when your multirust library was the thing. |
Is there any progress on this issue? For my work we have several machines running Raspbian on ARM where the latest packaged version is 1.24, so it's very difficult to get work done without an update-to-date version of rust. |
There has been no work on this, no. If you have ideas, I'm prepared to entertain approaches to make this sane and safe. (bear in mind rustup already has a whole host of "we don't lock stuff" problems) |
I share |
As mentioned in #313 (comment), It looks like there are actually two separate feature requests here:
#1085 is only for the second use case (which is my use case) but was closed as a dupe of this issue. Is is possible to try solving 2. before trying to solve 1? That seems to me like it would be a lot easier and fix the vast majority of use cases. #313 (comment) has lots of good suggestions which I don't think ever got a response. |
A read-only rustup installation is not something rustup expects to deal with. You could be careful to not run anything which could cause writes to the installation (e.g. nothing which might force a toolchain to exist, so no use of |
@jyn514 It's not clear to me why a shared read-only install is 'your use case' - what is it about having several pi's that requires a shared installation: running rustup installed binaries on pi's doesn't seem to imply sharing those binaries between the pi's in any fashion. What is it about the regular installation path that doesn't work for your pi machines? Are they low on disk space? Is your NFS server short on disk space? Does rustup fail to unpack? (that should be fixed in the latest release now we auto-probe memory). See #988 and #2417 for direct issues with sharing writable installs; if cargo's cache isn't shared then the cargo locking is probably avoidable from a scalability perspective, but you'll still be unable to use regular rustup workflows: vs-code integration / rls integrations / rustup update and frields, rustup default, rustup overrides, toolchain files, custom toolchains. Note that we don't even guarantee arch-aware filepaths in ~/.rustup - sharing a rustup_home across architectures is not currently safe - settings.toml has a default-host that is arch specific, and sharing an install across heterogeneous machines over NFS would be broken by design. |
@rbtcollins Sorry if I was unclear - I don't expect to share rustup across multiple machines, that's a much harder problem. I want to share rustup across multiple users.
The regular installation path is specific to each user. To expand a little more on this, we have a test suite that runs on several different machines at once, with the permissions of the user who started the test (we have automation internally to make sure each machine has each user). Currently, for it to work, each user has to have their own installation of rustup on each machine. This is not really tenable, it comes out to dozens (if not hundreds) of installations; we just haven't been running Rust tests on the Pis for now. I'm asking to be able to install rustup once on each machine and have it be accessible to each user.
Right, I'm only asking for read-only installs. See #313 (comment). |
I wonder if Nix package manager could be of any help for a multi-user setup. Just a thought. |
It's a nice idea, but sadly this requires system level support (ie. a user and a daemon) which, at least in the past, was out of scope for rustup. |
I want more than one UNIX user to have write access to shared multirust installation.
Is such mode supported/planned in the new rustup.rs? It should probably be like Git's
core.sharedRepository
setting, causing Cargo and other tools to create group-writable files and directories.(I haven't actually experimented with it yet).
The text was updated successfully, but these errors were encountered: