Commit graph

3 commits

Author SHA1 Message Date
Maciek Swiech
a1e56e4420 proto_build_tools: dont fail silently
if the call to protoc_rust::Codegen::run() fails, it fails silently (or
rather, with a println! that is not displayed unless `cargo build` is
invoked more verbosely) which can result in errors later on during
compilation, making it hard to track the root cause. this change adds an
expect call to make the code panic on error.

however, due to various cfg and other changes, there can be the
expectation of an `out/generated.rs` file still existing when no protos
have been compiled, so we also add a quick guard for empty proto paths
in the generation code.

BUG=none
TEST=cargo build

Change-Id: If5a67a45a5de937b6569c1f631a180401b860cee
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4210068
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Maciek Swiech <drmasquatch@google.com>
2023-01-31 18:03:00 +00:00
Daniel Verkamp
dfe9869d6c Rust 1.65: Fix clippy borrow_deref_ref, needless_borrow, and explicit_auto_deref lints
BUG=b:260784028
TEST=tools/clippy

Change-Id: I85cd5e096bc7b977fe1d9b231c08338b65e71780
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4064714
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-11-30 19:33:31 +00:00
Noah Gold
232d47446c proto_build_tools: add crate for proto build tools.
In addition to DRYing out our proto code, we're switching to using
PathBufs to reduce the potential for cross platform errors.

BUG=b:256951877
TEST=builds

Change-Id: Ib7588de231afe67853c099e4f81683731b9439de
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4021590
Reviewed-by: Vikram Auradkar <auradkar@google.com>
2022-11-12 01:02:23 +00:00