Skip to content

efi: Respect SOURCE_DATE_EPOCH for reproducible builds#1093

Merged
cgwalters merged 1 commit intocoreos:mainfrom
Johan-Liebert1:epoch-env
Apr 29, 2026
Merged

efi: Respect SOURCE_DATE_EPOCH for reproducible builds#1093
cgwalters merged 1 commit intocoreos:mainfrom
Johan-Liebert1:epoch-env

Conversation

@Johan-Liebert1
Copy link
Copy Markdown
Member

@Johan-Liebert1 Johan-Liebert1 commented Apr 29, 2026

If SOURCE_DATE_EPOCH env is set, use it for EFI metadata timestamp, else fallback to SystemTime::now()

The BIOS component derives its timestamp from RPM build times so it is already deterministic

Fixes: #1075

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new utility function, get_metadata_timestamp, which provides support for the SOURCE_DATE_EPOCH environment variable to ensure reproducible builds. This function is integrated into src/efi.rs, replacing manual timestamp generation. A review comment correctly identified that from_timestamp_secs is not a valid method in the chrono crate and suggested using from_timestamp instead to fix the potential compilation error.

Comment thread src/util.rs
If SOURCE_DATE_EPOCH env is set, use it for EFI metadata timestamp, else
fallback to SystemTime::now()

The BIOS component derives its timestamp from RPM build times so it is
already deterministic

Fixes: coreos#1075

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
@cgwalters cgwalters merged commit 8c4afff into coreos:main Apr 29, 2026
12 checks passed
@Johan-Liebert1 Johan-Liebert1 mentioned this pull request Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EFI timestamp should respect SOURCE_DATE_EPOCH for reproducible builds

2 participants