summaryrefslogtreecommitdiffstats
path: root/meta/classes/externalsrc.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-09-21 11:55:44 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-10-23 23:14:17 +0100
commite007e0f5b91e7ffec386e5ab50d3c5afc1616e3b (patch)
tree7c0e468cab04433a4cd6b878e2961e04a073c7c0 /meta/classes/externalsrc.bbclass
parentf34727509abf938a7d337f335e08b33ed99d9daf (diff)
downloadpoky-e007e0f5b91e7ffec386e5ab50d3c5afc1616e3b.tar.gz
externalsrc: Fix a source date epoch race in reproducible builds
When reproducible builds are enabled and externalsrc is in use, the source date epoch function is added. The conditions on the conditional code removing the unpack task need to match the deltask function, else the source date epoch function can end up running twice and the functions can race with each other causing build failures or corruption. (From OE-Core rev: e30c2be8b9534a8dbec5520b41a00c6dc8aa65a4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit e82095c02881410035ca23dc12692f074d8ed39b) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/externalsrc.bbclass')
-rw-r--r--meta/classes/externalsrc.bbclass19
1 files changed, 9 insertions, 10 deletions
diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass
index e94a5cc2af..0e0a3ae89c 100644
--- a/meta/classes/externalsrc.bbclass
+++ b/meta/classes/externalsrc.bbclass
@@ -108,16 +108,15 @@ python () {
108 if local_srcuri and task in fetch_tasks: 108 if local_srcuri and task in fetch_tasks:
109 continue 109 continue
110 bb.build.deltask(task, d) 110 bb.build.deltask(task, d)
111 111 if bb.data.inherits_class('reproducible_build', d) and task == 'do_unpack':
112 if bb.data.inherits_class('reproducible_build', d) and 'do_unpack' in d.getVar("SRCTREECOVEREDTASKS").split(): 112 # The reproducible_build's create_source_date_epoch_stamp function must
113 # The reproducible_build's create_source_date_epoch_stamp function must 113 # be run after the source is available and before the
114 # be run after the source is available and before the 114 # do_deploy_source_date_epoch task. In the normal case, it's attached
115 # do_deploy_source_date_epoch task. In the normal case, it's attached 115 # to do_unpack as a postfuncs, but since we removed do_unpack (above)
116 # to do_unpack as a postfuncs, but since we removed do_unpack (above) 116 # we need to move the function elsewhere. The easiest thing to do is
117 # we need to move the function elsewhere. The easiest thing to do is 117 # move it into the prefuncs of the do_deploy_source_date_epoch task.
118 # move it into the prefuncs of the do_deploy_source_date_epoch task. 118 # This is safe, as externalsrc runs with the source already unpacked.
119 # This is safe, as externalsrc runs with the source already unpacked. 119 d.prependVarFlag('do_deploy_source_date_epoch', 'prefuncs', 'create_source_date_epoch_stamp ')
120 d.prependVarFlag('do_deploy_source_date_epoch', 'prefuncs', 'create_source_date_epoch_stamp ')
121 120
122 d.prependVarFlag('do_compile', 'prefuncs', "externalsrc_compile_prefunc ") 121 d.prependVarFlag('do_compile', 'prefuncs', "externalsrc_compile_prefunc ")
123 d.prependVarFlag('do_configure', 'prefuncs', "externalsrc_configure_prefunc ") 122 d.prependVarFlag('do_configure', 'prefuncs', "externalsrc_configure_prefunc ")