Skip to contentSkip to conversation

package.bbclass: Make staticlib problems non-fatal

PATCH New Ola x Nilsson 1 participant 1 message Apr 23, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package.bbclass: Make staticlib problems non-fatal

Allow debugsource listing using dwarfsourcefiles to fail for static libraries when the archive content is not as expected.

---
 meta/classes/package.bbclass | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
meta/classes/package.bbclass +6 -3
index 0436d919e7..d61b4ce8ca 100644
@@ -344,12 +344,15 @@ def parse_debugsources_from_dwarfsrcfiles_output(dwarfsrcfiles_output):
 
     return debugfiles.keys()
 
-def append_source_info(file, sourcefile, d):
+def append_source_info(file, sourcefile, d, fatal=True):
     cmd = "'dwarfsrcfiles' '%s'" % (file)
     (retval, output) = oe.utils.getstatusoutput(cmd)
     # 255 means a specific file wasn't fully parsed to get the debug file list, which is not a fatal failure
     if retval != 0 and retval != 255:
-        bb.fatal("dwarfsrcfiles failed with exit code %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))
+        msg = "dwarfsrcfiles failed with exit code %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else "")
+        if fatal:
+            bb.fatal(msg)
+        bb.note(msg)
 
     debugsources = parse_debugsources_from_dwarfsrcfiles_output(output)
     # filenames are null-separated - this is an artefact of the previous use
@@ -1052,7 +1055,7 @@ python split_and_strip_files () {
 
         if debugsrcdir and not targetos.startswith("mingw"):
             for file in staticlibs:
-                append_source_info(file, sourcefile, d)
+                append_source_info(file, sourcefile, d, fatal=False)
 
         # Hardlink our debug symbols to the other hardlink copies
         for ref in inodes:
Signature · 1 line
2.11.0