Add command to show firmware Git hash #167
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "atse/thermostat:show-firmware-ver"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Also shows repo dirty status. Makes debugging firmware easier.
@ -0,0 +13,4 @@
impl FirmwareSummary {
pub const fn get() -> FirmwareSummary {
if let Some(rev) = option_env!("NIX_DRV_DIRTY_REV") {
Is there environment variables in the firmware?And I think it's better to use some different variable/approach, because now it depends on Nix, which may be absent during build process. Consider using git directly or invert the dependency, or combine both - let Nix insert the revision and if absent, default to git info.
Agree. You can add logic to fetch the git info if the NIX_DRV_DIRTY_REV environment variable is not set.
(as nix does not copy the .git folder, you cannot call git cmd in build.rs during nix build stage.)
@ -0,0 +27,4 @@
} else {
FirmwareSummary {
git_hash: Some(rev),
git_dirty: Some(false),
Do we really need to parse this here? Why not just send the string verbatim? What is consuming that string?
@ -16,2 +16,4 @@
// instead of when any part of the source code changes.
println!("cargo:rerun-if-changed=memory.x");
built::write_built_file().expect("Failed to acquire build-time information");
Maybe this shouldn't be a hard error?
Checkout
From your project repository, check out a new branch and test the changes.