Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] Urgent fix for insane.bbclass.
@ 2012-01-05 21:12 Scott Garman
  2012-01-05 21:12 ` [PATCH 1/1] insane.bbclass: use bb.process.Popen instead of subprocess.check_output Scott Garman
  0 siblings, 1 reply; 3+ messages in thread
From: Scott Garman @ 2012-01-05 21:12 UTC (permalink / raw)
  To: openembedded-core

Hello,

This fixes the error:

AttributeError: 'module' object has no attribute 'check_output'

which currently is breaking builds for hosts using Python < 2.7.
Please apply it ASAP.

Thanks,

Scott

The following changes since commit 563828bad19a242bba9ce3db461bb5807037dfdf:

  multilib: Abstract class extension code into classextend.py (2012-01-05 12:36:08 +0000)

are available in the git repository at:
  git://git.yoctoproject.org/poky-contrib sgarman/qa-fix-final
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=sgarman/qa-fix-final

Scott Garman (1):
  insane.bbclass: use bb.process.Popen instead of
    subprocess.check_output

 meta/classes/insane.bbclass |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

-- 
1.7.5.4




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] insane.bbclass: use bb.process.Popen instead of subprocess.check_output
  2012-01-05 21:12 [PATCH 0/1] Urgent fix for insane.bbclass Scott Garman
@ 2012-01-05 21:12 ` Scott Garman
  2012-01-05 22:21   ` Richard Purdie
  0 siblings, 1 reply; 3+ messages in thread
From: Scott Garman @ 2012-01-05 21:12 UTC (permalink / raw)
  To: openembedded-core

subprocess.check_output was only introduced in Python v2.7, so we
cannot use it. This refactors the QA test to use bb.process.Popen
instead.

This fixes the error:

AttributeError: 'module' object has no attribute 'check_output'

It no longer checks the return status of prelink-rtld, as that
case was simply adding noise. This QA test is intended to only
warn about specific paths that binaries could be linking to, not
handle the case where there is a missing library.

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
---
 meta/classes/insane.bbclass |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index b8d4507..8d6b11c 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -227,16 +227,12 @@ def package_qa_check_unsafe_references_in_binaries(path, name, d, elf, messages)
 		sysroot_path_usr = sysroot_path + exec_prefix
 
 		try:
-			ldd_output = sub.check_output(["prelink-rtld", "--root", sysroot_path, path])
-		except sub.CalledProcessError as e:
-			if e.returncode != 127:
-				error_msg = pn + ": prelink-rtld aborted when processing %s" % path
-				package_qa_handle_error("unsafe-references-in-binaries", error_msg, d)
-				return False
-			else:
-				# Sometimes this is done deliberately (e.g, e2fsprogs), so only warn
-				bb.warn("%s has missing library dependencies" % path)
-				return
+			ldd_output = bb.process.Popen(["prelink-rtld", "--root", sysroot_path, path], stdout=sub.PIPE).stdout.read()
+		except bb.process.CmdError:
+			error_msg = pn + ": prelink-rtld aborted when processing %s" % path
+			package_qa_handle_error("unsafe-references-in-binaries", error_msg, d)
+			return False
+
 		if sysroot_path_usr in ldd_output:
 			error_msg = pn + ": %s links to something under exec_prefix" % path
 			package_qa_handle_error("unsafe-references-in-binaries", error_msg, d)
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] insane.bbclass: use bb.process.Popen instead of subprocess.check_output
  2012-01-05 21:12 ` [PATCH 1/1] insane.bbclass: use bb.process.Popen instead of subprocess.check_output Scott Garman
@ 2012-01-05 22:21   ` Richard Purdie
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2012-01-05 22:21 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Thu, 2012-01-05 at 13:12 -0800, Scott Garman wrote:
> subprocess.check_output was only introduced in Python v2.7, so we
> cannot use it. This refactors the QA test to use bb.process.Popen
> instead.
> 
> This fixes the error:
> 
> AttributeError: 'module' object has no attribute 'check_output'
> 
> It no longer checks the return status of prelink-rtld, as that
> case was simply adding noise. This QA test is intended to only
> warn about specific paths that binaries could be linking to, not
> handle the case where there is a missing library.
> 
> Signed-off-by: Scott Garman <scott.a.garman@intel.com>
> ---
>  meta/classes/insane.bbclass |   16 ++++++----------
>  1 files changed, 6 insertions(+), 10 deletions(-)

Merged to master, thanks for the quick fix!

Cheers,

Richard




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-01-05 22:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-05 21:12 [PATCH 0/1] Urgent fix for insane.bbclass Scott Garman
2012-01-05 21:12 ` [PATCH 1/1] insane.bbclass: use bb.process.Popen instead of subprocess.check_output Scott Garman
2012-01-05 22:21   ` Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox