From 528d71e8d4f73e70732ae6300bd4d48f740ceeae Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Tue, 7 Apr 2020 07:24:04 -0600 Subject: [PATCH] ARROW-7794: [Rust] Support releasing arrow-flight I tested this by running `cargo publish --dry-run --allow-dirty` from the arrow-flight directory as well as running `cargo test` from this directory and from the root of the rust workspace. Closes #6858 from andygrove/ARROW-7794 Authored-by: Andy Grove Signed-off-by: Andy Grove --- rust/arrow-flight/build.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/rust/arrow-flight/build.rs b/rust/arrow-flight/build.rs index 71edc3218867e..c5230400c2570 100644 --- a/rust/arrow-flight/build.rs +++ b/rust/arrow-flight/build.rs @@ -15,7 +15,17 @@ // specific language governing permissions and limitations // under the License. +use std::env; + fn main() -> Result<(), Box> { - tonic_build::compile_protos("../../format/Flight.proto")?; + // 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 mut path = env::current_dir()?; + while !path.ends_with("arrow") { + path.pop(); + } + path.push("format"); + path.push("Flight.proto"); + tonic_build::compile_protos(path)?; Ok(()) }