Skip to contentSkip to conversation

insane.bbclass: Enable the insane.bbclass for everyone in a warning mode

PATCH In review Holger Freyther 5 participants 9 messages Sep 12, 2010 – Sep 13, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 insane.bbclass: Enable the insane.bbclass for everyone in a warning mode

Make conf/bitbake.conf load conf/insane.conf that will INHERIT the insane.bbclass. Remove the INHERIT from the distros currently using insane.bbclass. Change insane.bbclass to check QA_FATAL to see if errors are allowed to be fatal, make SHR/Kaelios and Angstrom use that new flag to continue having fatal QA Errors.

---
 classes/insane.bbclass               |    5 ++++-
 conf/bitbake.conf                    |    1 +
 conf/distro/include/angstrom.inc     |    4 ++--
 conf/distro/include/kaeilos-2010.inc |    4 ++--
 conf/distro/include/kaeilos.inc      |    4 ++--
 conf/distro/shr.conf                 |    3 +--
 conf/insane.conf                     |    2 ++
 7 files changed, 14 insertions(+), 9 deletions(-)
 create mode 100644 conf/insane.conf
classes/insane.bbclass +4 -1
index 4696c25..d137dfc 100644
@@ -106,12 +106,15 @@ def package_qa_clean_path(path,d):
     """ Remove the common prefix from the path. In this case it is the TMPDIR"""
     return path.replace(bb.data.getVar('TMPDIR',d,True),"")
 
-def package_qa_make_fatal_error(error_class, name, path,d):
+def package_qa_make_fatal_error(error_class, name, path, d):
     """
     decide if an error is fatal
 
     TODO: Load a whitelist of known errors
     """
+
+    if not bb.data.getVar("QA_FATAL", d):
+        return False
     return not error_class in [0, 5, 7]
 
 def package_qa_write_error(error_class, name, path, d):
conf/bitbake.conf +1 -0
index b099499..bc8eea0 100644
@@ -701,6 +701,7 @@ require conf/sanity.conf
 require conf/abi_version.conf
 require conf/enterprise.conf
 require conf/compatibility-providers.conf
+require conf/insane.conf
 
 ##################################################################
 # Weak variables (usually to retain backwards compatibility)
conf/distro/include/angstrom.inc +2 -2
index 8983c86..030ef3b 100644
@@ -85,10 +85,10 @@ INHERIT += "devshell"
 #use angstrom source mirrors to combat 404s
 INHERIT += "angstrom-mirrors" 
 
-#run QA tests on builds and packages and log them  
-INHERIT += "insane"
 # INHERIT += "packagehistory"
+#log QA errors
 QA_LOG = "1"
+QA_FATAL = "1"
 
 #run QA tests on recipes
 INHERIT += "recipe_sanity"
conf/distro/include/kaeilos-2010.inc +2 -2
index 2fb30ce..7061aee 100644
@@ -53,9 +53,9 @@ INHERIT += "sanity"
 #make devshell available as task
 INHERIT += "devshell" 
 
-#run QA tests on builds and packages and log them  
-INHERIT += "insane"
+#log QA errors
 QA_LOG = "1"
+QA_FATAL = "1"
 
 #run QA tests on recipes
 INHERIT += "recipe_sanity"
conf/distro/include/kaeilos.inc +2 -2
index edbad69..af8eca3 100644
@@ -84,10 +84,10 @@ INHERIT += "devshell"
 #use angstrom source mirrors to combat 404s
 INHERIT += "angstrom-mirrors" 
 
-#run QA tests on builds and packages and log them  
-INHERIT += "insane"
 # INHERIT += "packagehistory"
+#log QA errors
 QA_LOG = "1"
+QA_FATAL = "1"
 
 #run QA tests on recipes
 INHERIT += "recipe_sanity"
conf/distro/shr.conf +1 -2
index 9dd1c3e..aa94f95 100644
@@ -40,10 +40,9 @@ INHERIT += "testlab"
 #activate the angstrom blacklister
 INHERIT += "angstrom"
 
-#run QA tests on builds and packages and log them
-INHERIT += "insane"
 # INHERIT += "packagehistory"
 QA_LOG = "1"
+QA_FATAL = "1"
 
 #make devshell available as task
 INHERIT += "devshell"
conf/insane.conf new file +2 -0
new file mode 100644
index 0000000..5324529
@@ -0,0 +1,2 @@
+# Run insane for everyone
+INHERIT += "insane"
#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 8 lines · Holger Freyther

Make conf/bitbake.conf load conf/insane.conf that will INHERIT the insane.bbclass. Remove the INHERIT from the distros currently using insane.bbclass. Change insane.bbclass to check QA_FATAL to see if errors are allowed to be fatal, make SHR/Kaelios and Angstrom use that new flag to continue having fatal QA Errors.

Looks good to me, but a slight nit-pick:

+#log QA errors
QA_LOG = "1"
+QA_FATAL = "1"

Can you change the comment to something like:

# Log QA errors and abort the build when encountering them

So that it's clear what the 2 vars do?

regards,

Koen

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFMjL6GMkyGM64RGpERAu6nAJ9YVJtjYLE4RJGT8vJaFtCUUpNHLwCfQUXn bWPfFuQSJMkJMmjkg1j7gAY=
=Chyt
-----END PGP SIGNATURE-----

#4 lore raw
In reply to Holger Freyther

2010/9/12 Holger Freyther <[email protected]>:

