summaryrefslogtreecommitdiff
path: root/meta/files
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-06-24 00:07:03 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-07-07 13:29:01 +0100
commite1390c1ef85862b91b067ab24f3c06ca506155ad (patch)
tree912d9081b5af568ab0f47306aa121247c352067e /meta/files
parenta8f11bc5ce07114b9ec7da7ad48da62e2026cd74 (diff)
downloadopenembedded-core-e1390c1ef85862b91b067ab24f3c06ca506155ad.tar.gz
openembedded-core-e1390c1ef85862b91b067ab24f3c06ca506155ad.tar.bz2
openembedded-core-e1390c1ef85862b91b067ab24f3c06ca506155ad.zip
classes/populate_sdk_ext: eliminate double execution on install
Use the new BB_SETSCENE_ENFORCE functionality to avoid having to run bitbake twice on installing the extensible SDK - we can now do it all in one invocation which not only takes less time, but we should also get more meaningful errors for some types of failure, in particular where downloading from an sstate mirror fails. One result of this change is that you get the errors printed on the console during normal output rather than this going to the preparing_build_system.log file first. In OE-Core revision 227d2cbf9e0b8c35fa6644e3d72e0699db9607fa, we changed to always print the contents of preparing_build_system.log on failure, but now at least the error contents of that log is duplicated. Besides, I intentionally didn't print out the contents of that log during normal usage because it's quite verbose - the bug that we were attempting to fix was about not getting this information when seeing failures in the automated tests, thus I've moved printing the log to the test handling code instead. Part of the implementation of [YOCTO #9367]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/files')
-rw-r--r--meta/files/ext-sdk-prepare.py52
1 files changed, 1 insertions, 51 deletions
diff --git a/meta/files/ext-sdk-prepare.py b/meta/files/ext-sdk-prepare.py
index bf0d03336b..3b33c0f9e9 100644
--- a/meta/files/ext-sdk-prepare.py
+++ b/meta/files/ext-sdk-prepare.py
@@ -27,22 +27,6 @@ def exec_watch(cmd, **options):
return process.returncode, buf
-def check_unexpected(lines, recipes):
- """Check for unexpected output lines from dry run"""
- unexpected = []
- for line in lines.splitlines():
- if 'Running task' in line:
- for recipe in recipes:
- if recipe in line:
- break
- else:
- line = line.split('Running', 1)[-1]
- if 'do_rm_work' not in line:
- unexpected.append(line.rstrip())
- elif 'Running setscene' in line:
- unexpected.append(line.rstrip())
- return unexpected
-
def main():
if len(sys.argv) < 2:
sdk_targets = []
@@ -55,44 +39,10 @@ def main():
print('Preparing SDK for %s...' % ', '.join(sdk_targets))
- ret, out = exec_watch('bitbake %s --setscene-only' % ' '.join(sdk_targets))
+ ret, out = exec_watch('BB_SETSCENE_ENFORCE=1 bitbake %s' % ' '.join(sdk_targets))
if ret:
return ret
- targetlist = []
- for target in sdk_targets:
- if ':' in target:
- target = target.split(':')[0]
- if not target in targetlist:
- targetlist.append(target)
-
- recipes = []
- for target in targetlist:
- try:
- out = subprocess.check_output(('bitbake -e %s' % target).split(), stderr=subprocess.STDOUT)
- for line in out.splitlines():
- if line.startswith('FILE='):
- splitval = line.rstrip().split('=')
- if len(splitval) > 1:
- recipes.append(splitval[1].strip('"'))
- break
- except subprocess.CalledProcessError as e:
- print('ERROR: Failed to get recipe for target %s:\n%s' % (target, e.output))
- return 1
-
- try:
- out = subprocess.check_output('bitbake %s -n' % ' '.join(sdk_targets), stderr=subprocess.STDOUT, shell=True)
- unexpected = check_unexpected(out, recipes)
- except subprocess.CalledProcessError as e:
- print('ERROR: Failed to execute dry-run:\n%s' % e.output)
- return 1
-
- if unexpected:
- print('ERROR: Unexpected tasks or setscene left over to be executed:')
- for line in unexpected:
- print(' ' + line)
- return 1
-
if __name__ == "__main__":
try:
ret = main()