[OE-core] [PATCHv2 4/6] devtool: also load plugins from BBPATH

Christopher Larson kergoth at gmail.com
Wed Jul 22 15:36:34 UTC 2015


On Wed, Jul 22, 2015 at 4:02 AM, Paul Eggleton <
paul.eggleton at linux.intel.com> wrote:

> On Monday 20 July 2015 15:15:54 Christopher Larson wrote:
> > From: Christopher Larson <chris_larson at mentor.com>
> >
> > This makes it easier to extend, as a layer can add its own sub-commands.
> >
> > tinfoil is now passed into the commands, as we needed to parse the
> > configuration metadata to get BBPATH, and we don't want to construct
> tinfoil
> > more than once, otherwise we have to deal with startup and shutdown of
> > cooker.
>
> Hmm, but tinfoil is being constructed twice, right? I think what you've
> implemented is correct (and the only way it can really work), but this
> comment
> doesn't seem to match up with the actual changes.
>

Yeah, that’s correct. My initial implementation did what the commit message
says, but of course that’s a problem for devtool commands that call out to
recipetool, since recipetool constructs its own, so needs to acquire the
bitbake lock itself. So I reworked it to construct and then throw away the
initial instance instead, and leave it up to the subcommands to control
whether they need a tinfoil instance the way they did previously. I’ll fix
the commit message.

> +    tinfoil = setup_tinfoil(config_only=True)
> > +    for path in ([scripts_path] +
> > +                 tinfoil.config_data.getVar('BBPATH', True).split(':')):
> > +        pluginpath = os.path.join(path, 'lib', 'devtool')
> > +        scriptutils.load_plugins(logger, plugins, pluginpath)
> > +    tinfoil.cooker.shutdown(force=True)
> > +    tinfoil.cooker.unlockBitbake()
>
> FYI I think Richard is about to add a shutdown method to tinfoil itself
> that

will do what's needed here; however we can tidy this up after that's added.


Cool, that would definitely be cleaner than poking into its internals.
-- 
Christopher Larson
kergoth at gmail dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20150722/3c0a3b77/attachment-0002.html>


More information about the Openembedded-core mailing list