From 865fd059564c203ae20ae0f9343f1e7f3fe1b200 Mon Sep 17 00:00:00 2001 From: lklimek <842586+lklimek@users.noreply.github.com> Date: Thu, 14 Dec 2023 14:04:57 +0100 Subject: [PATCH] feat: use TENDERDASH_COMMITISH env var to set tenderdash rev to use (#44) * fix: use TENDERDASH_COMMITISH env var if set * chore: fix nightly build issues --- proto/build.rs | 9 ++++++++- proto/src/prelude.rs | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/proto/build.rs b/proto/build.rs index dd0eb6f1..41c909c0 100644 --- a/proto/build.rs +++ b/proto/build.rs @@ -3,10 +3,17 @@ use std::env; fn main() { let version = env!("CARGO_PKG_VERSION"); - env::set_var("TENDERDASH_COMMITISH", "v".to_owned() + version); + // check if TENDERDASH_COMMITISH is alrady set; if not, set it to the current + // version + let commitish = env::var("TENDERDASH_COMMITISH").unwrap_or_default(); + if commitish.is_empty() { + env::set_var("TENDERDASH_COMMITISH", "v".to_owned() + version); + } + tenderdash_proto_compiler::proto_compile(); println!("cargo:rerun-if-changed=../proto-compiler/src"); println!("cargo:rerun-if-changed=Cargo.toml"); println!("cargo:rerun-if-env-changed=CARGO_PKG_VERSION"); + println!("cargo:rerun-if-env-changed=TENDERDASH_COMMITISH"); } diff --git a/proto/src/prelude.rs b/proto/src/prelude.rs index aa9a20b6..74cb1a7f 100644 --- a/proto/src/prelude.rs +++ b/proto/src/prelude.rs @@ -1,5 +1,6 @@ // Re-export according to alloc::prelude::v1 because it is not yet stabilized // https://doc.rust-lang.org/src/alloc/prelude/v1.rs.html +#[allow(unused_imports)] pub use alloc::{ borrow::ToOwned, boxed::Box,