From af64c65d94ef233053be8616e4c92f571fb5aae0 Mon Sep 17 00:00:00 2001 From: lklimek <842586+lklimek@users.noreply.github.com> Date: Fri, 15 Mar 2024 17:29:40 +0100 Subject: [PATCH] fix(proto-compiler): existence of unzipped tenderdash sources not verified correctly (#56) * fix(proto-compiler): better detection of missing protobuf files * build: release 0.14.0-dev.9 --- abci/Cargo.toml | 2 +- proto-compiler/Cargo.toml | 2 +- proto-compiler/src/functions.rs | 5 +---- proto-compiler/src/lib.rs | 3 ++- proto/Cargo.toml | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/abci/Cargo.toml b/abci/Cargo.toml index b74b6ef..43fc89e 100644 --- a/abci/Cargo.toml +++ b/abci/Cargo.toml @@ -1,5 +1,5 @@ [package] -version = "0.14.0-dev.8" +version = "0.14.0-dev.9" name = "tenderdash-abci" edition = "2021" license = "Apache-2.0" diff --git a/proto-compiler/Cargo.toml b/proto-compiler/Cargo.toml index 687f876..9dd520e 100644 --- a/proto-compiler/Cargo.toml +++ b/proto-compiler/Cargo.toml @@ -1,5 +1,5 @@ [package] -version = "0.14.0-dev.8" +version = "0.14.0-dev.9" name = "tenderdash-proto-compiler" authors = ["Informal Systems ", "Dash Core Group"] edition = "2021" diff --git a/proto-compiler/src/functions.rs b/proto-compiler/src/functions.rs index ec333a3..33b6a56 100644 --- a/proto-compiler/src/functions.rs +++ b/proto-compiler/src/functions.rs @@ -350,10 +350,7 @@ pub(crate) fn check_state(dir: &Path, commitish: &str) -> bool { match read_to_string(state_file) { Ok(content) => { - println!( - "[info] => Found previously downloaded Tenderdash {}.", - content.trim() - ); + println!("[info] => Detected Tenderdash version: {}.", content.trim()); content.eq(commitish) }, Err(_) => false, diff --git a/proto-compiler/src/lib.rs b/proto-compiler/src/lib.rs index c308da2..483ec25 100644 --- a/proto-compiler/src/lib.rs +++ b/proto-compiler/src/lib.rs @@ -51,7 +51,8 @@ pub fn proto_compile() { let commitish = tenderdash_commitish(); // check if this commitish is already downloaded - let download = !check_state(&prost_out_dir, &commitish); + let download = std::fs::metadata(tenderdash_dir.join("proto")).is_err() + || !check_state(&prost_out_dir, &commitish); if download { println!("[info] => Fetching {TENDERDASH_REPO} at {commitish} into {tenderdash_dir:?}."); diff --git a/proto/Cargo.toml b/proto/Cargo.toml index 7d07991..c4d30e4 100644 --- a/proto/Cargo.toml +++ b/proto/Cargo.toml @@ -1,5 +1,5 @@ [package] -version = "0.14.0-dev.8" +version = "0.14.0-dev.9" name = "tenderdash-proto" edition = "2021" license = "Apache-2.0"