noritada / grib-rs

GRIB format parser for Rust
Apache License 2.0
57 stars 9 forks source link

Suggest `git submodule update --init` in build failure #57

Closed noritada closed 11 months ago

noritada commented 11 months ago

This PR improves an error message from cargo build to suggest git submodule update --init.

Current:

Caused by:
  process didn't exit successfully: `/path/to/grib-rs/target/.../build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', build.rs:10:23
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

After improvement:

Caused by:
  process didn't exit successfully: `/path/to/grib-rs/target/.../build-script-build` (exit status: 1)
  --- stderr
  Error: "def/CCT is empty; run `git submodule update --init`"

Motivation

A senior member of the company I am working for asked me when he had an error trying to build grib-rs. I could instantly imagine that the cause was the absence of submodules, but the error message certainly seemed confusing to users.