summaryrefslogtreecommitdiffstats
path: root/meta
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-29 11:17:20 +0100
commita3109e74a04cd5fd483331e77e57032cc627cec5 (patch)
tree0c490f90128f93d867398a0953d0279c554e1470 /meta
parent7bbd0ec86dfccd7d0b3bf72dfc4951fc27094a82 (diff)
downloadpoky-a3109e74a04cd5fd483331e77e57032cc627cec5.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: 295947ac48a8c14eba8f2bedcfb7b59121a1da5f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit e82095c02881410035ca23dc12692f074d8ed39b) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-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 1ea938fb62..9fe9d36f76 100644
--- a/meta/classes/externalsrc.bbclass
+++ b/meta/classes/externalsrc.bbclass
@@ -109,16 +109,15 @@ python () {
109 if local_srcuri and task in fetch_tasks: 109 if local_srcuri and task in fetch_tasks:
110 continue 110 continue
111 bb.build.deltask(task, d) 111 bb.build.deltask(task, d)
112 112 if bb.data.inherits_class('reproducible_build', d) and task == 'do_unpack':
113 if bb.data.inherits_class('reproducible_build', d) and 'do_unpack' in d.getVar("SRCTREECOVEREDTASKS").split(): 113 # The reproducible_build's create_source_date_epoch_stamp function must
114 # The reproducible_build's create_source_date_epoch_stamp function must 114 # be run after the source is available and before the
115 # be run after the source is available and before the 115 # do_deploy_source_date_epoch task. In the normal case, it's attached
116 # do_deploy_source_date_epoch task. In the normal case, it's attached 116 # to do_unpack as a postfuncs, but since we removed do_unpack (above)
117 # to do_unpack as a postfuncs, but since we removed do_unpack (above) 117 # we need to move the function elsewhere. The easiest thing to do is
118 # we need to move the function elsewhere. The easiest thing to do is 118 # move it into the prefuncs of the do_deploy_source_date_epoch task.
119 # move it into the prefuncs of the do_deploy_source_date_epoch task. 119 # This is safe, as externalsrc runs with the source already unpacked.
120 # This is safe, as externalsrc runs with the source already unpacked. 120 d.prependVarFlag('do_deploy_source_date_epoch', 'prefuncs', 'create_source_date_epoch_stamp ')
121 d.prependVarFlag('do_deploy_source_date_epoch', 'prefuncs', 'create_source_date_epoch_stamp ')
122 121
123 d.prependVarFlag('do_compile', 'prefuncs', "externalsrc_compile_prefunc ") 122 d.prependVarFlag('do_compile', 'prefuncs', "externalsrc_compile_prefunc ")
124 d.prependVarFlag('do_configure', 'prefuncs', "externalsrc_configure_prefunc ") 123 d.prependVarFlag('do_configure', 'prefuncs', "externalsrc_configure_prefunc ")