aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-05-16 16:30:44 +1200
committerPaul Eggleton <paul.eggleton@linux.intel.com>2016-06-24 10:08:14 +1200
commit30829edaad3bcacc1f5d25f346862d438c70572f (patch)
tree31de69a8c227b23a3d3769f07638e158b1fcfd85
parent89c49a1ac6d754fe1710962f70b83cb7a7877965 (diff)
downloadopenembedded-core-contrib-30829edaad3bcacc1f5d25f346862d438c70572f.tar.gz
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. Part of the implementation of [YOCTO #9367]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
-rw-r--r--meta/classes/populate_sdk_ext.bbclass5
-rw-r--r--meta/files/ext-sdk-prepare.py52
2 files changed, 5 insertions, 52 deletions
diff --git a/meta/classes/populate_sdk_ext.bbclass b/meta/classes/populate_sdk_ext.bbclass
index b9d9543409..67297e57ee 100644
--- a/meta/classes/populate_sdk_ext.bbclass
+++ b/meta/classes/populate_sdk_ext.bbclass
@@ -223,10 +223,13 @@ python copy_buildsystem () {
# warning.
f.write('SIGGEN_LOCKEDSIGS_SSTATE_EXISTS_CHECK = "none"\n\n')
- # Error if the sigs in the locked-signature file don't match
+ # Warn if the sigs in the locked-signature file don't match
# the sig computed from the metadata.
f.write('SIGGEN_LOCKEDSIGS_TASKSIG_CHECK = "warn"\n\n')
+ # Set up whitelist for run on install
+ f.write('BB_SETSCENE_ENFORCE_WHITELIST = "%:* *:do_shared_workdir *:do_rm_work"\n\n')
+
# Hide the config information from bitbake output (since it's fixed within the SDK)
f.write('BUILDCFG_HEADER = ""\n')
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()