roll back the build time notice

Turns out the build time only seems to capture the last time
you managed to force a full rebuild (???). Even though cargo
indicates that a rebuild had happened of the main.rs, the environment
variable containing the time is not being updated, because the
build.rs file isn't being run. But! if you force a trigger of
that file, then cargo decides to rebuild *everything* which greatly
increases the build time, which is a drag for development.

So, just remove the build time notice. If it's not going to be
correct, better to not emit it than to be outright misleading...
This commit is contained in:
bunnie 2021-01-13 00:24:12 +08:00
parent f5f04a52bb
commit c848d374c6
3 changed files with 12 additions and 4 deletions

View file

@ -57,7 +57,10 @@ set -- "${POSITIONAL[@]}"
DESTDIR=code/precursors
touch services/log-server/src/main.rs # bump the build time in the log server
# this didn't work. Timestamping is actually kinda broken, because
# you end up capturing just the time that you managed to trigger a
# full rebuild, and not just an incremental rebuild. :-/
#touch services/log-server/src/main.rs # bump the build time in the log server
cargo xtask hw-image ../betrusted-soc/build/software/soc.svd

View file

@ -7,8 +7,6 @@ use vergen::{ConstantsFlags, generate_cargo_keys};
fn main() {
let target = env::var("TARGET").unwrap();
generate_cargo_keys(ConstantsFlags::SHA | ConstantsFlags::BUILD_TIMESTAMP).unwrap();
let target_os = target.split('-').nth(2).unwrap_or("none");
// If we're not running on a desktop-class operating system, emit the "baremetal"
@ -18,5 +16,9 @@ fn main() {
println!("cargo:rustc-cfg=baremetal");
}
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.
println!("cargo:rerun-if-changed=build.rs");
}

View file

@ -228,7 +228,10 @@ fn reader_thread(mut output: implementation::OutputWriter) {
writeln!(output, "LOG: ****************************************************************").unwrap();
writeln!(output, "LOG: *** Welcome to Xous {:40} ***", env!("VERGEN_SHA")).unwrap();
writeln!(output, "LOG: *** Built: {:49} ***", env!("VERGEN_BUILD_TIMESTAMP")).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: ****************************************************************").unwrap();
let server_addr = xous::create_server_with_address(b"xous-log-server ").unwrap();
writeln!(output, "LOG: Server listening on address {:?}", server_addr).unwrap();