Quoted 8 lines

Make conf/bitbake.conf load conf/insane.conf that will INHERIT the insane.bbclass. Remove the INHERIT from the distros currently using insane.bbclass. Change insane.bbclass to check QA_FATAL to see if errors are allowed to be fatal, make SHR/Kaelios and Angstrom use that new flag to continue having fatal QA Errors.

I am not really in favour of this.

One of the disadvantages of insane.bbclass is that it has:
PACKAGE_DEPENDS += "pax-utils-native desktop-file-utils-native" This drags in several packages (e.g. sqlite3-native glib-2.0-native) only to check if the .desktop file is valid.

By making this mandatory quite some additional build time is needed (on a clean build), which is kind-of a nuisance and does not bring anything if you are working on a display-less system (e.g. a NAS).

I''d be more in favour to split off the .desktop test and use that only for those packages that generate .desktop files. (and make the rest of insane.bbclass mandatory).
Alternately perhaps it is possible to create a var or so by which people in their local or distro .conf can turn insane.bbclass (or the .desktop part) off.

Frans

#5 lore raw

Hello,

Quoted 8 lines · Frans Meulenbroeks

2010/9/12 Holger Freyther <[email protected]>:

Quoted 7 lines

Make conf/bitbake.conf load conf/insane.conf that will INHERIT the insane.bbclass. Remove the INHERIT from the distros currently using insane.bbclass. Change insane.bbclass to check QA_FATAL to see if errors are allowed to be fatal, make SHR/Kaelios and Angstrom use that new flag to continue having fatal QA Errors.

Quoted 9 lines
Quoted 1 line

I am not really in favour of this.

One of the disadvantages of insane.bbclass is that it has:
PACKAGE_DEPENDS += "pax-utils-native desktop-file-utils-native" This drags in several packages (e.g. sqlite3-native glib-2.0-native) only to check if the .desktop file is valid.

Good point.

Could the insane class be more configurable to what it has to check, and have it's dependency generated from that configuration?

Regards,

Signature · 1 line
Leon
#2 lore raw
In reply to Koen Kooi
Quoted 5 lines · Koen Kooi

Can you change the comment to something like:

# Log QA errors and abort the build when encountering them

So that it's clear what the 2 vars do?

true.

BTW: why is packagehistory disabled? Was it ever enabled?

#6 lore raw
In reply to Frans Meulenbroeks
Quoted 5 lines · Frans Meulenbroeks

2010/9/12 Holger Freyther <[email protected]>:

Quoted 1 line

I am not really in favour of this.

This is an outstanding item from the TSC, I am not sure how to proceed from here, as we will go in circles.

I am happy as long as Angstrom is using this option, as this way I will not have a unzip package with the wrong binaries ever again.

#7 lore raw

On Sun, Sep 12, 2010 at 8:00 AM, Holger Freyther
<[email protected]<holger%[email protected]>

Quoted 8 lines

wrote:

Quoted 5 lines · Frans Meulenbroeks

2010/9/12 Holger Freyther <[email protected]<holger%[email protected]> :

Quoted 1 line
Quoted 9 lines
Quoted 1 line

I am not really in favour of this.

This is an outstanding item from the TSC, I am not sure how to proceed from here, as we will go in circles.

I am happy as long as Angstrom is using this option, as this way I will not have a unzip package with the wrong binaries ever again.
<http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel>

I think we should reorganize insane.bbclass and split up its functionality, either into multiple classes or configurable via variables, as others have suggested in this thread. If that's done, we can enable the core by default, but leave the bits that require additional dependencies as optional.

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
#3 lore raw
In reply to Holger Freyther

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 5 lines · Holger Freyther
Quoted 2 lines · Koen Kooi

Can you change the comment to something like:

Quoted 8 lines
Quoted 3 lines

# Log QA errors and abort the build when encountering them

So that it's clear what the 2 vars do?

true.

BTW: why is packagehistory disabled? Was it ever enabled?

I disabled it when it turned out to invalidate lots of stammps, but that was a while ago, it might behave differently nowadays.
Or I'm confusing it with lockdown...

regards,

Koen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFMjSEFMkyGM64RGpERAjpIAJ91WsBuYCwKxNQ1ekB7kBHubH3kagCfUzvg pX6MEM1QfiBXFvW7UkIXG6A=
=QfO3
-----END PGP SIGNATURE-----

#8 lore raw
In reply to Chris Larson

2010/9/12 Chris Larson <[email protected]>:

Quoted 7 lines

I think we should reorganize insane.bbclass and split up its functionality, either into multiple classes or configurable via variables, as others have suggested in this thread.  If that's done, we can enable the core by default, but leave the bits that require additional dependencies as optional.
--

Agree.

One of the ways to do so is to add more semantics to SECTION where whatever is in SECTION triggers a dependency on the sanity tester part for that section.
Alternately we could decide that every lib file has an inherit lib clause or something like that.
Disadvantage is that we need to check/update all recipes and there is a chance that someone forgets to add such a line.
(of course we could work around that by saying that e.g. SECTION is mandatory and can contain only a predefined number of values. Still that does not beat the case that someone just uses a wrong value).

BTW I feel that whether (QA or other) tests are executed should be ultimately controllable by the person who builds (e.g. in the local.conf). He/she is the one who has to pay for these (in terms of time and cycles and he/she gets the benefits (or gets burned) by using it.

Frans