diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-03-07 18:03:40 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-03-08 08:21:11 +0000 |
commit | 995f7985f664f161e8e13121294009049f204d5d (patch) | |
tree | 11496af37053e6579b0fd511e4ca8302153bee0c /meta/classes/reproducible_build.bbclass | |
parent | 568fb875bf1041fedd12da7976b7e4ce29fa4958 (diff) | |
download | poky-995f7985f664f161e8e13121294009049f204d5d.tar.gz |
reproducibile_build: Fix SDE file generation when unpack reruns
Currently, if an existing TMPDIR is rebuilt, do_fetch/do_unpack can rerun
but SDE would remain unchanged. This leads to different results compared
to a fresh build. An example change which triggered this is:
http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=cb4e69e6346a9fbeebf83a5d5397cacbd41d48b5
Instead, delete any existing SDE and recalculate if we're reunning.
Also rename and drop the do_ prefix since these are for tasks,
not functions.
(From OE-Core rev: 5d579fc2fe71637fc6e071aa66542befa39ac8bb)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/reproducible_build.bbclass')
-rw-r--r-- | meta/classes/reproducible_build.bbclass | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/meta/classes/reproducible_build.bbclass b/meta/classes/reproducible_build.bbclass index 750eb950f2..8da40f656a 100644 --- a/meta/classes/reproducible_build.bbclass +++ b/meta/classes/reproducible_build.bbclass | |||
@@ -150,11 +150,12 @@ def fixed_source_date_epoch(): | |||
150 | bb.debug(1, "No tarball or git repo found to determine SOURCE_DATE_EPOCH") | 150 | bb.debug(1, "No tarball or git repo found to determine SOURCE_DATE_EPOCH") |
151 | return 0 | 151 | return 0 |
152 | 152 | ||
153 | python do_create_source_date_epoch_stamp() { | 153 | python create_source_date_epoch_stamp() { |
154 | epochfile = d.getVar('SDE_FILE') | 154 | epochfile = d.getVar('SDE_FILE') |
155 | # If it exists we need to regenerate as the sources may have changed | ||
155 | if os.path.isfile(epochfile): | 156 | if os.path.isfile(epochfile): |
156 | bb.debug(1, "Reusing SOURCE_DATE_EPOCH from: %s" % epochfile) | 157 | bb.debug(1, "Deleting existing SOURCE_DATE_EPOCH from: %s" % epochfile) |
157 | return | 158 | os.remove(epochfile) |
158 | 159 | ||
159 | sourcedir = d.getVar('S') | 160 | sourcedir = d.getVar('S') |
160 | source_date_epoch = ( | 161 | source_date_epoch = ( |
@@ -197,5 +198,5 @@ BB_HASHBASE_WHITELIST += "SOURCE_DATE_EPOCH" | |||
197 | 198 | ||
198 | python () { | 199 | python () { |
199 | if d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1': | 200 | if d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1': |
200 | d.appendVarFlag("do_unpack", "postfuncs", " do_create_source_date_epoch_stamp") | 201 | d.appendVarFlag("do_unpack", "postfuncs", " create_source_date_epoch_stamp") |
201 | } | 202 | } |