From f6772a2894e500025414569212ce82f205c77155 Mon Sep 17 00:00:00 2001 From: Debanjan Basu Date: Wed, 15 May 2024 12:26:58 +1000 Subject: [PATCH] updated to reflect changes if installed capnp versions get changed --- veilid-core/build.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/veilid-core/build.rs b/veilid-core/build.rs index 75eedd40..b2d6ed9f 100644 --- a/veilid-core/build.rs +++ b/veilid-core/build.rs @@ -133,7 +133,13 @@ fn main() { return; } - if is_input_file_outdated("./proto/veilid.capnp", "./proto/veilid_capnp.rs").unwrap() { + // Check if installed capnp version is different from the desired version - force rebuild then + if get_capnp_version_string() != get_desired_capnp_version_string() { + println!("cargo:warning=rebuilding proto/veilid_capnp.rs because desired capnp version is different from the installed version"); + do_capnp_build(); + } + // Check if the hash in the generated file is different from the hash of the input file - force rebuild then (This signifies there's been a change in the input) + else if is_input_file_outdated("./proto/veilid.capnp", "./proto/veilid_capnp.rs").unwrap() { println!("cargo:warning=rebuilding proto/veilid_capnp.rs because it has changed from the last generation of proto/veilid.capnp"); do_capnp_build(); }