Created
May 18, 2017 14:36
-
-
Save avoltz/e28fb3d6d9980f2d8c073e0d146cbc69 to your computer and use it in GitHub Desktop.
This test script reproduces a NameError in bitbake generateTargetsTree command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import os | |
bindir = os.path.dirname(__file__) | |
topdir = os.path.dirname(bindir) | |
sys.path[0:0] = [os.path.join(topdir, 'lib')] | |
from bb.tinfoil import Tinfoil | |
from bb.cooker import CookerFeatures | |
import logging | |
logger = logging.getLogger('BitBake.Test') | |
logger.addHandler(logging.StreamHandler()) | |
logger.setLevel(logging.INFO) | |
tf = Tinfoil() | |
tf.prepare(config_only=True, extra_features=[CookerFeatures.HOB_EXTRA_CACHES]) | |
tf.set_event_mask(['bb.event.NoProvider', 'bb.event.DepTreeGenerated', 'bb.command.CommandCompleted', 'bb.event.TargetsTreeGenerated', 'bb.command.CommandFailed']) | |
try: | |
tf.run_command('generateTargetsTree', None, ['core-image-minimal']) | |
event = None | |
while not isinstance(event, (bb.event.NoProvider, bb.event.DepTreeGenerated, bb.command.CommandCompleted, bb.event.TargetsTreeGenerated, bb.command.CommandFailed)): | |
event = tf.wait_event(60) | |
if isinstance(event, (bb.command.CommandFailed)): | |
logger.info("message %s" % event.error) | |
else: | |
logger.info("event is %s" % event) | |
except Exception as e: | |
import traceback | |
logger.error("exception %s" % e.format_exc()) | |
tf.shutdown() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment