Skip to contentSkip to conversation

Make sanity check failures nonfatal for bitbake -e

PATCH In review Peter Seebach 3 participants 6 messages Nov 20, 2013

lore
Share & tools
lore
#0 lore raw

cover Make sanity check failures nonfatal for bitbake -e

This patch depends on a separate patch to bitbake providing an isTracking() in DataSmart. The goal here is that if you run "bitbake -e", you can get variable values and include history even if something is horribly wrong, because "something is horribly wrong" is precisely when "bitbake -e" is most useful.

The following changes since commit 0eb947454e1c92467283e6f1adeca67c7c57698b:

python: Fix ptest not working problems (2013-11-18 13:04:13 +0000)

are available in the git repository at:
git://git.yoctoproject.org/poky-contrib seebs/nonfatal_insanity
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=seebs/nonfatal_insanity

Peter Seebach (1):
sanity.bbclass: Don't fatal() when trying to dump environment.

 meta/classes/sanity.bbclass |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
#1 lore raw

PATCH 1/1 sanity.bbclass: Don't fatal() when trying to dump environment.

It is distressing when bitbake -e can't run due to sanity check failures, because the solution often involves figuring out what configuration file are being read and what values they are setting.
Solution: Don't do that. If the datasmart object reports that tracking is enabled, emit an error() but not a fatal(), and also warn the user that things may be badly broken.

This depends on a change to bitbake (adding the isTracking() method).

---
 meta/classes/sanity.bbclass |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
meta/classes/sanity.bbclass +7 -1
index 6807a23..1ef811d 100644
@@ -82,11 +82,17 @@ def raise_sanity_error(msg, d, network_error=False):
             bb.event.fire(bb.event.SanityCheckFailed(msg), d)
         return
 
-    bb.fatal(""" OE-core's config sanity checker detected a potential misconfiguration.
+    msg = (""" OE-core's config sanity checker detected a potential misconfiguration.
     Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
     Following is the list of potential problems / advisories:
     
     %s""" % msg)
+    if d.isTracking():
+	bb.warn("Environment tracking enabled: NOT exiting on sanity check failures.")
+	bb.warn("Results may be inconsistent or meaningless; proceed at your own risk.")
+        bb.error(msg)
+    else:
+        bb.fatal(msg)
 
 # Check a single tune for validity.
 def check_toolchain_tune(data, tune, multilib):
Signature · 1 line
1.7.1
#2 lore raw

Re: [PATCH 1/1] sanity.bbclass: Don't fatal() when trying to dump environment.

Quoted 21 lines · Peter Seebach

It is distressing when bitbake -e can't run due to sanity check failures, because the solution often involves figuring out what configuration file are being read and what values they are setting.
Solution: Don't do that. If the datasmart object reports that tracking is enabled, emit an error() but not a fatal(), and also warn the user that things may be badly broken.

This depends on a change to bitbake (adding the isTracking() method).

---
 meta/classes/sanity.bbclass |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
meta/classes/sanity.bbclass +0 -0
index 6807a23..1ef811d 100644
@@ -82,11 +82,17 @@ def raise_sanity_error(msg, d, network_error=False):
             bb.event.fire(bb.event.SanityCheckFailed(msg), d)
         return

meta/classes/sanity.bbclass def raise_sanity_error(msg, d, network_error=False): · line 92

Quoted 10 lines
meta/classes/sanity.bbclass +4 -1
 
-    bb.fatal(""" OE-core's config sanity checker detected a potential misconfiguration.
+    msg = (""" OE-core's config sanity checker detected a potential misconfiguration.
     Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
     Following is the list of potential problems / advisories:
 
     %s""" % msg)
+    if d.isTracking():
+	bb.warn("Environment tracking enabled: NOT exiting on sanity check failures.")
+	bb.warn("Results may be inconsistent or meaningless; proceed at your own risk.")

Inconsistent whitespace

Quoted 13 lines
meta/classes/sanity.bbclass +3 -0
+        bb.error(msg)
+    else:
+        bb.fatal(msg)
 
 # Check a single tune for validity.
 def check_toolchain_tune(data, tune, multilib):
Signature · 6 lines
1.7.1

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#3 lore raw

Re: [PATCH 1/1] sanity.bbclass: Don't fatal() when trying to dump environment.

Quoted 1 line · On Wed, 20 Nov 2013 01:35:32 +0100 Martin Jansa <[email protected]> wrote:

Inconsistent whitespace

argh. I totally thought I'd fixed those all.

Fixed that one too, updated the branch on contrib.

-s

Signature · 1 line
Listen, get this.  Nobody with a good compiler needs to be justified.
#4 lore raw

Re: [PATCH 1/1] sanity.bbclass: Don't fatal() when trying to dump environment.

In reply to Peter Seebach
Quoted 24 lines · Peter Seebach

It is distressing when bitbake -e can't run due to sanity check failures, because the solution often involves figuring out what configuration file are being read and what values they are setting.
Solution: Don't do that. If the datasmart object reports that tracking is enabled, emit an error() but not a fatal(), and also warn the user that things may be badly broken.

This depends on a change to bitbake (adding the isTracking() method).

---
 meta/classes/sanity.bbclass |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
meta/classes/sanity.bbclass +1 -1
index 6807a23..1ef811d 100644
@@ -82,11 +82,17 @@ def raise_sanity_error(msg, d, network_error=False):
             bb.event.fire(bb.event.SanityCheckFailed(msg), d)
         return
 
-    bb.fatal(""" OE-core's config sanity checker detected a potential misconfiguration.
+    msg = (""" OE-core's config sanity checker detected a potential misconfiguration.

meta/classes/sanity.bbclass def raise_sanity_error(msg, d, network_error=False): · line 95

Quoted 10 lines
meta/classes/sanity.bbclass +6 -0
     Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
     Following is the list of potential problems / advisories:
 
     %s""" % msg)
+    if d.isTracking():
+	bb.warn("Environment tracking enabled: NOT exiting on sanity check failures.")
+	bb.warn("Results may be inconsistent or meaningless; proceed at your own risk.")
+        bb.error(msg)
+    else:
+        bb.fatal(msg)

This is creative but you just disabled the sanity tests in the graphical UIs like hob.

isTracking() does not mean -e is being used, we use the tracking in other places now too.

Cheers,

Richard

#5 lore raw

Re: [PATCH 1/1] sanity.bbclass: Don't fatal() when trying to dump environment.

Quoted 5 lines · On Wed, 20 Nov 2013 10:19:04 +0000 Richard Purdie…

This is creative but you just disabled the sanity tests in the graphical UIs like hob.

isTracking() does not mean -e is being used, we use the tracking in other places now too.

Drat.

Perhaps an alternative would be to have -e set a specific variable, like BB_SHOW_ENV_ONLY?

-s

Signature · 1 line
Listen, get this.  Nobody with a good compiler needs to be justified.