From 84a9dbf8e44bd9825eaa4cc6cac18e6e40f8e8f7 Mon Sep 17 00:00:00 2001 From: Feng94 <8751189+Feng94@users.noreply.github.com> Date: Thu, 24 Jan 2019 23:48:52 +1100 Subject: [PATCH 1/2] Fix hardcoded string to use system constant for directory separator --- protos/build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protos/build.rs b/protos/build.rs index d8becfa51..d83cb3496 100644 --- a/protos/build.rs +++ b/protos/build.rs @@ -1,7 +1,7 @@ extern crate protoc_grpcio; fn main() { - let proto_root = "src/"; + let proto_root = &format!("{}{}", "src", std::path::MAIN_SEPARATOR); println!("cargo:rerun-if-changed={}", proto_root); protoc_grpcio::compile_grpc_protos(&["services.proto"], &[proto_root], &proto_root) .expect("Failed to compile gRPC definitions!"); From f218ab8a2383ff5e536ff70e5ebb8137098a8810 Mon Sep 17 00:00:00 2001 From: Feng94 <8751189+Feng94@users.noreply.github.com> Date: Mon, 28 Jan 2019 02:19:53 +1100 Subject: [PATCH 2/2] Change build root folder String to a Path --- protos/build.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/protos/build.rs b/protos/build.rs index d83cb3496..108d9e2dd 100644 --- a/protos/build.rs +++ b/protos/build.rs @@ -1,8 +1,10 @@ extern crate protoc_grpcio; +use std::path::Path; + fn main() { - let proto_root = &format!("{}{}", "src", std::path::MAIN_SEPARATOR); - println!("cargo:rerun-if-changed={}", proto_root); + let proto_root = Path::new("src"); + println!("cargo:rerun-if-changed={}", proto_root.display()); protoc_grpcio::compile_grpc_protos(&["services.proto"], &[proto_root], &proto_root) .expect("Failed to compile gRPC definitions!"); }