diff --git a/Cargo.lock b/Cargo.lock index 38aa384c0..1c9ba40c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1185,9 +1185,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.106" +version = "0.2.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a60553f9a9e039a333b4e9b20573b9e9b9c0bb3a11e201ccc48ef4283456d673" +checksum = "eef78b64d87775463c549fbd80e19249ef436ea3bf1de2a1eb7e717ec7fab1e9" [[package]] name = "libloading" @@ -1266,7 +1266,6 @@ dependencies = [ "num-derive", "num-traits", "utralib", - "vergen", "xous", "xous-ipc", ] @@ -2570,12 +2569,13 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "vergen" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ce50d8996df1f85af15f2cd8d33daae6e479575123ef4314a51a70a230739cb" +checksum = "e7141e445af09c8919f1d5f8a20dae0b20c3b57a45dee0d5823c6ed5d237f15a" dependencies = [ "bitflags", "chrono", + "rustc_version 0.4.0", ] [[package]] @@ -2929,6 +2929,7 @@ dependencies = [ "curl", "filetime", "rustc_version 0.4.0", + "vergen", "zip", ] diff --git a/services/log-server/Cargo.toml b/services/log-server/Cargo.toml index 5bf44653d..4b9a74387 100644 --- a/services/log-server/Cargo.toml +++ b/services/log-server/Cargo.toml @@ -13,8 +13,8 @@ num-traits = {version = "0.2.14", default-features = false} xous = {path = "../../xous-rs"} xous-ipc = {path = "../../xous-ipc"} -[build-dependencies] -vergen = "3" +#[build-dependencies] +#vergen = "3" [target.'cfg(not(any(windows,unix)))'.dependencies] utralib = {path = "../../utralib"} diff --git a/services/log-server/build.rs b/services/log-server/build.rs index de9132b19..fcddadf2d 100644 --- a/services/log-server/build.rs +++ b/services/log-server/build.rs @@ -1,8 +1,8 @@ // NOTE: Adapted from cortex-m/build.rs use std::env; -extern crate vergen; -use vergen::{generate_cargo_keys, ConstantsFlags}; +//extern crate vergen; +//use vergen::{generate_cargo_keys, ConstantsFlags}; fn main() { let target = env::var("TARGET").unwrap(); @@ -16,10 +16,11 @@ fn main() { println!("cargo:rustc-cfg=baremetal"); } - generate_cargo_keys( - ConstantsFlags::SHA, /*| ConstantsFlags::BUILD_TIMESTAMP*/ - ) - .unwrap(); + //generate_cargo_keys( + // ConstantsFlags::SHA, /*| ConstantsFlags::BUILD_TIMESTAMP*/ + //) + //.unwrap(); + // BUILD_TIMESTAMP doesn't work -- it doesn't update because of the below line // removing the below line causes a lengthy full-rebuild just to capture a timestamp. // so, we're removing the timestamp. diff --git a/services/log-server/src/main.rs b/services/log-server/src/main.rs index e5e8678ee..31b3a6f4c 100644 --- a/services/log-server/src/main.rs +++ b/services/log-server/src/main.rs @@ -379,19 +379,17 @@ fn reader_thread(arg: usize) { env!("VERGEN_SHA") ) .unwrap(); - // time stamp isn't actually the time stamp of the build, unfortunately. It's the time stamp of the - // last time you managed to force a rebuild that also causes log-server to be rebuilt, not necessarily - // capturing the build time of the very most recent change! - // writeln!(output, "LOG: *** Built: {:49} ***", env!("VERGEN_BUILD_TIMESTAMP")).unwrap(); + writeln!(output, "LOG: *** Built: {:49} ***", env!("VERGEN_BUILD_TIMESTAMP")).unwrap(); + writeln!(output, "LOG: *** Semver: {:48} ***", env!("VERGEN_SEMVER")).unwrap(); writeln!( output, "LOG: ****************************************************************" ) .unwrap(); - println!("LOG: my PID is {}", xous::process::id()); let server_addr = xous::create_server_with_address(b"xous-log-server ").unwrap(); writeln!(output, "LOG: Server listening on address {:?}", server_addr).unwrap(); + println!("LOG: my PID is {}", xous::process::id()); let mut counter: usize = 0; loop { if counter.trailing_zeros() >= 12 { diff --git a/services/shellchat/src/cmds/ver.rs b/services/shellchat/src/cmds/ver.rs index 723b135ad..71e7d7fed 100644 --- a/services/shellchat/src/cmds/ver.rs +++ b/services/shellchat/src/cmds/ver.rs @@ -11,7 +11,7 @@ impl<'a> ShellCmdApi<'a> for Ver { fn process(&mut self, args: String::<1024>, env: &mut CommonEnv) -> Result>, xous::Error> { use core::fmt::Write; let mut ret = String::<1024>::new(); - let helpstring = "ver options: ec, wf200, soc, dna"; + let helpstring = "ver options: ec, wf200, soc, dna, xous"; let mut tokens = args.as_str().unwrap().split(' '); @@ -36,6 +36,13 @@ impl<'a> ShellCmdApi<'a> for Ver { "dna" => { write!(ret, "SoC silicon DNA: 0x{:x}", env.llio.soc_dna().unwrap()).unwrap(); } + "xous" => { + write!(ret, "{}\n{}\n{}\n{}", + env!("VERGEN_SEMVER"), + env!("VERGEN_BRANCH"), + env!("VERGEN_SHA_SHORT"), + env!("VERGEN_BUILD_TIMESTAMP")).unwrap(); + } _ => { write!(ret, "{}", helpstring).unwrap(); } diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 5b22f43ce..b11b2c3a1 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -11,4 +11,7 @@ curl = "0.4.35" atty = "0.2.14" filetime = "0.2.14" rustc_version = "0.4.0" -zip = "0.5.13" \ No newline at end of file +zip = "0.5.13" + +[build-dependencies] +vergen = "3.2.0" diff --git a/xtask/build.rs b/xtask/build.rs new file mode 100644 index 000000000..d710952e8 --- /dev/null +++ b/xtask/build.rs @@ -0,0 +1,10 @@ +use vergen::{ConstantsFlags, generate_cargo_keys}; + +fn main() { + // Setup the flags, toggling off the 'SEMVER_FROM_CARGO_PKG' flag + let mut flags = ConstantsFlags::all(); + flags.toggle(ConstantsFlags::SEMVER_FROM_CARGO_PKG); + + // Generate the 'cargo:' key output + generate_cargo_keys(flags).expect("Unable to generate the cargo keys!"); +}