Skip to contentSkip to conversation

image_types.bbclass: rebuild .wks file when .wks.in changes

PATCH Superseded Patrick Ohly 1 participant 2 messages Jan 25, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 image_types.bbclass: rebuild .wks file when .wks.in changes

WKS_FILE(S) can refer to .wks.in files which get expanded during the build by do_write_wks_template. The actual content of the .wks.in file gets added to the recipe meta data during parsing, and thus we need to ensure that the recipe gets re-parsed when the file changes.

This fixes two related problems:
- editing the .wks.in file and rebuilding an image did not recreate
the image unless something else changed or "bitbake -c clean" was
used explicitly
- when forcing a rebuild, the cached meta data and the actual one
do not match, leading to "ERROR: Taskhash mismatch ... for ....bb.do_write_wks_template"

---
 meta/classes/image_types.bbclass | 4 ++++
 1 file changed, 4 insertions(+)
meta/classes/image_types.bbclass +4 -0
index 5b1746a68ce..9bc1996cdb0 100644
@@ -265,6 +265,10 @@ python () {
             d.setVar('WKS_TEMPLATE_PATH', wks_file_u)
             d.setVar('WKS_FILE_CHECKSUM', '${WKS_TEMPLATE_PATH}:True')
 
+            # We need to re-parse each time the file changes, and bitbake
+            # needs to be told about that explicitly.
+            # bb.parse.mark_dependency(d, wks_file)
+
             try:
                 with open(wks_file, 'r') as f:
                     body = f.read()
Signature · 1 line
2.11.0
#1 lore raw

PATCH v2 1/1 image_types.bbclass: rebuild .wks file when .wks.in changes

WKS_FILE(S) can refer to .wks.in files which get expanded during the build by do_write_wks_template. The actual content of the .wks.in file gets added to the recipe meta data during parsing, and thus we need to ensure that the recipe gets re-parsed when the file changes.

This fixes two related problems:
- editing the .wks.in file and rebuilding an image did not recreate
the image unless something else changed or "bitbake -c clean" was
used explicitly
- when forcing a rebuild, the cached meta data and the actual one
do not match, leading to "ERROR: Taskhash mismatch ... for ....bb.do_write_wks_template"

---
 meta/classes/image_types.bbclass | 4 ++++
 1 file changed, 4 insertions(+)
meta/classes/image_types.bbclass +4 -0
index 5b1746a68ce..50545d9fdf0 100644
@@ -265,6 +265,10 @@ python () {
             d.setVar('WKS_TEMPLATE_PATH', wks_file_u)
             d.setVar('WKS_FILE_CHECKSUM', '${WKS_TEMPLATE_PATH}:True')
 
+            # We need to re-parse each time the file changes, and bitbake
+            # needs to be told about that explicitly.
+            bb.parse.mark_dependency(d, wks_file)
+
             try:
                 with open(wks_file, 'r') as f:
                     body = f.read()
Signature · 1 line
2.11.0