Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Mark Hatle <mark.hatle@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: [PATCH 2/2 RFC] package.bbclass: Trigger a bb.error if split/strip fails
Date: Mon, 25 Mar 2013 12:19:53 -0500	[thread overview]
Message-ID: <1364231993-31670-3-git-send-email-mark.hatle@windriver.com> (raw)
In-Reply-To: <1364231993-31670-1-git-send-email-mark.hatle@windriver.com>

[ YOCTO #4089 ]

If debugedit, objcopy calls fail, capture the error and return a
failure to the user.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 meta/classes/package.bbclass | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 0702c92..3752bdc 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -254,14 +254,26 @@ def splitdebuginfo(file, debugfile, debugsrcdir, d):
 
     # We need to extract the debug src information here...
     if debugsrcdir:
-        subprocess.call("'%s' -b '%s' -d '%s' -i -l '%s' '%s'" % (debugedit, workparentdir, debugsrcdir, sourcefile, file), shell=True)
+        cmd = "'%s' -b '%s' -d '%s' -i -l '%s' '%s'" % (debugedit, workparentdir, debugsrcdir, sourcefile, file)
+        ret = subprocess.call(cmd, shell=True)
+        if ret != 0:
+            bb.error("debugedit failed: %s - %d" % (cmd, ret))
+            return ret
 
     bb.utils.mkdirhier(os.path.dirname(debugfile))
 
-    subprocess.call("'%s' --only-keep-debug '%s' '%s'" % (objcopy, file, debugfile), shell=True)
+    cmd = "'%s' --only-keep-debug '%s' '%s'" % (objcopy, file, debugfile)
+    ret = subprocess.call(cmd, shell=True)
+    if ret != 0:
+        bb.error("debugedit failed: %s - %d" % (cmd, ret))
+        return ret
 
     # Set the debuglink to have the view of the file path on the target
-    subprocess.call("'%s' --add-gnu-debuglink='%s' '%s'" % (objcopy, debugfile, file), shell=True)
+    cmd = "'%s' --add-gnu-debuglink='%s' '%s'" % (objcopy, debugfile, file)
+    ret = subprocess.call(cmd, shell=True)
+    if ret != 0:
+        bb.error("debugedit failed: %s - %d" % (cmd, ret))
+        return ret
 
     if newmode:
         os.chmod(file, origmode)
@@ -806,7 +818,9 @@ python split_and_strip_files () {
             bb.utils.mkdirhier(os.path.dirname(fpath))
             #bb.note("Split %s -> %s" % (file, fpath))
             # Only store off the hard link reference if we successfully split!
-            splitdebuginfo(file, fpath, debugsrcdir, d)
+            ret = splitdebuginfo(file, fpath, debugsrcdir, d)
+            if ret != 0:
+                return ret
 
         # Hardlink our debug symbols to the other hardlink copies
         for file in hardlinks:
@@ -878,6 +892,8 @@ python split_and_strip_files () {
     #
     # End of strip
     #
+
+    return 0
 }
 
 python populate_packages () {
-- 
1.8.1.2.545.g2f19ada




  parent reply	other threads:[~2013-03-25 16:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-25 17:19 [PATCH 0/2 RFC] workaround for debugedit segv Mark Hatle
2013-03-25 17:19 ` [PATCH 1/2 RFC] rpm: Add workaround for debugedit-segv Mark Hatle
2013-03-25 17:02   ` Phil Blundell
2013-03-25 17:10     ` Mark Hatle
2013-03-25 17:45       ` Phil Blundell
2013-03-25 19:32         ` Mark Hatle
2013-03-25 21:47           ` Mark Hatle
2013-03-26 10:38             ` Phil Blundell
2013-03-26 12:20               ` Mark Hatle
2013-03-25 17:19 ` Mark Hatle [this message]
2013-03-25 17:47 ` [PATCH 0/2 RFC] workaround for debugedit segv Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1364231993-31670-3-git-send-email-mark.hatle@windriver.com \
    --to=mark.hatle@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox