Skip to contentSkip to conversation

How to request a certain version of a recipes for an image?

DISCUSSION Patrick Boettcher 3 participants 4 messages Nov 4, 2018 – Nov 5, 2018

lore
Share & tools
lore
#0 lore raw

Hi list,

I'm using the morty-release for my device.

My sources consists of different layers. Some application specific-layers (which contains a image-recipe), our BSP-provider and tooling-layers.

It now happens that in there is package (dt-utils) which has recipes in two different layers, with different versions.

In my image-file I request the package via

    IMAGE_INSTALL += "dt-utils"

How do I force the version of dt-utils for this image? By default it selects the wrong one.

Here's what I tried, by adding to the image-recipe:

    DEPENDS += "dt-utils (>= 2017.03.0)"

and

    RDEPENDS += "dt-utils (>= 2017.03.0)"

seems to have no effect. Adding the version-logic to the IMAGE_INSTALL-line fails to build.

What works is to add PREFERRED_VERSION to local.conf. But this is not committable, so I'd like to avoid it.

Thanks.

best regards,
--
Patrick.

#1 lore raw
Quoted 24 lines · Patrick Boettcher

Hi list,

I'm using the morty-release for my device.

My sources consists of different layers. Some application specific-layers (which contains a image-recipe), our BSP-provider and tooling-layers.

It now happens that in there is package (dt-utils) which has recipes in two different layers, with different versions.

In my image-file I request the package via

     IMAGE_INSTALL += "dt-utils"

How do I force the version of dt-utils for this image? By default it selects the wrong one.

Here's what I tried, by adding to the image-recipe:

     DEPENDS += "dt-utils (>= 2017.03.0)"

and

Quoted 7 lines
     RDEPENDS += "dt-utils (>= 2017.03.0)"

seems to have no effect. Adding the version-logic to the IMAGE_INSTALL-line fails to build.

What works is to add PREFERRED_VERSION to local.conf. But this is not committable, so I'd like to avoid it.

Can't you use PREFERRED_VERSION and commit that in one of the layers that you control?

eg:

$ cd .../meta-virtualization.git
$ grep -r PREFERRED_VERSION .| head -1
./conf/distro/include/meta-virt-default-versions.inc:PREFERRED_VERSION_python-blinker = "1.3"

../Randy

Quoted 9 lines

Thanks.

best regards,
--
Patrick.

Signature · 2 lines
# Randy MacLeod
# Wind River Linux
#2 lore raw
In reply to Patrick Boettcher
Quoted 25 lines · Patrick Boettcher

Hi list,

I'm using the morty-release for my device.

My sources consists of different layers. Some application specific-layers (which contains a image-recipe), our BSP-provider and tooling-layers.

It now happens that in there is package (dt-utils) which has recipes in two different layers, with different versions.

In my image-file I request the package via

    IMAGE_INSTALL += "dt-utils"

How do I force the version of dt-utils for this image? By default it selects the wrong one.

Here's what I tried, by adding to the image-recipe:

    DEPENDS += "dt-utils (>= 2017.03.0)"

and

Quoted 7 lines
    RDEPENDS += "dt-utils (>= 2017.03.0)"

seems to have no effect. Adding the version-logic to the IMAGE_INSTALL-line fails to build.

What works is to add PREFERRED_VERSION to local.conf. But this is not committable, so I'd like to avoid it.

You can't directly influence the build of one recipe (ie dt-utils) by making a change in another recipe (ie the image recipe), so the DEPENDS and RDEPENDS style changes you have tried will not work. Variables in the image recipe are not visible when the dt-utils recipe is built.

Setting PREFERRED_VERSION from a global config file is a valid solution. In that case it's up to you to decide which global config to use - adding to local.conf, the machine config, the distro config, a meta layer config file will all work. Using either the distro or machine config would be the most typical approach - depending on whether you want to version preference to apply to one build configuration (ie one machine) or to all your builds (ie your distro).

An alternative solution would to be to change the priority of the recipes in the meta layer(s) which contains the dt-utils recipes. e.g. increasing BBFILE_PRIORITY_xxx in the layer.conf in the meta layer with the dt-utils recipe you want to use.

#3 lore raw
Quoted 49 lines · On Sun, 4 Nov 2018 18:38:18 -0800 Andre McCurdy <[email protected]> wrote:
Quoted 25 lines · Patrick Boettcher

Hi list,

I'm using the morty-release for my device.

My sources consists of different layers. Some application specific-layers (which contains a image-recipe), our BSP-provider and tooling-layers.

It now happens that in there is package (dt-utils) which has recipes in two different layers, with different versions.

In my image-file I request the package via

    IMAGE_INSTALL += "dt-utils"

How do I force the version of dt-utils for this image? By default it selects the wrong one.

Here's what I tried, by adding to the image-recipe:

    DEPENDS += "dt-utils (>= 2017.03.0)"

and

Quoted 7 lines
    RDEPENDS += "dt-utils (>= 2017.03.0)"

seems to have no effect. Adding the version-logic to the IMAGE_INSTALL-line fails to build.

What works is to add PREFERRED_VERSION to local.conf. But this is not committable, so I'd like to avoid it.

You can't directly influence the build of one recipe (ie dt-utils) by making a change in another recipe (ie the image recipe), so the DEPENDS and RDEPENDS style changes you have tried will not work. Variables in the image recipe are not visible when the dt-utils recipe is built.

Setting PREFERRED_VERSION from a global config file is a valid solution. In that case it's up to you to decide which global config to use - adding to local.conf, the machine config, the distro config, a meta layer config file will all work. Using either the distro or machine config would be the most typical approach - depending on whether you want to version preference to apply to one build configuration (ie one machine) or to all your builds (ie your distro).

Quoted 4 lines

An alternative solution would to be to change the priority of the recipes in the meta layer(s) which contains the dt-utils recipes. e.g. increasing BBFILE_PRIORITY_xxx in the layer.conf in the meta layer with the dt-utils recipe you want to use.

Thanks Andre, thanks Randy for clearing up my mis-conception of recipes and conf-files.

--
Patrick.