All of lore.kernel.org
 help / color / mirror / Atom feed
* PREFERRED_VERSION_pn-: which version is selected?
@ 2021-02-08 10:52 Mauro Ziliani
  2021-02-08 11:09 ` [yocto] " Josef Holzmayr
  2021-02-08 11:14 ` Quentin Schulz
  0 siblings, 2 replies; 7+ messages in thread
From: Mauro Ziliani @ 2021-02-08 10:52 UTC (permalink / raw)
  To: Yocto-mailing-list

Hi all.

I'm working with Krogoth on imx6


I have the same recipe with different versions

recipe1_0.9.bb

recipe1_1.0.bb


In the image recipe I put


image-recipe.bb

IMAGE_INSTALL_append := " \

     recipe1 \

"

PREFERRED_VERSION_pn-recipe1 := "0.9"


If I do

  bitbake -s

I get

recipe1    :1.0-r0


If I do

bitbake image-recipe


in image-recipe.manifest I look

recipe1  1.0-r0


Why is not selected the preferred version?

How can I choose the recipe's version I'd like?


Best regards,

    MZ


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] PREFERRED_VERSION_pn-: which version is selected?
  2021-02-08 10:52 PREFERRED_VERSION_pn-: which version is selected? Mauro Ziliani
@ 2021-02-08 11:09 ` Josef Holzmayr
  2021-02-08 11:12   ` Martin Jansa
  2021-02-08 16:23   ` Mauro Ziliani
  2021-02-08 11:14 ` Quentin Schulz
  1 sibling, 2 replies; 7+ messages in thread
From: Josef Holzmayr @ 2021-02-08 11:09 UTC (permalink / raw)
  To: Mauro Ziliani; +Cc: Yocto-mailing-list

Howdy!

Am Mo., 8. Feb. 2021 um 11:52 Uhr schrieb Mauro Ziliani <mauro@faresoftware.it>:
> In the image recipe I put
>
> image-recipe.bb
>
> IMAGE_INSTALL_append := " \
>      recipe1 \
> "
>
> PREFERRED_VERSION_pn-recipe1 := "0.9"

As usual, recipe data is local, conf data is global. Setting things
that should affect other recipes (like PREFERRED_VERSION) does not
work inside a recipe - and an image recipe is still just a recipe.
This needs to go into the DISTRO config, usually.

Greetz

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] PREFERRED_VERSION_pn-: which version is selected?
  2021-02-08 11:09 ` [yocto] " Josef Holzmayr
@ 2021-02-08 11:12   ` Martin Jansa
  2021-02-08 16:23   ` Mauro Ziliani
  1 sibling, 0 replies; 7+ messages in thread
From: Martin Jansa @ 2021-02-08 11:12 UTC (permalink / raw)
  To: Josef Holzmayr; +Cc: Mauro Ziliani, Yocto-mailing-list

[-- Attachment #1: Type: text/plain, Size: 750 bytes --]

And the variable should be named PREFERRED_VERSION_recipe1 (it's not using
pn as an override).

On Mon, Feb 8, 2021 at 12:10 PM Josef Holzmayr <jester@theyoctojester.info>
wrote:

> Howdy!
>
> Am Mo., 8. Feb. 2021 um 11:52 Uhr schrieb Mauro Ziliani <
> mauro@faresoftware.it>:
> > In the image recipe I put
> >
> > image-recipe.bb
> >
> > IMAGE_INSTALL_append := " \
> >      recipe1 \
> > "
> >
> > PREFERRED_VERSION_pn-recipe1 := "0.9"
>
> As usual, recipe data is local, conf data is global. Setting things
> that should affect other recipes (like PREFERRED_VERSION) does not
> work inside a recipe - and an image recipe is still just a recipe.
> This needs to go into the DISTRO config, usually.
>
> Greetz
>
> 
>
>

[-- Attachment #2: Type: text/html, Size: 1261 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] PREFERRED_VERSION_pn-: which version is selected?
  2021-02-08 10:52 PREFERRED_VERSION_pn-: which version is selected? Mauro Ziliani
  2021-02-08 11:09 ` [yocto] " Josef Holzmayr
