From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: bitbake-devel <bitbake-devel@lists.openembedded.org>
Subject: [PATCH] cooker/event: Overhaul sanity test mechanism
Date: Wed, 26 Mar 2014 15:07:59 +0000 [thread overview]
Message-ID: <1395846479.24890.99.camel@ted> (raw)
Sanity tests are currently a pain as its hard to control when they run. This results
in issues where for example the bitbake -e output is not useful as the sanity tests
prevent it from executing. The sanity tests should run later than the base configuration.
This patch changes the sanity tests to always be event triggered with the option of
returning either events on the status, or raising errors. A new cooker feature is used
to change the behaviour depending on the controlling UI.
This does need a change to sanity.bbclass in the OE metadata but its worth the pain
for the increased flexibility and control this offers UIs and the improvement to the
user experience.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index e4cff3a..e81d887 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -82,7 +82,7 @@ class SkippedPackage:
class CookerFeatures(object):
- _feature_list = [HOB_EXTRA_CACHES, SEND_DEPENDS_TREE, BASEDATASTORE_TRACKING] = range(3)
+ _feature_list = [HOB_EXTRA_CACHES, SEND_DEPENDS_TREE, BASEDATASTORE_TRACKING, SEND_SANITYEVENTS] = range(4)
def __init__(self):
self._features=set()
@@ -1268,6 +1268,8 @@ class BBCooker:
if self.state != state.parsing:
self.parseConfiguration ()
+ if CookerFeatures.SEND_SANITYEVENTS in self.featureset:
+ bb.event.fire(bb.event.SanityCheck(False), self.data)
ignore = self.data.getVar("ASSUME_PROVIDED", True) or ""
self.recipecache.ignored_dependencies = set(ignore.split())
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index 10eae5f..e205043 100644
--- a/bitbake/lib/bb/event.py
+++ b/bitbake/lib/bb/event.py
@@ -601,8 +601,11 @@ class MetadataEvent(Event):
class SanityCheck(Event):
"""
- Event to issue sanity check
+ Event to runs sanity checks, either raise errors or generate events as return status.
"""
+ def __init__(self, generateevents = True):
+ Event.__init__(self)
+ self.generateevents = generateevents
class SanityCheckPassed(Event):
"""
@@ -620,8 +623,11 @@ class SanityCheckFailed(Event):
class NetworkTest(Event):
"""
- Event to start network test
+ Event to run network connectivity tests, either raise errors or generate events as return status.
"""
+ def __init__(self, generateevents = True):
+ Event.__init__(self)
+ self.generateevents = generateevents
class NetworkTestPassed(Event):
"""
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index 55cf507..009653c 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -34,6 +34,8 @@ import copy
import atexit
from bb.ui import uihelper
+featureSet = [bb.cooker.CookerFeatures.SEND_SANITYEVENTS]
+
logger = logging.getLogger("BitBake")
interactive = sys.stdout.isatty()
reply other threads:[~2014-03-26 15:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1395846479.24890.99.camel@ted \
--to=richard.purdie@linuxfoundation.org \
--cc=bitbake-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.