Skip to contentSkip to conversation

image.bbclass: delete DATE variable too

PATCH In review Stefan Agner 2 participants 4 messages Aug 11, 2017 – Aug 29, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 image.bbclass: delete DATE variable too

From: Stefan Agner <[email protected]>

When creating a custom image which uses the DATE variable the basehash
seems to change every day and lead to errors such as:
ERROR: console-tdx-image-2.7.6-r0 do_image_customimg: Error executing a python function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>

     0001:

*** 0002:set_image_size(d)
...

Add DATE to the variables which should not get expanded early and to the vardepsexclude list for the image task.

---
I am not that deep in OE usually and I am not sure if I miss something completely here... It seems to solve the issue for us though. Does that change sounds reasonable? Could it be done in the custom image class file?

 meta/classes/image.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/image.bbclass +2 -1
index 2c1dc81..7949b46 100644
@@ -437,6 +437,7 @@ python () {
         # date/time values. It will get expanded at execution time.
         # Similarly TMPDIR since otherwise we see QA stamp comparision problems
         localdata.delVar('DATETIME')
+        localdata.delVar('DATE')
         localdata.delVar('TMPDIR')
 
         image_cmd = localdata.getVar("IMAGE_CMD")
@@ -501,7 +502,7 @@ python () {
         d.prependVarFlag(task, 'postfuncs', ' create_symlinks')
         d.appendVarFlag(task, 'subimages', ' ' + ' '.join(subimages))
         d.appendVarFlag(task, 'vardeps', ' ' + ' '.join(vardeps))
-        d.appendVarFlag(task, 'vardepsexclude', 'DATETIME')
+        d.appendVarFlag(task, 'vardepsexclude', 'DATETIME DATE')
 
         bb.debug(2, "Adding task %s before %s, after %s" % (task, 'do_image_complete', after))
         bb.build.addtask(task, 'do_image_complete', after, d)
Signature · 1 line
2.7.4
#1 lore raw

On 2017-08-29 02:54, Stefan Agner wrote:

I am sorry, I didn't meant to spoof the date. I had to play with dates on said system to reproduce the issue.

--
Stefan

Quoted 47 lines

From: Stefan Agner <[email protected]>

When creating a custom image which uses the DATE variable the basehash seems to change every day and lead to errors such as:
ERROR: console-tdx-image-2.7.6-r0 do_image_customimg: Error executing a python function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>

     0001:

*** 0002:set_image_size(d)
...

Add DATE to the variables which should not get expanded early and to the vardepsexclude list for the image task.

---
I am not that deep in OE usually and I am not sure if I miss something completely here... It seems to solve the issue for us though. Does that change sounds reasonable? Could it be done in the custom image class file?

 meta/classes/image.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/image.bbclass +2 -1
index 2c1dc81..7949b46 100644
@@ -437,6 +437,7 @@ python () {
         # date/time values. It will get expanded at execution time.
         # Similarly TMPDIR since otherwise we see QA stamp comparision problems
         localdata.delVar('DATETIME')
+        localdata.delVar('DATE')
         localdata.delVar('TMPDIR')
 
         image_cmd = localdata.getVar("IMAGE_CMD")
@@ -501,7 +502,7 @@ python () {
         d.prependVarFlag(task, 'postfuncs', ' create_symlinks')
         d.appendVarFlag(task, 'subimages', ' ' + ' '.join(subimages))
         d.appendVarFlag(task, 'vardeps', ' ' + ' '.join(vardeps))
-        d.appendVarFlag(task, 'vardepsexclude', 'DATETIME')
+        d.appendVarFlag(task, 'vardepsexclude', 'DATETIME DATE')
 
         bb.debug(2, "Adding task %s before %s, after %s" % (task,
 'do_image_complete', after))

bb.build.addtask(task, 'do_image_complete', after, d)

#2 lore raw
In reply to Stefan Agner
Quoted 7 lines · Stefan Agner

From: Stefan Agner <[email protected]>

When creating a custom image which uses the DATE variable the basehash seems to change every day and lead to errors such as:
ERROR: console-tdx-image-2.7.6-r0 do_image_customimg: Error executing a python function in exec_python_func() autogenerated:

Quoted 8 lines

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>

     0001:

*** 0002:set_image_size(d)
...

Add DATE to the variables which should not get expanded early and to the vardepsexclude list for the image task.

Armin, this has been applied to master in between.

Is there a chance to get that also into pyro and morty?

--
Stefan

Quoted 32 lines

---
I am not that deep in OE usually and I am not sure if I miss something completely here... It seems to solve the issue for us though. Does that change sounds reasonable? Could it be done in the custom image class file?

 meta/classes/image.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/image.bbclass +2 -1
index 2c1dc81..7949b46 100644
@@ -437,6 +437,7 @@ python () {
         # date/time values. It will get expanded at execution time.
         # Similarly TMPDIR since otherwise we see QA stamp comparision problems
         localdata.delVar('DATETIME')
+        localdata.delVar('DATE')
         localdata.delVar('TMPDIR')
 
         image_cmd = localdata.getVar("IMAGE_CMD")
@@ -501,7 +502,7 @@ python () {
         d.prependVarFlag(task, 'postfuncs', ' create_symlinks')
         d.appendVarFlag(task, 'subimages', ' ' + ' '.join(subimages))
         d.appendVarFlag(task, 'vardeps', ' ' + ' '.join(vardeps))
-        d.appendVarFlag(task, 'vardepsexclude', 'DATETIME')
+        d.appendVarFlag(task, 'vardepsexclude', 'DATETIME DATE')
 
         bb.debug(2, "Adding task %s before %s, after %s" % (task,
 'do_image_complete', after))

bb.build.addtask(task, 'do_image_complete', after, d)

#3 lore raw
Quoted 19 lines · Stefan Agner
Quoted 18 lines · Stefan Agner

From: Stefan Agner <[email protected]>

When creating a custom image which uses the DATE variable the basehash
seems to change every day and lead to errors such as:
ERROR: console-tdx-image-2.7.6-r0 do_image_customimg: Error executing
a python function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function:
<module>
     0001:
 *** 0002:set_image_size(d)
...

Quoted 6 lines
Quoted 3 lines

Add DATE to the variables which should not get expanded early and to the
vardepsexclude list for the image task.

Armin, this has been applied to master in between.

Is there a chance to get that also into pyro and morty?

Possibly but the patch doesn't cleanly apply there so you'd need to send pyro and morty versions of it.

Cheers,

Richard