Skip to content

Commit

Permalink
Make builds of esp_app_desc reproducible
Browse files Browse the repository at this point in the history
Zero out time and date fields of `esp_app_desc_t` when
`esp_idf_app_reproducible_build` is set
  • Loading branch information
irriden committed Nov 9, 2023
1 parent 57947ce commit 429fb72
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app_desc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ macro_rules! esp_app_desc {
reserv1: [0; 2],
version: str_to_cstr_array(env!("CARGO_PKG_VERSION")),
project_name: str_to_cstr_array(env!("CARGO_PKG_NAME")),
#[cfg(esp_idf_app_reproducible_build)]
time: [0i8; 16],
#[cfg(not(esp_idf_app_reproducible_build))]
time: str_to_cstr_array($crate::build_time::build_time_utc!("%Y-%m-%d")),
#[cfg(esp_idf_app_reproducible_build)]
date: [0i8; 16],
#[cfg(not(esp_idf_app_reproducible_build))]
date: str_to_cstr_array($crate::build_time::build_time_utc!("%H:%M:%S")),
idf_ver: str_to_cstr_array($crate::const_format::formatcp!(
"{}.{}.{}",
Expand Down

0 comments on commit 429fb72

Please sign in to comment.