@ 2021-02-08 11:14 ` Quentin Schulz
  2021-02-08 16:24   ` Mauro Ziliani
  1 sibling, 1 reply; 7+ messages in thread
From: Quentin Schulz @ 2021-02-08 11:14 UTC (permalink / raw)
  To: Mauro Ziliani; +Cc: Yocto-mailing-list

Hi Mauro,

On Mon, Feb 08, 2021 at 11:52:33AM +0100, Mauro Ziliani wrote:
> Hi all.
> 
> I'm working with Krogoth on imx6
> 
> 
> I have the same recipe with different versions
> 
> recipe1_0.9.bb
> 
> recipe1_1.0.bb
> 
> 
> In the image recipe I put
> 
> 
> image-recipe.bb
> 
> IMAGE_INSTALL_append := " \
> 
>     recipe1 \
> 
> "
> 
> PREFERRED_VERSION_pn-recipe1 := "0.9"
> 

Yocto chant #1: Recipe data is local, conf data is global.

In other words, you cannot modify other recipes from one recipe.

Since image recipes are recipes, your PREFERRED_VERSION ni your image
recipe is effectively a no-op.

On a side note, := operator is rarely seen outside of
FILESEXTRAPATHS_prepend in bbappend, try to keep it this way.

> 
> If I do
> 
>  bitbake -s
> 
> I get
> 
> recipe1    :1.0-r0
> 
> 
> If I do
> 
> bitbake image-recipe
> 
> 
> in image-recipe.manifest I look
> 
> recipe1  1.0-r0
> 
> 
> Why is not selected the preferred version?
> 
> How can I choose the recipe's version I'd like?
> 

In a configuration file: local.conf, distro.conf, machine.conf.

Though, it is heavily discouraged to use local.conf for anything except
debugging sessions, as it is meant only for **local** configuration and
isn't supposed to be versioned.

Cheers,
Quentin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] PREFERRED_VERSION_pn-: which version is selected?
  2021-02-08 11:09 ` [yocto] " Josef Holzmayr
  2021-02-08 11:12   ` Martin Jansa
@ 2021-02-08 16:23   ` Mauro Ziliani
  2021-02-08 16:57     ` Quentin Schulz
  1 sibling, 1 reply; 7+ messages in thread
From: Mauro Ziliani @ 2021-02-08 16:23 UTC (permalink / raw)
  To: Josef Holzmayr; +Cc: Yocto-mailing-list

My purpose is this.

For image-recipe_1.0.0 I need recip1 version 0.9

For image-recipe_1.1.0 I need recip1 version 1.0


How I can solve this?


Best regards

   MZ


Il 08/02/21 12:09, Josef Holzmayr ha scritto:
> Howdy!
>
> Am Mo., 8. Feb. 2021 um 11:52 Uhr schrieb Mauro Ziliani <mauro@faresoftware.it>:
>> In the image recipe I put
>>
>> image-recipe.bb
>>
>> IMAGE_INSTALL_append := " \
>>       recipe1 \
>> "
>>
>> PREFERRED_VERSION_pn-recipe1 := "0.9"
> As usual, recipe data is local, conf data is global. Setting things
> that should affect other recipes (like PREFERRED_VERSION) does not
> work inside a recipe - and an image recipe is still just a recipe.
> This needs to go into the DISTRO config, usually.
>
> Greetz

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] PREFERRED_VERSION_pn-: which version is selected?
  2021-02-08 11:14 ` Quentin Schulz
@ 2021-02-08 16:24   ` Mauro Ziliani
  0 siblings, 0 replies; 7+ messages in thread
From: Mauro Ziliani @ 2021-02-08 16:24 UTC (permalink / raw)
  To: Quentin Schulz; +Cc: Yocto-mailing-list

Thanks all for suggestions ed corrections

MZ

Il 08/02/21 12:14, Quentin Schulz ha scritto:
> Hi Mauro,
>
> On Mon, Feb 08, 2021 at 11:52:33AM +0100, Mauro Ziliani wrote:
>> Hi all.
>>
>> I'm working with Krogoth on imx6
>>
>>
>> I have the same recipe with different versions
>>
>> recipe1_0.9.bb
>>
>> recipe1_1.0.bb
>>
>>
>> In the image recipe I put
>>
>>
>> image-recipe.bb
>>
>> IMAGE_INSTALL_append := " \
>>
>>      recipe1 \
>>
>> "
>>
>> PREFERRED_VERSION_pn-recipe1 := "0.9"
>>
> Yocto chant #1: Recipe data is local, conf data is global.
>
> In other words, you cannot modify other recipes from one recipe.
>
> Since image recipes are recipes, your PREFERRED_VERSION ni your image
> recipe is effectively a no-op.
>
> On a side note, := operator is rarely seen outside of
> FILESEXTRAPATHS_prepend in bbappend, try to keep it this way.
>
>> If I do
>>
>>   bitbake -s
>>
>> I get
>>
>> recipe1    :1.0-r0
>>
>>
>> If I do
>>
>> bitbake image-recipe
>>
>>
>> in image-recipe.manifest I look
>>
>> recipe1  1.0-r0
>>
>>
>> Why is not selected the preferred version?
>>
>> How can I choose the recipe's version I'd like?
>>
> In a configuration file: local.conf, distro.conf, machine.conf.
>
> Though, it is heavily discouraged to use local.conf for anything except
> debugging sessions, as it is meant only for **local** configuration and
> isn't supposed to be versioned.
>
> Cheers,
> Quentin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] PREFERRED_VERSION_pn-: which version is selected?
  2021-02-08 16:23   ` Mauro Ziliani
@ 2021-02-08 16:57     ` Quentin Schulz
  0 siblings, 0 replies; 7+ messages in thread
From: Quentin Schulz @ 2021-02-08 16:57 UTC (permalink / raw)
  To: Mauro Ziliani; +Cc: Josef Holzmayr, Yocto-mailing-list

Hi Mauro,

On Mon, Feb 08, 2021 at 05:23:36PM +0100, Mauro Ziliani wrote:
> My purpose is this.
> 
> For image-recipe_1.0.0 I need recip1 version 0.9
> 
> For image-recipe_1.1.0 I need recip1 version 1.0
> 

You can't. Because recipes cannot impact other recipes.

Now there's a catch, which applies to a VERY specific corner case.

Let's say recip1 is a final package (recip1 recipe is in no DEPENDS of any
recipe, recip1 recipe packages are in no RDEPENDS, only recip1 packages are
mentioned in image recipes).

You can rename recip1_0.9 to recip109_0.9.bb and in your
image-recipe_1.0.0 add recip109 to IMAGE_INSTALL.
in image-recipe_1.1.0 have recip1 in IMAGE_INSTALL.

Obviously, since the recipe name is now different, they are different
recipes to Yocto, which means DEPENDS and RDEPENDS won't be
automatically "updated" to get the version you selected in image-recipe
(because... recipes can't modify other recipes).

Cheers,
Quentin

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-02-08 16:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-08 10:52 PREFERRED_VERSION_pn-: which version is selected? Mauro Ziliani
2021-02-08 11:09 ` [yocto] " Josef Holzmayr
2021-02-08 11:12   ` Martin Jansa
2021-02-08 16:23   ` Mauro Ziliani
2021-02-08 16:57     ` Quentin Schulz
2021-02-08 11:14 ` Quentin Schulz
2021-02-08 16:24   ` Mauro Ziliani

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.