diff --git a/.gitignore b/.gitignore index 0bd4b23d..a2771d3c 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ node_modules **/libs/AppFlowy-Collab/ data/ .env -.logs \ No newline at end of file +.logs +shell.nix diff --git a/libs/realtime-entity/build.rs b/libs/realtime-entity/build.rs index 4b11e89e..d78928fb 100644 --- a/libs/realtime-entity/build.rs +++ b/libs/realtime-entity/build.rs @@ -1,11 +1,14 @@ use std::process::Command; fn main() -> Result<(), Box> { - let protoc_path = protoc_bin_vendored::protoc_bin_path().expect("protoc bin path"); - let protoc_path_str = protoc_path.to_str().expect("protoc path to str"); + // If the `PROTOC` environment variable is set, don't use vendored `protoc` + std::env::var("PROTOC").map(|_| ()).unwrap_or_else(|_| { + let protoc_path = protoc_bin_vendored::protoc_bin_path().expect("protoc bin path"); + let protoc_path_str = protoc_path.to_str().expect("protoc path to str"); - // Set the `PROTOC` environment variable to the path of the `protoc` binary. - std::env::set_var("PROTOC", protoc_path_str); + // Set the `PROTOC` environment variable to the path of the `protoc` binary. + std::env::set_var("PROTOC", protoc_path_str); + }); prost_build::Config::new() .out_dir("src/")