Bug 9367

Summary: Extensible SDK: avoid double invocation of bitbake on install
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Paul Eggleton <bluelightning>
Component: devtools / tool chainAssignee: Paul Eggleton <bluelightning>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium CC: meta.mr.watcher, meta.watcher
Version: 2.1   
Target Milestone: 2.2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know
Bug Depends on:    
Bug Blocks: 9613    

Description Paul Eggleton 2016-04-01 01:37:36 UTC
At the moment, during the "Preparing build system" phase of the extensible SDK installation, we invoke bitbake once with --setscene-only to install available items from sstate, and then a second time with -n to check if any tasks are going to execute (i.e. verifying that the first invocation installed everything necessary from sstate). When everything works as it should this is functional, however it does cause some problems:

1) Running bitbake twice means we incur more certain time-consuming tasks twice, most significantly the "checking for sstate artifacts", "Preparing RunQueue" and other early steps of the build process. This is amplified if the SDK was constructed with SDK_INCLUDE_PKGDATA = "1" because then we're effectively considering the "world" target each time.

2) If we fail at the second stage we no longer have any error context as to what failed, and it's taken quite a long time to get to the point where we can tell the user something is wrong.

It would be much better if we could do this in one invocation. If we were to introduce a mode to BitBake enable this, the desired functionality is as follows:

* All shared state tasks required to satisfy the specified targets (excluding those which are "covered") must be able to be satisfied from sstate.

* A setscene failure (or failure to fetch an sstate package for any other reason than it not existing) should trigger an immediate failure, not just a warning.

* Only setscene tasks can run, but we check that there are no non-sstate tasks other than those in a whitelist that are expected to run; if there are any such tasks then we should fail with an error listing the tasks.

This is really something that needs to be enabled on invocation rather than more permanently through configuration, so it would probably need to be enabled through an additional command line option (though I realise we probably have too many already).