Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Allow to override build date with SOURCE_DATE_EPOCH #340

Merged
merged 1 commit into from Aug 9, 2019

Conversation

bmwiedemann
Copy link
Contributor

@bmwiedemann bmwiedemann commented Aug 8, 2019

Allow to override build date with SOURCE_DATE_EPOCH
in order 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.

Also use UTC to be independent of timezone.

Note: This date call only works with GNU date.

Without this patch, kata-containers-initrd.img contained a varying var/lib/osbuilder/osbuilder.yaml with

 osbuilder:
   url: "https://github.com/kata-containers/osbuilder"
   version: "1.9.0-alpha0"
-rootfs-creation-time: "2019-08-06T18:40:27.402493939+0000Z"
+rootfs-creation-time: "2034-09-08T07:57:34.386990704+0000Z"

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

@grahamwhaley
Copy link
Contributor

OOh, reproducible... I know @jodh-intel has mentioned that for builds since, well, forever! ;-)
requested a few reviewers.... thx @bmwiedemann !
Ah, I note your PR and commit will need some tweaking to meet our CI requirements (for instance, will need a sign off and also a Fixes line) - see https://github.com/kata-containers/community/blob/master/CONTRIBUTING.md#patch-format for more details..

bmwiedemann added a commit to bmwiedemann/osbuilder that referenced this pull request Aug 8, 2019
Allow to override build date with SOURCE_DATE_EPOCH
in order 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.

Also use UTC to be independent of timezone.

This date call only works with GNU date.

Without this patch, kata-containers-initrd.img contained
varying var/lib/osbuilder/osbuilder.yaml with
   version: "1.9.0-alpha0"
   -rootfs-creation-time: "2019-08-06T18:40:27.402493939+0000Z"
   +rootfs-creation-time: "2034-09-08T07:57:34.386990704+0000Z"

Fixes kata-containers#340

Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
scripts/lib.sh Outdated Show resolved Hide resolved
Allow to override build date with SOURCE_DATE_EPOCH
in order 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.

Also use UTC to be independent of timezone.

This date call only works with GNU date.

Without this patch, kata-containers-initrd.img contained
varying var/lib/osbuilder/osbuilder.yaml with
   version: "1.9.0-alpha0"
   -rootfs-creation-time: "2019-08-06T18:40:27.402493939+0000Z"
   +rootfs-creation-time: "2034-09-08T07:57:34.386990704+0000Z"

Fixes kata-containers#340

Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
@GabyCT
Copy link
Contributor

GabyCT commented Aug 8, 2019

/test

@devimc devimc mentioned this pull request Aug 9, 2019
@devimc devimc merged commit 7412b98 into kata-containers:master Aug 9, 2019
@bmwiedemann bmwiedemann deleted the date branch July 6, 2020 03:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants