Bug 10810

Summary: sanity checks also need to run for multiconfigs
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Patrick Ohly <patrick.ohly>
Component: coreAssignee: Juro Bystricky <juro.bystricky>
Status: VERIFIED FIXED QA Contact: Jose Perez C <jose.perez.carranza>
Severity: enhancement    
Priority: Medium+ CC: jose.perez.carranza, meta.mr.watcher, meta.watcher, sgw
Version: 2.3   
Target Milestone: 2.3 M3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
patch file to implement the fix for this bug none

Description Patrick Ohly 2016-12-14 18:12:29 UTC
Steps to reproduce:
- create conf/local.conf with BBMULTICONFIG = "foo"
- create conf/multiconfig/foo.conf with MACHINE="foo"
- bitbake world

Result:
ERROR: ...: Unable to determine endianness for architecture 'INVALID'
The error comes from siteconfig.bbclass because HOST_ARCH is not set.

Expected:
The same sanity check error that one gets when using an invalid MACHINE in local.conf, i.e. something like:


ERROR:  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:

    Please set a valid MACHINE in your local.conf or environment

The error message should mention the multiconfig file in addition to local.conf.
Comment 1 Juro Bystricky 2017-01-12 00:23:47 UTC
Currently testing running sanity check for all multiconfig builds (including the "default" build):

diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 182d044..f6bad36 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1610,7 +1610,9 @@ class BBCooker:
         if self.state != state.parsing and not self.parsecache_valid:
             self.parseConfiguration ()
             if CookerFeatures.SEND_SANITYEVENTS in self.featureset:
-                bb.event.fire(bb.event.SanityCheck(False), self.data)
+
+                for mc in self.multiconfigs:
+                    bb.event.fire(bb.event.SanityCheck(False), self.databuilder.mcdata[mc])
 
             for mc in self.multiconfigs:
                 ignore = self.databuilder.mcdata[mc].getVar("ASSUME_PROVIDED") or ""


As for "The error message should mention the multiconfig file in addition to local.conf", WIP
Comment 2 Juro Bystricky 2017-01-12 00:46:56 UTC
Created attachment 3593 [details]
patch file to implement the fix for this bug
Comment 3 Juro Bystricky 2017-01-12 00:49:46 UTC
I attached the patch file that should fix this issue.

I will test it a bit more a then send each patch to the corresponding mailing list: cooker.py -> bitbake, sanity.bbclass->oe-core
Comment 5 Jose Perez C 2017-03-14 21:29:37 UTC
Verified on commit: 6e20b31d5d17133e0fca086e12a0ad06ab5c4cc8 is working correctly 

ERROR:  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:

    MACHINE=foo is invalid. Please set a valid MACHINE in your local.conf, environment or other configuration file.