-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Adding targets for packaged rust installations is very hacky #108819
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
Comments
Hm, I think this is really up to the package maintainers. They could add additional targets options if they desired. But I guess they don't because they only have a rustc system package for the purposes of building rust applications for that system. And I do not think rust should be messing with a system install either. That sounds like it may cause more problems than it solves. Fortunately rustup is aware of system rustc so can be used alongside it. |
@ChrisDenton Hello and thanks for your remark! |
Maybe because this wasn't always the case? Not sure. There's a documentation page on using a manual install of rustup with distribution managed rustc. It requires a little bit of setup but I'm not aware of any reason why a package maintainer couldn't do this for you. If there are any issues then these should probably be reported on https://github.com/rust-lang/rustup so the relevant team can look into it. |
@yogo1212 Hello, I also use Arch Linux with a rustup installation (and I am a Rustup contributor). If you use the rustup package, you can use the latest stable rustc, managed by rustup, and have Rustup managed by pacman. Since Rustup takes care of itself when it's uninstalled, and pacman knows where to find Rustup, this means everything is ultimately still fully managed by the package manager. And from the perspective of the distro tools, such as build scripts, etc., essentially the difference is completely invisible. So you can replace the rust package with the rustup package just fine. |
i think i'll have to give up the idea of sharing the toolchain across users :-D |
Ah, sharing toolchains between users is not something that rustup currently supports. The closest we have is doing a manual install of the toolchains you want. But you'd still need to also add any cross-target libs you need. |
Yes, it's very hard to reconcile "rustup allows you to install a toolchain without escalated privileges" with "you need superuser privileges to invoke the package manager" here. That sort of thing would probably need special support from the package manager, as well. Honestly, it is fairly unreasonable for a package manager to fully support installing all of the 100 releases that Rustup supports installing. |
I'm going to close this as not a bug; support for multiple rustup users is tracked in rust-lang/rustup#313 and the Rust project can't control what targets Arch packages. |
are there like user packages that add targets? |
Having installed rust through the package manager on Endeavour OS, adding targets like
wasm32-unknown-unknown
is very painful.The compiler suggests the installation through
rustup
:But
rustup
is incompatible with therust
package.Installing a target without rustup is apparently not documented publicly or at all intended.
The manual installation involves listing files on static.rust-lang.org, picking an appropriate version of rust-std, and extracting parts of the archive into the Rust installation dir.
The installation resides in /usr/include/rustlib/ so packaging is advised and then it really gets out of hand.
I don't suppose Rust will become easily packagable any time soon but it would be nice to integrate targets with cargo so they can be used with system installations more nicely.
The text was updated successfully, but these errors were encountered: