]> code.ossystems Code Review - openembedded-core.git/commit
reproducible_build.bbclass: support for binary reproducibility
authorJuro Bystricky <juro.bystricky@intel.com>
Tue, 20 Mar 2018 22:34:19 +0000 (15:34 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 25 Mar 2018 08:33:37 +0000 (09:33 +0100)
commitcc438ac7711dedbe05d654e99af9316c9215b02e
tree87495248dea2c50421479d406a2162880eaf7021
parent7409d2d48b69adcdf039fb4aa8bd9ed62460daa9
reproducible_build.bbclass: support for binary reproducibility

Setup environment for builds requiring binary reproducibility.
Determine and export SOURCE_DATE_EPOCH per each recipe.
This is a crucial step to achieve binary reproducibility.
The value for this variable (timestamp) is obtained after source code for
a recipe has been unpacked, but before it is patched. If the code sources
come from a GIT repo, we get the timestamp from the top commit. (GIT repo
does not preserve file mktime timestamps). Otherwise, if GIT repo is not
present, we try to get mtime from known files such as NEWS, ChangeLog, etc.
If this also fails, we go through all files and get the timestamp from the
youngest one. We create an individual timestamp for each recipe.
The timestamp is stored in the file '__source_date_epoch.txt' (in the folder
source-date-epoch_). Later on, each task reads this file and sets
the exported value of SOURCE_DATE_EPOCH to the value found in the file.

Uasge:

INHERIT += "reproducible_build"

[YOCTO#11178]
[YOCTO#11179]

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/reproducible_build.bbclass [new file with mode: 0644]