Skip to content

Commit

Permalink
Don't generate empty google.protobuf.rs (#2005)
Browse files Browse the repository at this point in the history
* Don't generate empty google.protobuf.rs

* Verify file is empty
  • Loading branch information
tustvold committed Jul 8, 2022
1 parent 58848c4 commit 9333a85
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions arrow-flight/build.rs
Expand Up @@ -88,6 +88,13 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
file.write_all(buffer.as_bytes())?;
}

// Prost currently generates an empty file, this was fixed but then reverted
// https://github.com/tokio-rs/prost/pull/639
let google_protobuf_rs = Path::new("src/sql/google.protobuf.rs");
if google_protobuf_rs.exists() && google_protobuf_rs.metadata().unwrap().len() == 0 {
std::fs::remove_file(google_protobuf_rs).unwrap();
}

// As the proto file is checked in, the build should not fail if the file is not found
Ok(())
}

0 comments on commit 9333a85

Please sign in to comment.