Patchwork [bitbake-devel,1/1] bitbake: Ensure ${DATE} and ${TIME} are consistent

login
register
mail settings
Submitter Peter Kjellerstedt
Date Sept. 6, 2013, 3:53 p.m.
Message ID <5b5196819a1366c32d470a908d7a9ee484345545.1378482725.git.pkj@axis.com>
Download mbox | patch
Permalink /patch/57573/
State New
Headers show

Comments

Peter Kjellerstedt - Sept. 6, 2013, 3:53 p.m.
Due to the worker split the ${DATE} and ${TIME} variables could end up
with different values for different workers.

E.g., a task like do_rootfs that is run within a fakeroot environment
had a slightly different view of the time than another task that was not
fakerooted which made it impossible to correctly refer to the image
generated by do_rootfs from the other task.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
 bitbake/bin/bitbake-worker | 2 ++
 bitbake/lib/bb/runqueue.py | 2 ++
 2 files changed, 4 insertions(+)

Patch

diff --git a/bitbake/bin/bitbake-worker b/bitbake/bin/bitbake-worker
index 2f21e7c..66b6aab 100755
--- a/bitbake/bin/bitbake-worker
+++ b/bitbake/bin/bitbake-worker
@@ -148,6 +148,8 @@  def fork_off_task(cfg, data, workerdata, fn, task, taskname, appends, quieterror
 
             data.setVar("BB_WORKERCONTEXT", "1")
             data.setVar("BUILDNAME", workerdata["buildname"])
+            data.setVar("DATE", workerdata["date"])
+            data.setVar("TIME", workerdata["time"])
             bb.parse.siggen.set_taskdata(workerdata["hashes"], workerdata["hash_deps"], workerdata["sigchecksums"])
             ret = 0
             try:
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 8d36f28..79e612e 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -853,6 +853,8 @@  class RunQueue:
             "logdefaultdomain" : bb.msg.loggerDefaultDomains,
             "prhost" : self.cooker.prhost,
             "buildname" : self.cfgData.getVar("BUILDNAME", True),
+            "date" : self.cfgData.getVar("DATE", True),
+            "time" : self.cfgData.getVar("TIME", True),
         }
 
         worker.stdin.write("<cookerconfig>" + pickle.dumps(self.cooker.configuration) + "</cookerconfig>")