Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emit a better error message when a command failed to execute. #122

Merged
merged 1 commit into from
Mar 7, 2022

Conversation

Julian-Wollersberger
Copy link
Contributor

I hit this when 'perl' wasn't installed on my windows machine, when trying to cargo install gitui.
The long and verbose output made it hard to notice the actual error (program not found) hiding in the panic message.
It's still verbose, but the better formatting should improve readability.

Before:

error: failed to run custom build command for `openssl-sys v0.9.72`

Caused by:
  process didn't exit successfully: `D:\Dokumente\Rust\gitui\target\debug\build\openssl-sys-3446ba0d2783aba7\build-script-main` (exit code: 101)
  --- stdout
  [ ... ]

  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { kind: NotFound, message: "program not found" }', C:\Users\Julian\.cargo\registry\src\github.com-1ecc6299db9ec823\openssl-src-111.17.0+1.1.1m\src\lib.rs:477:39
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed

After:

error: failed to run custom build command for `openssl-sys v0.9.72`

Caused by:
  process didn't exit successfully: `D:\Dokumente\Rust\gitui\target\release\build\openssl-sys-76722f0f88dd29d1\build-script-main` (exit code: 101)
  --- stdout
  [...]

  --- stderr
  thread 'main' panicked at '


  Error configuring OpenSSL build:
      Command: "perl" "./Configure" "--prefix=D:\\Dokumente\\Rust\\gitui\\target\\release\\build\\openssl-sys-e94b178bbce3b1da\\out\\openssl-build\\install" "no-dso
" "no-shared" "no-ssl3" "no-unit-test" "no-comp" "no-zlib" "no-zlib-dynamic" "no-md2" "no-rc5" "no-weak-ssl-ciphers" "no-camellia" "no-idea" "no-seed" "no-engine" "
no-asm" "VC-WIN64A"
      Failed to execute: program not found


      ', D:\Dokumente\Rust\openssl-src-rs\src\lib.rs:484:9
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed

I hit this when 'perl' wasn't installed on my windows.
@alexcrichton alexcrichton merged commit 8a3f620 into alexcrichton:master Mar 7, 2022
@Julian-Wollersberger
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants