diff --git a/services/xous-ticktimer/Cargo.toml b/services/xous-ticktimer/Cargo.toml index c377c42af..db118e518 100644 --- a/services/xous-ticktimer/Cargo.toml +++ b/services/xous-ticktimer/Cargo.toml @@ -21,9 +21,10 @@ rkyv = {version = "0.4.3", default-features = false, features = ["const_generics num-derive = {version = "0.3.3", default-features = false} num-traits = {version = "0.2.14", default-features = false} xous-semver = "0.1.2" - utralib = {version = "0.1.3", optional = true, default-features = false } +[build-dependencies] +chrono = "0.4" [features] precursor = ["utralib/precursor", "xous/precursor", "susres/precursor"] @@ -31,7 +32,7 @@ hosted = ["utralib/hosted", "susres/hosted"] renode = ["utralib/renode", "xous/renode", "susres/renode"] debug-print = [] watchdog = [] -no-timestamp = [] # turns off embedded timestamp for reproducible builds +timestamp = [] # you may want to remove the watchdog feature if you're debugging a crash, as it will force the system to reboot automatically default = ["watchdog"] # default = [] diff --git a/services/xous-ticktimer/src/main.rs b/services/xous-ticktimer/src/main.rs index ce24b8f54..d530c6429 100644 --- a/services/xous-ticktimer/src/main.rs +++ b/services/xous-ticktimer/src/main.rs @@ -3,6 +3,7 @@ #![cfg_attr(target_os = "none", no_main)] use xous_api_ticktimer::*; +#[cfg(feature="timestamp")] mod version; use std::collections::{BTreeMap, HashMap, HashSet, VecDeque}; @@ -523,11 +524,20 @@ fn main() -> ! { log::set_max_level(log::LevelFilter::Info); info!("my PID is {}", xous::process::id()); - log::info!("****************************************************************"); - log::info!("Welcome to Xous {}", version::SEMVER); - #[cfg(not(feature = "no-timestamp"))] - log::info!("Built on {}", version::TIMESTAMP); - log::info!("****************************************************************"); + #[cfg(feature="timestamp")] + { + log::info!("****************************************************************"); + log::info!("Welcome to Xous {}", version::SEMVER); + log::info!("Built on {}", version::TIMESTAMP); + log::info!("****************************************************************"); + } + #[cfg(not(feature="timestamp"))] + { + log::info!("****************************************************************"); + log::info!("Welcome to Xous"); + log::info!("Reproducible build without timestamps"); + log::info!("****************************************************************"); + } let ticktimer_server = xous::create_server_with_address(b"ticktimer-server") .expect("Couldn't create Ticktimer server"); @@ -673,7 +683,15 @@ fn main() -> ! { msg.body.memory_message_mut().unwrap(), ) }; + #[cfg(feature="timestamp")] buf.replace(version::get_version()).unwrap(); + #[cfg(not(feature="timestamp"))] + { + let v = crate::api::VersionString { + version: xous_ipc::String::from_str("--no-timestamp requested for build") + }; + buf.replace(v).unwrap(); + } } Some(api::Opcode::LockMutex) => { let pid = msg.sender.pid();