I have a library called server in a Rust project called first-project. This library is in root of first-project i.e. first-project/server. The library server is a proto folder(first-project/server/proto) and that folder has two proto files: author_api.proto and post_api.proto. Proto post_api imports author_api (import "author_api.proto";). There's a build.rs script in server(first-project/server/build.rs) that has a watcher on this proto directory. The build.rs is as follows: "extern crate glob; extern crate tonic_build; use glob::glob; fn generate_proto() { let proto_paths: Vec<_> = glob("./proto/**/*.proto") .map(|entry| entry).expect("failed creating proto paths") .filter_map(|result| result.ok()) // keep only Ok values .collect(); tonic_build::configure() .build_client(true) .build_server(true) .compile(&proto_paths, &["./proto"]) .expect("failed generating protos") } fn main() { println!("cargo:rerun-if-changed=./proto"); generate_proto(); }". Now I'm noticing a weird thing, whenever I save something, cargo check runs and creates two target directories, one in root of the project and one in root of server library. Both of them are same and both of them contain proto stubs created by tokio_build. And there's error on both of them as well. This is tokio_build generated code: "#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)]" with error "type annotations needed cannot satisfy `_: Default`" and "pub created: ::core::option::Option<::prost_types::Timestamp>," error: "