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

Promote protobuf warnings to errors #16108

Open
antiguru opened this issue Nov 16, 2022 · 1 comment
Open

Promote protobuf warnings to errors #16108

antiguru opened this issue Nov 16, 2022 · 1 comment
Labels
C-refactoring Category: replacing or reorganizing code

Comments

@antiguru
Copy link
Member

Protobuf warnings are currently silently swallowed by our build system. We can instruct protobuf to promote all warnings to errors, which will fail the build in the presence of protobuf warnings. This can be enabled for example like this:

diff --git a/src/repr/build.rs b/src/repr/build.rs
index 391fcafc7..7d6754962 100644
--- a/src/repr/build.rs
+++ b/src/repr/build.rs
@@ -13,6 +13,7 @@ fn main() {
     env::set_var("PROTOC", protobuf_src::protoc());

     prost_build::Config::new()
+        .protoc_arg("--fatal_warnings")
         .compile_protos(
             &[
                 "repr/src/antichain.proto",

Add the --fatal_warnings flag to all prost_build calls and fix the resulting errors.

@antiguru antiguru added the C-refactoring Category: replacing or reorganizing code label Nov 16, 2022
@benesch
Copy link
Member

benesch commented Nov 17, 2022

Omg! You have no idea how many years it took me to make this a thing. protocolbuffers/protobuf#8131 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-refactoring Category: replacing or reorganizing code
Projects
None yet
Development

No branches or pull requests

2 participants