diff --git a/gen/pb-rust/sigstore-protobuf-specs/build.rs b/gen/pb-rust/sigstore-protobuf-specs/build.rs index be3e82c5..61d77f06 100644 --- a/gen/pb-rust/sigstore-protobuf-specs/build.rs +++ b/gen/pb-rust/sigstore-protobuf-specs/build.rs @@ -1,9 +1,16 @@ +use anyhow::Context; + /// Find the standard protobuf include directory. fn protobuf_include_path() -> String { let mut protobuf_root = which::which("protoc") - .ok() + .context("couldn't find protoc!") // dirname(/bin/protoc) / ../ - .and_then(|path| path.ancestors().nth(2).map(|p| p.to_path_buf())) + .and_then(|path| { + path.ancestors() + .nth(2) + .map(|p| p.to_path_buf()) + .with_context(|| format!("couldn't traverse path: {path:?}")) + }) .expect("protobuf installation directory not found!"); protobuf_root.push("include"); protobuf_root.to_str().unwrap().to_owned()