DeterminateSystems / riff

Riff automatically provides external dependencies for Rust projects, with support for other languages coming soon.
https://riff.sh
Mozilla Public License 2.0
486 stars 13 forks source link

Try to be helpful if `cargo` fails to execute #45

Closed Hoverbear closed 2 years ago

Hoverbear commented 2 years ago

image

linear[bot] commented 2 years ago
DS-255 Try to be helpful if `cargo` fails to execute

If we fail to execute `cargo`, would should produce a nice error message for this relatively predictable error scenario. Currently the output looks like this: ``` root@ubuntu-s-4vcpu-8gb-amd-nyc1-01:~/tokenizers/tokenizers# ~/fsm shell Error: 0: Could not execute `cargo metadata` 1: No such file or directory (os error 2) Location: src/dev_env.rs:78 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SPANTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0: fsm::dev_env::add_deps_from_cargo with project_dir=/root/tokenizers/tokenizers at src/dev_env.rs:60 Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it. Run with RUST_BACKTRACE=full to include source snippets. ``` but we could probably do something a bit nicer, like: ``` $ fsm shell Could not execute `cargo metadata`. Is `cargo` installed? Get instructions for installing Cargo: https://www.rust-lang.org/tools/install ``` and exiting 1.

Hoverbear commented 2 years ago

I don't think the ` should be colored.