Page MenuHomeSolus

Rust lang: cargo command is unknown
Closed, ResolvedPublic

Description

After installing Rust according to the description on their website (https://www.rust-lang.org/tools/install), the commands "rustup" and "cargo" are not known to the command line, even after restarting the session or the whole system.
Bear in my I only tested this on a VM, so the behaviour on a regular system might differ.
My main system is Pop_OS 18.04, my Solus version is 4.1 running on Virtual Machine Manager.

Event Timeline

purrlinn created this task.Feb 29 2020, 2:17 PM
Herald edited projects, added Lacks Project; removed Restricted Project. · View Herald TranscriptFeb 29 2020, 2:17 PM
Girtablulu triaged this task as Needs More Info priority.Feb 29 2020, 2:21 PM
Girtablulu added a subscriber: Girtablulu.

we do have the rust version inside our repo, did you use this to install or only used it via rustup?

purrlinn added a comment.EditedFeb 29 2020, 5:01 PM

I used this command:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Is that not the blessed way of installing rust on solus?

Edit: I tried installing rust via

sudo eopkg install rust

The behaviour did not change, still neither cargo nor rustup are found.

Girtablulu added a comment.EditedFeb 29 2020, 5:12 PM

because cargo is a separate package, install it via

sudo eopkg it cargo

or

sudo eopkg it rustup

of course nothing works if you just curl stuff and do not do any distro integration, I have a feeling you have a fundamental misunderstanding how things work on Linux

livingsilver94 added a subscriber: livingsilver94.EditedFeb 29 2020, 5:58 PM

Also, our rust and cargo packages are more oriented to build other packages than to users. They do work of course but you cannot install and select the toolchains you want nor you can update Rust at your discretion. I suggest you to install rustup via sudo eopkg it rustup so that you have rustup which you can do whatever you want with, it doesn't have the limitations I listed.

purrlinn added a comment.EditedMar 1 2020, 1:58 AM

because cargo is a separate package, install it via
sudo eopkg it cargo
or
sudo eopkg it rustup
of course nothing works if you just curl stuff and do not do any distro integration, I have a feeling you have a fundamental misunderstanding how things work on Linux

Please do enlighten me, I am mildly confused as to how the "just curl" method did work on my Ubuntu derivative (and by work I mean cargo being added to path without me manually configuring bashrc).
Something I did not know (and something I would still consider insane) is the split of the rust eco system into separate packages. Is there some way I could have reliably found out how to "correctly" install it on Solus? I did try google, in case you are wondering.

Maintainer of rustup on Solus here
Splitting the rust ecosystem is not a good choice, I agree with you, but rustc, cargo and rustup are different programs, which follow different development cycles. As such, distributing these three programs in one single package would be rather impossible to maintain.
Additionally, this 'big-rust' package would depend on itself since rustup depends on cargo, and so on, which adds even more difficulty.

If you're a rust developer, who need to use and manage rust toolchains, then you have to use rustup. In this case, proceed as follows:

  • uninstall cargo, rust with eopkg
  • remove the content of your ~/.rustup
  • run a sudo eopkg it rustup, and install your toolchain with rustup as usual.

Once done, feel free to come here again so that we can help you in case of troubles.

JoshStrobl closed this task as Resolved.Apr 26 2020, 1:14 PM
JoshStrobl claimed this task.
JoshStrobl added a subscriber: JoshStrobl.

Closing due to lack of response. Thanks @josephscade for jumping in with additional info.