Browse Source

Improve the binary's long version

pull/39/head
Rodolphe Breard 4 years ago
parent
commit
bb47e04558
  1. 1
      acme_common/build.rs
  2. 4
      acmed/src/main.rs
  3. 7
      tacd/build.rs
  4. 10
      tacd/src/main.rs

1
acme_common/build.rs

@ -6,7 +6,6 @@ macro_rules! set_rustc_env_var {
}}; }};
} }
fn main() { fn main() {
if let Ok(_) = env::var("DEP_OPENSSL_VERSION_NUMBER") { if let Ok(_) = env::var("DEP_OPENSSL_VERSION_NUMBER") {
set_rustc_env_var!("ACMED_TLS_LIB_NAME", "OpenSSL"); set_rustc_env_var!("ACMED_TLS_LIB_NAME", "OpenSSL");

4
acmed/src/main.rs

@ -1,6 +1,6 @@
use crate::main_event_loop::MainEventLoop; use crate::main_event_loop::MainEventLoop;
use acme_common::crypto::{ use acme_common::crypto::{
HashFunction, JwsSignatureAlgorithm, KeyType, get_lib_name, get_lib_version
get_lib_name, get_lib_version, HashFunction, JwsSignatureAlgorithm, KeyType,
}; };
use acme_common::logs::{set_log_system, DEFAULT_LOG_LEVEL}; use acme_common::logs::{set_log_system, DEFAULT_LOG_LEVEL};
use acme_common::{clean_pid_file, init_server}; use acme_common::{clean_pid_file, init_server};
@ -49,7 +49,7 @@ pub const MIN_RATE_LIMIT_SLEEP_MILISEC: u64 = 100;
fn main() { fn main() {
let full_version = format!( let full_version = format!(
"{} {}\n\nCompiled with:\n {} {}\n {} {}",
"{} built for {}\n\nCryptographic library:\n - {} {}\nHTTP client library:\n - {} {}",
APP_VERSION, APP_VERSION,
env!("ACMED_TARGET"), env!("ACMED_TARGET"),
get_lib_name(), get_lib_name(),

7
tacd/build.rs

@ -0,0 +1,7 @@
use std::env;
fn main() {
if let Ok(target) = env::var("TARGET") {
println!("cargo:rustc-env=TACD_TARGET={}", target);
};
}

10
tacd/src/main.rs

@ -1,7 +1,7 @@
mod openssl_server; mod openssl_server;
use crate::openssl_server::start as server_start; use crate::openssl_server::start as server_start;
use acme_common::crypto::{HashFunction, KeyType, X509Certificate};
use acme_common::crypto::{get_lib_name, get_lib_version, HashFunction, KeyType, X509Certificate};
use acme_common::error::Error; use acme_common::error::Error;
use acme_common::logs::{set_log_system, DEFAULT_LOG_LEVEL}; use acme_common::logs::{set_log_system, DEFAULT_LOG_LEVEL};
use acme_common::{clean_pid_file, to_idna}; use acme_common::{clean_pid_file, to_idna};
@ -67,11 +67,19 @@ fn init(cnf: &ArgMatches) -> Result<(), Error> {
} }
fn main() { fn main() {
let full_version = format!(
"{} built for {}\n\nCryptographic library:\n - {} {}",
APP_VERSION,
env!("TACD_TARGET"),
get_lib_name(),
get_lib_version(),
);
let default_crt_key_type = DEFAULT_CRT_KEY_TYPE.to_string(); let default_crt_key_type = DEFAULT_CRT_KEY_TYPE.to_string();
let default_crt_digest = DEFAULT_CRT_DIGEST.to_string(); let default_crt_digest = DEFAULT_CRT_DIGEST.to_string();
let default_log_level = DEFAULT_LOG_LEVEL.to_string().to_lowercase(); let default_log_level = DEFAULT_LOG_LEVEL.to_string().to_lowercase();
let matches = App::new(APP_NAME) let matches = App::new(APP_NAME)
.version(APP_VERSION) .version(APP_VERSION)
.long_version(full_version.as_str())
.arg( .arg(
Arg::with_name("listen") Arg::with_name("listen")
.long("listen") .long("listen")

Loading…
Cancel
Save