Openembedded Core Discussions
 help / color / mirror / Atom feed
* [RFC][PATCH] insane: configure option checking
@ 2013-09-05 13:55 Ross Burton
  2013-09-05 13:55 ` [PATCH] " Ross Burton
  2013-09-05 15:02 ` [RFC][PATCH] " Martin Jansa
  0 siblings, 2 replies; 4+ messages in thread
From: Ross Burton @ 2013-09-05 13:55 UTC (permalink / raw)
  To: openembedded-core

Hi,

First: very much a RFC, this isn't ready for merging.  I thought I'd send it
before it got lost in a nest of branches.

This is a small sanity test I've been poking at in between builds to detect when
configure warns that it has been passed configure options it doesn't recongise.
It's got a whitelist for options such as --disable-silent-rules that are passed
blindly to large numbers of recipes, and I think we'll need the possibility of a
per-recipe whitelist in case they are required[1].

Comments/improvements welcome!

Ross

[1] The rationale here being the Xorg protocol recipes which have a common .inc
that disables all forms of documentation, but not every protocol recipe has all
forms enabled.


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

* [PATCH] insane: configure option checking
  2013-09-05 13:55 [RFC][PATCH] insane: configure option checking Ross Burton
@ 2013-09-05 13:55 ` Ross Burton
  2013-09-05 15:02 ` [RFC][PATCH] " Martin Jansa
  1 sibling, 0 replies; 4+ messages in thread
From: Ross Burton @ 2013-09-05 13:55 UTC (permalink / raw)
  To: openembedded-core


Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 meta/classes/insane.bbclass |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 524cdca..9809cba 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -919,6 +919,25 @@ Missing inherit gettext?""" % (gt, config))
     if not package_qa_check_license(workdir, d):
         bb.fatal("Licensing Error: LIC_FILES_CHKSUM does not match, please fix")
 
+    ###########################################################################
+    # Check unrecognised configure options (with a white list)
+    ###########################################################################
+    if bb.data.inherits_class("autotools", d):
+        bb.note("Checking configure output for unrecognised options")
+        try:
+            flag = "WARNING: unrecognized options:"
+            log = os.path.join(d.getVar('B', True), 'config.log')
+            output = subprocess.check_output(['grep', '-F', flag, log])
+            options = set(map(lambda s: s.strip(' ,'), output.partition(flag)[2].split()))
+            whitelist = {'--enable-nls', '--disable-nls', '--disable-silent-rules', '--disable-dependency-tracking', '--with-libtool-sysroot'}
+            # TODO: allow additions per-recipe?
+            options -= whitelist
+            if options:
+		pn = d.getVar('PN', True)
+                error_msg = pn + ": configure was passed unrecognised options: " + " ".join(options)
+                package_qa_handle_error("unknown-configure-option", error_msg, d)
+        except subprocess.CalledProcessError:
+            pass
 }
 # The Staging Func, to check all staging
 #addtask qa_staging after do_populate_sysroot before do_build
-- 
1.7.10.4



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

* Re: [RFC][PATCH] insane: configure option checking
  2013-09-05 13:55 [RFC][PATCH] insane: configure option checking Ross Burton
  2013-09-05 13:55 ` [PATCH] " Ross Burton
@ 2013-09-05 15:02 ` Martin Jansa
  1 sibling, 0 replies; 4+ messages in thread
From: Martin Jansa @ 2013-09-05 15:02 UTC (permalink / raw)
  To: Ross Burton; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 720 bytes --]

On Thu, Sep 05, 2013 at 02:55:20PM +0100, Ross Burton wrote:
> Hi,
> 
> First: very much a RFC, this isn't ready for merging.  I thought I'd send it
> before it got lost in a nest of branches.
> 
> This is a small sanity test I've been poking at in between builds to detect when
> configure warns that it has been passed configure options it doesn't recongise.
> It's got a whitelist for options such as --disable-silent-rules that are passed
> blindly to large numbers of recipes, and I think we'll need the possibility of a
> per-recipe whitelist in case they are required[1].
> 
> Comments/improvements welcome!

I like this idea a lot :)

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

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

* [RFC][PATCH] insane: configure option checking
@ 2013-10-08 14:30 Ross Burton
  0 siblings, 0 replies; 4+ messages in thread
From: Ross Burton @ 2013-10-08 14:30 UTC (permalink / raw)
  To: openembedded-core

Hi,

This is v2 of my unrecognised-configure-options sanity test, that checks for
warnings at the end of configure logs and will emit a warning if there are
unrecognised options.  Useful to detect typos or options that have been
removed/renamed.

V2 differs from V1 in that the whitelist can be extended, and defaults to the
options commonly used in oe-core classes.

As an example of extending it, xorg-proto-common.inc in my branch has this:

+UNKNOWN_CONFIGURE_WHITELIST += "--without-fop --without-xmlto"

I've also done a full build of core-image-sato with this test enabled, this was
the output earlier today: http://pastebin.com/7LCZF55Z.  Between some local
whitelist patches and the patches I just sent, that list has almost halved in
size.

Any thoughts, or does this look good to go?

Ross


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

end of thread, other threads:[~2013-10-08 14:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-05 13:55 [RFC][PATCH] insane: configure option checking Ross Burton
2013-09-05 13:55 ` [PATCH] " Ross Burton
2013-09-05 15:02 ` [RFC][PATCH] " Martin Jansa
  -- strict thread matches above, loose matches on Subject: below --
2013-10-08 14:30 Ross Burton

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