5 ms·
I'm not too familiar with rust tools, but I wanted to check this out. Can someone explain to me why this worked, sudo apt-get install cargo rustc carg
by radarsat1 8y ago
I'm not too familiar with rust tools, but I wanted to check this out. Can someone explain to me why this worked,
sudo apt-get install cargo rustc
cargo install xsv
but this did not:
git clone <xsv github>
cd xsv
cargo build --release
The latter gave me a ton of compilation errors on the package crossbeam-channel. The former installed the program and compiled a bunch of crates, but did it install a pre-built binary for xsv? "downloading" then "installing" of xsv was the first step, then all the crates were downloaded. ldd seems to report that the installed xsv binary has no dependencies so I don't see why it would need to download and compile a bunch of crates in that case. On the other hand if it was compiling xsv then I don't understand why I don't get the same errors as in the latter case.
It seems Ubuntu has the following version:
$ rustc --version
rustc 1.25.0
I realize it's probably not optimal to use the Debian-packaged rustc but I didn't feel like figuring out the whole ecosystem just to install one program to test it out.
- burntsushi 8y agoBecause current master requires a newer version of the Rust compiler than the current release on crates.io. If current master were a release, then `cargo install xsv` would have failed with the same errors. If you like, you can download static binaries from github: https://github.com/BurntSushi/xsv/releases https://github.com/BurntSushi/xsv/releases
- radarsat1 8y agoAh, ok thanks. Anyways I got it installed, was just wondering about certain actions that cargo took. I found I could copy the resulting binary and delete my entire .cargo directory and it continues to work, so it seems cargo did some unnecessary things for `install`, but no worries.
- burntsushi 8y agoTo add to this: Cargo is more of a development tool for Rust programmers rather than a package manager for end users. Both types of tools have a lot in common, which is why things like `cargo install` exist and are very useful. In the case of `xsv`, it's a useful escape hatch since your distro doesn't package `xsv`, but `cargo install` is not like `apt install`. That is, it downloads all of the source code dependencies of `xsv` and builds them. This also requires sync'ing with crates.io's registry list. None of this is unnecessary in the standard Cargo workflow in order to build xsv, but the build artifacts are certainly unnecessary in order to run xsv.
- maccam94 8y agoDevelopment of the Rust language is still happening fairly quickly, so many projects won't compile with the 6 month old compiler version in your Linux distribution's package repository. Most developers install it using rustup.