feat: compile time optimization (#775)

This commit is contained in:
Nishant Joshi
2023-03-21 15:12:44 +05:30
committed by GitHub
parent 575abd6f5e
commit 5b5557b71d
10 changed files with 28 additions and 8 deletions

View File

@ -21,6 +21,7 @@ production = []
kv_store = []
accounts_cache = []
openapi = ["olap", "oltp"]
vergen = [ "router_env/vergen" ]
[dependencies]
@ -39,7 +40,7 @@ bytes = "1.4.0"
clap = { version = "4.1.8", default-features = false, features = ["std", "derive", "help", "usage"] }
config = { version = "0.13.3", features = ["toml"] }
crc32fast = "1.3.2"
diesel = { version = "2.0.3", features = ["postgres", "serde_json", "time", "64-column-tables"] }
diesel = { version = "2.0.3", features = ["postgres"] }
dyn-clone = "1.0.11"
encoding_rs = "0.8.32"
error-stack = "0.3.1"
@ -89,7 +90,7 @@ router_env = { version = "0.1.0", path = "../router_env", features = ["log_extra
storage_models = { version = "0.1.0", path = "../storage_models", features = ["kv_store"] }
[build-dependencies]
router_env = { version = "0.1.0", path = "../router_env", default-features = false, features = ["vergen"] }
router_env = { version = "0.1.0", path = "../router_env", default-features = false }
[dev-dependencies]
actix-http = "3.3.1"

View File

@ -4,5 +4,6 @@ fn main() {
#[cfg(debug_assertions)]
println!("cargo:rustc-env=RUST_MIN_STACK=4194304"); // 4 * 1024 * 1024 = 4 MiB
#[cfg(feature = "vergen")]
router_env::vergen::generate_cargo_instructions();
}

View File

@ -16,7 +16,7 @@ use crate::{
};
#[derive(clap::Parser, Default)]
#[command(version = router_env::version!())]
#[cfg_attr(feature = "vergen", command(version = router_env::version!()))]
pub struct CmdLineConf {
/// Config file.
/// Application will look for "config/config.toml" if this option isn't specified.