mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-21 09:26:29 +08:00
firmware: fix embedding of software version during build.
This commit is contained in:
parent
31e5f9a810
commit
b7f6bfffeb
@ -2,7 +2,7 @@ extern crate walkdir;
|
||||
|
||||
use std::env;
|
||||
use std::fs::File;
|
||||
use std::io::{BufRead, BufReader};
|
||||
use std::io::{Write, BufRead, BufReader};
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
|
||||
@ -27,6 +27,12 @@ pub fn git_describe() {
|
||||
.unwrap();
|
||||
let id = id.split("-").collect::<Vec<_>>();
|
||||
let id = format!("{}+{}.{}", id[0], id[1], id[2]);
|
||||
|
||||
let out_dir = env::var("OUT_DIR").unwrap();
|
||||
let dest_path = Path::new(&out_dir).join("git-describe");
|
||||
let mut f = File::create(&dest_path).unwrap();
|
||||
f.write(id.as_bytes()).unwrap();
|
||||
|
||||
println!("cargo:rust-cfg=git_describe={:?}", id);
|
||||
|
||||
println!("cargo:rerun-if-changed=../../../.git/HEAD");
|
||||
|
@ -60,7 +60,7 @@ mod analyzer;
|
||||
fn startup() {
|
||||
board::clock::init();
|
||||
info!("ARTIQ runtime starting...");
|
||||
info!("software version {}", cfg!(git_describe));
|
||||
info!("software version {}", include_str!(concat!(env!("OUT_DIR"), "/git-describe")));
|
||||
info!("gateware version {}", board::ident(&mut [0; 64]));
|
||||
|
||||
let t = board::clock::get_ms();
|
||||
|
@ -11,7 +11,7 @@ extern crate board;
|
||||
fn startup() {
|
||||
board::clock::init();
|
||||
info!("ARTIQ satellite manager starting...");
|
||||
info!("software version {}", cfg!(git_describe));
|
||||
info!("software version {}", include_str!(concat!(env!("OUT_DIR"), "/git-describe")));
|
||||
info!("gateware version {}", board::ident(&mut [0; 64]));
|
||||
|
||||
loop {}
|
||||
|
Loading…
Reference in New Issue
Block a user