Skip to contentSkip to conversation

buildhistory.bbclass: fix regression from FILES_INFO changes

PATCH In review S. Lockwood-Childs 2 participants 2 messages Nov 17, 2021 – Nov 19, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 buildhistory.bbclass: fix regression from FILES_INFO changes

Started getting a stack trace during packagedata task for a recipe that built fine in hardknott

*** 0002:buildhistory_emit_pkghistory(d)

     0003:

File: 'meta/classes/buildhistory.bbclass', lineno: 313, function: buildhistory_emit_pkghistory
0309: pkginfo.filevars[filevar] = localdata.getVar(filevar) or ""
0310:
0311: # Gather information about packaged files
0312: val = localdata.getVar('FILES_INFO') or ''

 *** 0313:        dictval = json.loads(val)
     0314:        filelist = list(dictval.keys())
     0315:        filelist.sort()
     0316:        pkginfo.filelist = " ".join([shlex.quote(x) for x in filelist])

...
Exception: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

which turns out to mean FILES_INFO is undefined for the main package built by this recipe (FILES_INFO lookup for other packages such as -dev seemed to work fine).

Tracked the regression down to this commit:
package/scripts: Fix FILES_INFO handling OE-Core rev: a1190903e0a61a12c9854c96af918ae8d12c6327

If buildhistory.bbclass uses the same per-package syntax to read FILES_INFO as package.bbclass uses now when setting it, then this regression goes away.

---
 meta/classes/buildhistory.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/buildhistory.bbclass +1 -1
index 7c44fec2d1..99300ab431 100644
@@ -309,7 +309,7 @@ python buildhistory_emit_pkghistory() {
             pkginfo.filevars[filevar] = localdata.getVar(filevar) or ""
 
         # Gather information about packaged files
-        val = localdata.getVar('FILES_INFO') or ''
+        val = localdata.getVar('FILES_INFO:%s' % pkg) or ''
         dictval = json.loads(val)
         filelist = list(dictval.keys())
         filelist.sort()
Signature · 1 line
2.20.1
#1 lore raw
Quoted 38 lines · S. Lockwood-Childs

Started getting a stack trace during packagedata task for a recipe that built fine in hardknott

*** 0002:buildhistory_emit_pkghistory(d)

     0003:

File: 'meta/classes/buildhistory.bbclass', lineno: 313, function: buildhistory_emit_pkghistory
0309: pkginfo.filevars[filevar] = localdata.getVar(filevar) or ""
0310:
0311: # Gather information about packaged files
0312: val = localdata.getVar('FILES_INFO') or ''

 *** 0313:        dictval = json.loads(val)
     0314:        filelist = list(dictval.keys())
     0315:        filelist.sort()
     0316:        pkginfo.filelist = " ".join([shlex.quote(x) for x in filelist])

...
Exception: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

which turns out to mean FILES_INFO is undefined for the main package built by this recipe (FILES_INFO lookup for other packages such as -dev seemed to work fine).

Tracked the regression down to this commit:
package/scripts: Fix FILES_INFO handling OE-Core rev: a1190903e0a61a12c9854c96af918ae8d12c6327

If buildhistory.bbclass uses the same per-package syntax to read FILES_INFO as package.bbclass uses now when setting it, then this regression goes away.

---
 meta/classes/buildhistory.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/buildhistory.bbclass +0 -0
index 7c44fec2d1..99300ab431 100644

meta/classes/buildhistory.bbclass python buildhistory_emit_pkghistory() { · line 315

Quoted 8 lines
meta/classes/buildhistory.bbclass +1 -1
@@ -309,7 +309,7 @@ python buildhistory_emit_pkghistory() {
             pkginfo.filevars[filevar] = localdata.getVar(filevar) or ""
 
         # Gather information about packaged files
-        val = localdata.getVar('FILES_INFO') or ''
+        val = localdata.getVar('FILES_INFO:%s' % pkg) or ''
         dictval = json.loads(val)
         filelist = list(dictval.keys())
         filelist.sort()

Which revision of the project are you seeing that on? This shouldn't be needed since a number of lines above there it says:

localdata.setVar('OVERRIDES', d.getVar("OVERRIDES", False) + ":" + pkg)

i.e. pkg is in OVERRIDES and therefore FILES_INFO should be FILES_INFO:pkg if that is set.

I think this is masking some other issue and isn't the correct fix.

Cheers,

Richard