Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to override build date with SOURCE_DATE_EPOCH #702

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bmwiedemann
Copy link

Allow to override build date with SOURCE_DATE_EPOCH to make builds reproducible.

See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/ for the definition of this variable.

This date call works with different variants of date (GNU, FreeBSD, ...).

Also use UTC to be independent of timezone.

This patch was done while working on reproducible builds for openSUSE.

@bmwiedemann bmwiedemann marked this pull request as draft April 23, 2024 18:23
@bmwiedemann bmwiedemann marked this pull request as ready for review April 23, 2024 18:26
@rtmclay
Copy link
Member

rtmclay commented Apr 24, 2024

Thanks for this PR. I am happy to let the build date for Lmod to be set to UTC when the variable SOURCE_DATE_EPOCH defined. Otherwise, I prefer that the build time remain the way it has been.

I have updated the testing branch to have a new proj_mgmt/DATE_cmd.sh. Please try the testing branch to see if it works for you.

@bmwiedemann
Copy link
Author

bmwiedemann commented Apr 24, 2024

I tested that your version (commit 2077924) builds reproducibly.

The line 2077924#diff-2c6b6228189aa8847f547868c4dcd1795539aca42b27032544b3f00f1a35b74cR18 I don't understand.

If it makes the code simpler / more maintainable we can also omit the UTC (-u) part completely, then callers will just have to ensure a normalized timezone env. We already do that in openSUSE.

Edit: I pushed this change to the PR now.

to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.

This date call works with different variants of date (GNU, FreeBSD, ...).

This patch was done while working on reproducible builds for openSUSE.
@rtmclay
Copy link
Member

rtmclay commented Apr 25, 2024

The line you asked about just removes "%:z" and replaces it with "%Z". This means that the date-time has UTC and not +00:00.

I am ready to close this PR

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.

None yet

2 participants