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

login
register
mail settings
Submitter Peter Seebach
Date Nov. 20, 2013, 12:31 a.m.
Message ID <16a4c667fd7dde1f7d503942c45e03a6bda98ae8.1384907111.git.peter.seebach@windriver.com>
Download mbox | patch
Permalink /patch/62009/
State New
Headers show

Comments

Peter Seebach - Nov. 20, 2013, 12:31 a.m.
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).

Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
---
 meta/classes/sanity.bbclass |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
Martin Jansa - Nov. 20, 2013, 12:35 a.m.
On Tue, Nov 19, 2013 at 06:31:57PM -0600, Peter Seebach wrote:
> 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).
> 
> Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
> ---
>  meta/classes/sanity.bbclass |    8 +++++++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
> 
> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
> index 6807a23..1ef811d 100644
> --- a/meta/classes/sanity.bbclass
> +++ b/meta/classes/sanity.bbclass
> @@ -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.")

Inconsistent whitespace

> +        bb.error(msg)
> +    else:
> +        bb.fatal(msg)
>  
>  # Check a single tune for validity.
>  def check_toolchain_tune(data, tune, multilib):
> -- 
> 1.7.1
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
Peter Seebach - Nov. 20, 2013, 12:42 a.m.
On Wed, 20 Nov 2013 01:35:32 +0100
Martin Jansa <martin.jansa@gmail.com> wrote:

> Inconsistent whitespace

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

Fixed that one too, updated the branch on contrib.

-s
Richard Purdie - Nov. 20, 2013, 10:19 a.m.
On Tue, 2013-11-19 at 18:31 -0600, Peter Seebach wrote:
> 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).
> 
> Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
> ---
>  meta/classes/sanity.bbclass |    8 +++++++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
> 
> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
> index 6807a23..1ef811d 100644
> --- a/meta/classes/sanity.bbclass
> +++ b/meta/classes/sanity.bbclass
> @@ -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)

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
Peter Seebach - Nov. 20, 2013, 3:16 p.m.
On Wed, 20 Nov 2013 10:19:04 +0000
Richard Purdie <richard.purdie@linuxfoundation.org> wrote:

> 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

Patch

diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 6807a23..1ef811d 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -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):