Typical Fedora 28 install?
dnf. When I open Visual Studio Code and add the Rust plugin “Rust (RLS)” it complains because
rustup cannot be found. Searching for “install rustup feora” takes me to https://rustup.rs/ which suggests the command
curl r/https://sh.rustup.rs \-sSf | sh
Fetching a script and passing it to
sh to execute makes the hair crawl on the back of my neck. Nevertheless, I ran it and get:
[hbarta@redmaple tower]$ curl https://sh.rustup.rs -sSf | sh
info: downloading installer
error: it looks like you have an existing installation of Rust at:
error: rustup cannot be installed alongside Rust. Please uninstall first
error: if this is what you want, restart the installation with `-y'
error: cannot install while Rust is installed
(reverse-i-search)`dnf': sudo ^Cf install openssh-server
Is the normal way to install rust to just bypass the packaging system? (That also makes the hair crawl on the back of my neck, but less than passing a script to sh.)
What are people doing?
Red Hat is using rust to develop Stratis so I expected to find rust well supported.
What am I missing?
I’m on arch and here we get at least
rustup as a package
But I really feel your pain.
Things are pretty simple. If you want to use the RLS and a current version of rust, you have to use rustup, if your local package manager is more important than a current version of rust and the RLS, stick to whatever version of rust is available for fedora, but you’ll probably run into problems when using crates then as the well maintained ons usually pick up new stable stuff quickly.
I use fedora on my main dev machine, and I use rustup, which I originally installed the scary curl | sh way. The rustup environment is entirely on my account (I did not run the curl | sh as root).
If you want to provide rust in a multiuser environment, the fedora packages is probably the way to go. But if you are happy to have each user install rust for themself (especially if you are the only user) rustup on the user account is nice, as it gives you convenient controll over which toolchanins and components to use, while the fedora packages only provide stable (currently 1.29.1 in fedora 28, so not too outdated but not entirely up-to-date either (1.29.2 was released recently).
Thanks for the replies. At least I won’t have to run the script as root.
My wild guess is that it's just trying to do something like
rustup component add rls-preview, and maybe
rust-src too. We do have
rust-src packages in Fedora, so maybe if you install those it will be happy? If not, we should dig into what it's doing and see how we can convince it that the distro packages are OK.
I do my best, along with a community Rust SIG in Fedora. I don't use VS Code though, so we'll have to see what they need.
1.29.2 is in updates-testing for all targets. Fedora policy requires a 7-day waiting period before pushing to stable, and 14 for EPEL, but if you have a Fedora account you can advance that by trying the package and providing karma. I leave it at the default +3 to stable, and F28 is currently at +2, so it just needs a little nudge...
Thanks for the suggestion. I installed those packages and VS Code is still not happy. I checked the logs when I enable the plugin and the first message I see is:
Error getting sysroot from rustc: Error: spawn rustup ENOENT
Apparently it looks for the path to
rustup to determine where the other tools are installed so I will not be able to sidestep that.
I’ll uninstall the packages and install via
rustup to get the benefit of the plugin for VS Code. I have it working on a Debian workstation and find it pretty usefu.
I’ve looked into this a bit more. It looked like the plugin was using
rustup to determine the path to the other related binaries so I provided a shell script with that name in
/usr/bin. That did not solve the problem. I’ve studied the console logs and it is not obvious what the problem is so I have submitted an issue to the plugin repo to see if they can explain what it is looking for.