succinctlabs / sp1

A performant, 100% open-source, contributor-friendly zkVM.
https://succinctlabs.github.io/sp1
Apache License 2.0
936 stars 286 forks source link

Provide a user-friendly error message when Cargo.toml is not found #733

Closed imotai closed 1 month ago

imotai commented 4 months ago

Description:

When running cargo-prove prove build and Cargo.toml is not found in the current directory or any parent directory, the current error message is:

thread 'main' panicked at cli/src/build.rs:27:40:
called `Result::unwrap()` on an `Err` value: CargoMetadata { stderr: "error: could not find `Cargo.toml` in `/mnt/ssd3/opensource` or any parent directory\n" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Suggestion:

Instead of the current error message, we can follow the error message from cargo build

error: could not find `Cargo.toml` in `/mnt/ssd3/opensource` or any parent directory

Related code https://github.com/succinctlabs/sp1/blob/f50fb1c3b11993fa926c128b1d38db7af969ef51/cli/src/build.rs#L25-L28

varun-doshi commented 4 months ago

Hi...I'd like to work on this issue

4rgon4ut commented 1 month ago

@varun-doshi its been a while so I decided to stab, hope its ok