Skip to content

Commit

Permalink
Cleanup generated proto code (#2921)
Browse files Browse the repository at this point in the history
* Cleanup generated proto code

* Add workspace clean check
  • Loading branch information
tustvold authored Oct 25, 2022
1 parent 9c315ce commit 4d5d10d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
parquet/src/format.rs linguist-generated
arrow-flight/src/arrow.flight.protocol.rs linguist-generated
arrow-flight/src/sql/arrow.flight.protocol.sql.rs linguist-generated
2 changes: 2 additions & 0 deletions .github/workflows/arrow_flight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ jobs:
- name: Test --all-features
run: |
cargo test -p arrow-flight --all-features
- name: Verify workspace clean
run: git diff --exit-code

clippy:
name: Clippy
Expand Down
8 changes: 2 additions & 6 deletions arrow-flight/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,12 @@
// under the License.

use std::{
env,
fs::OpenOptions,
io::{Read, Write},
path::Path,
};

fn main() -> Result<(), Box<dyn std::error::Error>> {
// override the build location, in order to check in the changes to proto files
env::set_var("OUT_DIR", "src");

// The current working directory can vary depending on how the project is being
// built or released so we build an absolute path to the proto file
let path = Path::new("../format/Flight.proto");
Expand All @@ -39,6 +35,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
tonic_build::configure()
// protoc in unbuntu builder needs this option
.protoc_arg("--experimental_allow_proto3_optional")
.out_dir("src")
.compile(&[proto_path], &[proto_dir])?;

// read file contents to string
Expand All @@ -56,8 +53,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
file.write_all(buffer.as_bytes())?;
}

// override the build location, in order to check in the changes to proto files
env::set_var("OUT_DIR", "src/sql");
// The current working directory can vary depending on how the project is being
// built or released so we build an absolute path to the proto file
let path = Path::new("../format/FlightSql.proto");
Expand All @@ -71,6 +66,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
tonic_build::configure()
// protoc in unbuntu builder needs this option
.protoc_arg("--experimental_allow_proto3_optional")
.out_dir("src/sql")
.compile(&[proto_path], &[proto_dir])?;

// read file contents to string
Expand Down

0 comments on commit 4d5d10d

Please sign in to comment.