Re: [oe] bitbake dependency question

2016-12-14 Thread Robert Cagle
That's a great idea, I hadn't thought of bbappending my own package.
I'll give that a try. Thanks!

--Bob 


From: openembedded-devel-boun...@lists.openembedded.org 
[openembedded-devel-boun...@lists.openembedded.org] on behalf of Khem Raj 
[raj.k...@gmail.com]
Sent: Wednesday, December 14, 2016 12:22 PM
To: openembeded-devel
Cc: Paul Eggleton
Subject: Re: [oe] bitbake dependency question

On Tue, Dec 13, 2016 at 3:39 PM, Robert Cagle
 wrote:
> Hi Paul,
> Thanks for the response.
>
>> Another way to handle this kind of situation with plugins is to simply build
>> them all with all dependencies, and have the runtime design such that it's
>> fully flexible as to which plugins are installed - then you just make the
>> choice in the image. (Perhaps what you're building is already that way and
>> you're just trying to save on build time?)
>
> Unfortunately in this particular case it is more of a "compile-time plugin". 
> RecipeD
> generates and compiles a C file based on artifacts left in /usr/share by its
> dependencies (Recipes A, B, and/or C), so runtime configuration isn't an 
> option.
> In this case including unused plugins would cause incorrect results.

you can insert the DEPENDS from distribution layer via a bbappend into recipe
of packageD and ensure that plugin packages install the needed spec files during
do_install so they get staged into staging sysroot before packageD
starts to configure
itself. you might even use PACKAGECONFIG to control it.

>
> It appears this form of dependency isn't supported in OE, so I'll either use a
> variable defined in local.conf or more likely restructure the app so the 
> plugins
> and their host are all built within a single recipe/build.
>
> Thanks for the info though, it is all very interesting.
>
>> Cheers,
>> Paul
>>
>> --
>>
>> Paul Eggleton
>> Intel Open Source Technology Centre
>
> -Bob
> --
> ___
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
--
___
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
-- 
___
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel


Re: [oe] bitbake dependency question

2016-12-14 Thread Khem Raj
On Tue, Dec 13, 2016 at 3:39 PM, Robert Cagle
 wrote:
> Hi Paul,
> Thanks for the response.
>
>> Another way to handle this kind of situation with plugins is to simply build
>> them all with all dependencies, and have the runtime design such that it's
>> fully flexible as to which plugins are installed - then you just make the
>> choice in the image. (Perhaps what you're building is already that way and
>> you're just trying to save on build time?)
>
> Unfortunately in this particular case it is more of a "compile-time plugin". 
> RecipeD
> generates and compiles a C file based on artifacts left in /usr/share by its
> dependencies (Recipes A, B, and/or C), so runtime configuration isn't an 
> option.
> In this case including unused plugins would cause incorrect results.

you can insert the DEPENDS from distribution layer via a bbappend into recipe
of packageD and ensure that plugin packages install the needed spec files during
do_install so they get staged into staging sysroot before packageD
starts to configure
itself. you might even use PACKAGECONFIG to control it.

>
> It appears this form of dependency isn't supported in OE, so I'll either use a
> variable defined in local.conf or more likely restructure the app so the 
> plugins
> and their host are all built within a single recipe/build.
>
> Thanks for the info though, it is all very interesting.
>
>> Cheers,
>> Paul
>>
>> --
>>
>> Paul Eggleton
>> Intel Open Source Technology Centre
>
> -Bob
> --
> ___
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
-- 
___
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel


Re: [oe] bitbake dependency question

2016-12-13 Thread Robert Cagle
Hi Paul,
Thanks for the response.

> Another way to handle this kind of situation with plugins is to simply build
> them all with all dependencies, and have the runtime design such that it's
> fully flexible as to which plugins are installed - then you just make the
> choice in the image. (Perhaps what you're building is already that way and
> you're just trying to save on build time?)

Unfortunately in this particular case it is more of a "compile-time plugin". 
RecipeD 
generates and compiles a C file based on artifacts left in /usr/share by its 
dependencies (Recipes A, B, and/or C), so runtime configuration isn't an 
option. 
In this case including unused plugins would cause incorrect results. 

It appears this form of dependency isn't supported in OE, so I'll either use a
variable defined in local.conf or more likely restructure the app so the 
plugins 
and their host are all built within a single recipe/build.  

Thanks for the info though, it is all very interesting.

> Cheers,
> Paul
> 
> --
> 
> Paul Eggleton
> Intel Open Source Technology Centre

-Bob
-- 
___
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel


Re: [oe] bitbake dependency question

2016-12-13 Thread Paul Eggleton
Hi Robert,

On Tue, 13 Dec 2016 04:47:31 Robert Cagle wrote:
> Robert Yang wrote:
> > Try something like:
> > In recipeD.bb:
> > PLUGIN_RECIPES ??= "A" (or b, c)
> > DEPENDS = "${PLUGIN_RECIPES} other..."
> > 
> > In local.conf:
> > PLUGIN_RECIPES = "A" (or b, c).
> 
> Hi Robert,
> Thanks for the response! My current solution is similar to what you suggest:
> 
> local.conf
> PLUGIN_RECIPES = "recipeA recipeB recipeC"
> 
> recipeD.bb:
> DEPENDS = "${PLUGIN_RECIPES} other"
> 
> I'm assuming the weak reference in 'PLUGIN_RECIPES ??= "A" (or b, c)'  is to
> prevent errors if someone forgets to define PLUGIN_RECIPES in local.conf?

Correct, ??= is a "weak" or "lazy" default.
 
> I was hoping to do something like this in an image recipe:
> my-image.bb:
>IMAGE_INSTALL_append = " recipeA  recipeB recipeC recipeD"
> and have the rest happen automatically based on the contents of those
> recipes.
> 
> However, maybe I could at least do:
> my-image.bb:
>IMAGE_INSTALL_append = " ${PLUGIN_RECIPES} recipeD  other..."

This will almost certainly be fine in your case, but something to bear in mind 
is that IMAGE_INSTALL refers to packages, not recipes. By default the main 
package of a recipe is the same name as the recipe, but it doesn't have to be 
that way.

> and have everything controlled from local.conf by one variable. I'd rather
> have it the other way around (defined once in my-image.bb), but I can live
> with this. Thanks again!

FYI, one of the basic principles of the way OE works is that one recipe cannot 
affect the processing of another except by way of the sysroot (and then the 
first recipe must also be in the second's DEPENDS) - many other parts of the 
system rest upon this design. Hence why you can't say "in this image I want 
this other recipe built in this way, and in that image I want it built in that 
other way". All you get to control in an image recipe is which packages to 
include, and maybe do some post-processing. Of course, you can set variables 
at the configuration level and have multiple recipes pick it up, as in the 
above example.

Another way to handle this kind of situation with plugins is to simply build 
them all with all dependencies, and have the runtime design such that it's 
fully flexible as to which plugins are installed - then you just make the 
choice in the image. (Perhaps what you're building is already that way and 
you're just trying to save on build time?)

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre
-- 
___
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel


Re: [oe] bitbake dependency question

2016-12-12 Thread Robert Cagle
> Try something like:
> In recipeD.bb:
> PLUGIN_RECIPES ??= "A" (or b, c)
> DEPENDS = "${PLUGIN_RECIPES} other..."

> In local.conf:
> PLUGIN_RECIPES = "A" (or b, c).

Hi Robert,
Thanks for the response! My current solution is similar to what you suggest:

local.conf
PLUGIN_RECIPES = "recipeA recipeB recipeC"

recipeD.bb:
DEPENDS = "${PLUGIN_RECIPES} other"

I'm assuming the weak reference in 'PLUGIN_RECIPES ??= "A" (or b, c)'  is to 
prevent errors if someone forgets to define PLUGIN_RECIPES in local.conf?

I was hoping to do something like this in an image recipe:
my-image.bb:
   IMAGE_INSTALL_append = " recipeA  recipeB recipeC recipeD"
and have the rest happen automatically based on the contents of those recipes.

However, maybe I could at least do:
my-image.bb:
   IMAGE_INSTALL_append = " ${PLUGIN_RECIPES} recipeD  other..."

and have everything controlled from local.conf by one variable. I'd rather have 
it the other way around (defined once in my-image.bb), but I can live with 
this. Thanks again!

-Bob

From: Robert Yang [liezhi.y...@windriver.com]
Sent: Monday, December 12, 2016 6:33 PM
To: openembedded-devel@lists.openembedded.org; Robert Cagle
Subject: Re: [oe] bitbake dependency question

Hi Robert

On 12/13/2016 10:10 AM, Robert Cagle wrote:
> I'm trying to figure out a reasonable way to specify dependencies on an 
> unknown/virtual set of other recipes.
> For example,
>
> Recipe A: Plugin #1 (installs a plugin spec somewhere in /usr/share)
> Recipe B: Plugin #2 (same)
> Recipe C: Plugin #3 (same).
> Recipe D: Host Application (C based), which needs to be compiled last since 
> it generates C code based on the spec files.
>
> I'd rather not hard-code dependencies in Recipe D since the specific set of 
> plugins may be different depending on the specified distribution layer or 
> machine type. I can define a variable in local.conf and use it to define D's 
> dependencies, but that means I'll have to define the set twice: in the 
> distribution layer and in local.conf. Based on what I've read and 
> experimented with, this seems be my only choice (other than restructuring the 
> application).
>

Try something like:
In recipeD.bb:
PLUGIN_RECIPES ??= "A" (or b, c)
DEPENDS = "${PLUGIN_RECIPES} other..."

In local.conf:
PLUGIN_RECIPES = "A" (or b, c).

// Robert

> I really just wanted to expand a variable in each of A,B,C
>PLUGIN_RECIPES += "${PN}"
>
> And have D declare
>   DEPENDS = "${PLUGIN_RECIPES} other..."
>
> But that doesn't seem possible. Am I missing another way? (Python datastore 
> maybe?)
>
> Thanks,
> Bob
>
-- 
___
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel


Re: [oe] bitbake dependency question

2016-12-12 Thread Robert Yang

Hi Robert

On 12/13/2016 10:10 AM, Robert Cagle wrote:

I'm trying to figure out a reasonable way to specify dependencies on an 
unknown/virtual set of other recipes.
For example,

Recipe A: Plugin #1 (installs a plugin spec somewhere in /usr/share)
Recipe B: Plugin #2 (same)
Recipe C: Plugin #3 (same).
Recipe D: Host Application (C based), which needs to be compiled last since it 
generates C code based on the spec files.

I'd rather not hard-code dependencies in Recipe D since the specific set of 
plugins may be different depending on the specified distribution layer or 
machine type. I can define a variable in local.conf and use it to define D's 
dependencies, but that means I'll have to define the set twice: in the 
distribution layer and in local.conf. Based on what I've read and experimented 
with, this seems be my only choice (other than restructuring the application).



Try something like:
In recipeD.bb:
PLUGIN_RECIPES ??= "A" (or b, c)
DEPENDS = "${PLUGIN_RECIPES} other..."

In local.conf:
PLUGIN_RECIPES = "A" (or b, c).

// Robert


I really just wanted to expand a variable in each of A,B,C
   PLUGIN_RECIPES += "${PN}"

And have D declare
  DEPENDS = "${PLUGIN_RECIPES} other..."

But that doesn't seem possible. Am I missing another way? (Python datastore 
maybe?)

Thanks,
Bob


--
___
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel


[oe] bitbake dependency question

2016-12-12 Thread Robert Cagle
I'm trying to figure out a reasonable way to specify dependencies on an 
unknown/virtual set of other recipes.
For example,

Recipe A: Plugin #1 (installs a plugin spec somewhere in /usr/share)
Recipe B: Plugin #2 (same)
Recipe C: Plugin #3 (same).
Recipe D: Host Application (C based), which needs to be compiled last since it 
generates C code based on the spec files.

I'd rather not hard-code dependencies in Recipe D since the specific set of 
plugins may be different depending on the specified distribution layer or 
machine type. I can define a variable in local.conf and use it to define D's 
dependencies, but that means I'll have to define the set twice: in the 
distribution layer and in local.conf. Based on what I've read and experimented 
with, this seems be my only choice (other than restructuring the application).

I really just wanted to expand a variable in each of A,B,C 
   PLUGIN_RECIPES += "${PN}"

And have D declare
  DEPENDS = "${PLUGIN_RECIPES} other..."

But that doesn't seem possible. Am I missing another way? (Python datastore 
maybe?)

Thanks,
Bob
-- 
___
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel