common build.rs migration bug fixed

This commit is contained in:
Priec
2026-06-10 19:49:41 +02:00
parent 617f18f331
commit 9b6e594d2f

View File

@@ -217,5 +217,29 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
],
&["proto"],
)?;
// Scope build-script reruns to the actual inputs. Without this, the script
// emits no `rerun-if-changed` directives, so Cargo reruns it whenever any
// file in the package changes. Since codegen writes into `src/proto/`, that
// self-write retriggers the script on every build (an infinite loop under
// `cargo watch`). tonic_build 0.13 emitted these automatically; 0.14
// (tonic_prost_build) no longer does.
println!("cargo:rerun-if-changed=build.rs");
for proto in [
"proto/common.proto",
"proto/adresar.proto",
"proto/auth.proto",
"proto/search.proto",
"proto/search2.proto",
"proto/table_definition.proto",
"proto/table_script.proto",
"proto/table_structure.proto",
"proto/table_validation.proto",
"proto/tables_data.proto",
"proto/uctovnictvo.proto",
] {
println!("cargo:rerun-if-changed={proto}");
}
Ok(())
}