All of lore.kernel.org
 help / color / mirror / Atom feed
* howto build specific version package
@ 2016-08-02 14:29 zzs
  2016-08-05  9:06 ` Gary Thomas
  2016-08-05 14:29 ` Khem Raj
  0 siblings, 2 replies; 9+ messages in thread
From: zzs @ 2016-08-02 14:29 UTC (permalink / raw)
  To: bitbake-devel

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

Hello, everyone

I have two version .bb recipe, sya test_1.0.bb and test_2.0.bb.
When build the `test` package  using the flowwing cmd:
    bitbake test
Always 2.0 was built.
My question is: how to let bitbake to build version 1.0 of the test package

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

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

* Re: howto build specific version package
  2016-08-02 14:29 howto build specific version package zzs
@ 2016-08-05  9:06 ` Gary Thomas
  2016-08-05 14:29 ` Khem Raj
  1 sibling, 0 replies; 9+ messages in thread
From: Gary Thomas @ 2016-08-05  9:06 UTC (permalink / raw)
  To: bitbake-devel

On 2016-08-02 16:29, zzs wrote:
> Hello, everyone
>
> I have two version .bb recipe, sya test_1.0.bb and test_2.0.bb.
> When build the `test` package  using the flowwing cmd:
>     bitbake test
> Always 2.0 was built.
> My question is: how to let bitbake to build version 1.0 of the test package
>

Put this line in your in local.conf:

PREFERRED_VERSION_test = "1.0"

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


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

* Re: howto build specific version package
  2016-08-02 14:29 howto build specific version package zzs
  2016-08-05  9:06 ` Gary Thomas
@ 2016-08-05 14:29 ` Khem Raj
  1 sibling, 0 replies; 9+ messages in thread
From: Khem Raj @ 2016-08-05 14:29 UTC (permalink / raw)
  To: zzs, bitbake-devel



On 8/2/16 7:29 AM, zzs wrote:
> Hello, everyone
> 
> I have two version .bb recipe, sya test_1.0.bb and test_2.0.bb.
> When build the `test` package  using the flowwing cmd:
>     bitbake test
> Always 2.0 was built.
> My question is: how to let bitbake to build version 1.0 of the test package
> 

You can add PREFERRED_VERSION_pn-test = "1.0" in local.conf
or you can add DEFAULT_PREFERENCE = "-1" to test_2.0.bb


> 
>  
> 
> 
> 


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

* Re: howto build specific version package
  2016-08-04 11:44       ` Schroeder, Henning
@ 2016-08-05  3:14         ` 张忠山
  0 siblings, 0 replies; 9+ messages in thread
From: 张忠山 @ 2016-08-05  3:14 UTC (permalink / raw)
  To: bitbake-devel

在 2016年08月04日 19:44, Schroeder, Henning 写道:
>> -----Original Message-----
>> From: bitbake-devel-bounces@lists.openembedded.org [mailto:bitbake-
>> devel-bounces@lists.openembedded.org] On Behalf Of Richard Purdie
>> Sent: Wednesday, August 3, 2016 17:23
>> To: 张忠山 <zzs213@126.com>; Yang, Liezhi (Wind River)
>> <liezhi.yang@windriver.com>; bitbake-devel@lists.openembedded.org
>> Subject: Re: [bitbake-devel] howto build specific version package
>>
>> On Wed, 2016-08-03 at 14:14 +0800, 张忠山 wrote:
>>> 在 2016年08月02日 22:56, Robert Yang 写道:
>>>> Hi,
>>>>
>>>> On 08/02/2016 10:34 PM, zzs wrote:
>>>>>
>>>>>
>>>>> Hello, everyone
>>>>>
>>>>> I have two version .bb recipe, sya test_1.0.bb and test_2.0.bb.
>>>>> When build the `test` package  using the flowwing cmd:
>>>>>      bitbake test
>>>>> Always 2.0 was built.
>>>>> My question is: how to let bitbake to build version 1.0 of the
>>>>> test package
>>>>
>>>> You can:
>>>> 1) PREFERRED_VERSION_test = "1.0" in conf file such as local.conf
>>>> Or:
>>>> 2) Set DEFAULT_PREFERENCE = "-1" in test_2.0.bb.
>>>>
>>>> // Robert
>>>>
>>> Thanks for your repley.
>>>
>>> Your suggested method can select any version sure.
>>>
>>> But whenever I finish  my project. some time later I wan't rebuilt
>>> this project.
>>> Then I must edit the source to select specific version. It is not
>>> convenient and buggy.
>>> Is there a way to select version that no need to edit the source, e.g.
>>> select it on command line
>>
>> You can't select everything from the commandline. Its for the reasons of
>> reproducibility that we suggest people set things in configuration files like
>> local.conf. You can then provide the exact configuration to reproduce any
>> given build by saving that configuration file.
>>
>> Cheers,
>>
>> Richard
>
> Hi,
> I do see two options for you.
> 1.) As explained by the folks already you create two build directories which share download and sstate folders. Then you create one local.conf with the "Production Version" and one with the "Development Version". Depending on which build folder you utilize you get the product or development version.
> 2.) If you incline to use the command line to switch, there is the option to specify a config file explicitely read by bitbake. If called with "-R product.conf" you get your product version and otherwise you stick with Yocto choice of taking newest one.
>
> Example:
> bash-4.3$ cat -> product.conf
> PREFERRED_VERSION_test="1.0"
> bash-4.3$ bitbake -R product.conf test
> ...
>
> Option One is the most conflict free variant as your configurations are cleanly separated and your calls to bitbake are identical. At the cost of having the build directory two times and two different environments (Shell instances).
> Option Two is risky if you do not tell bitbake to clean (bitbake -c cleanall test) from the former build as you may end up with a mixed sysroot.
>
> Hope this helps.
>

Thanks very much.
Now I use the second option.




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

* Re: howto build specific version package
  2016-08-03 15:23     ` Richard Purdie
@ 2016-08-04 11:44       ` Schroeder, Henning
  2016-08-05  3:14         ` 张忠山
  0 siblings, 1 reply; 9+ messages in thread
From: Schroeder, Henning @ 2016-08-04 11:44 UTC (permalink / raw)
  To: Richard Purdie, ???, Yang, Liezhi (Wind River), bitbake-devel

> -----Original Message-----
> From: bitbake-devel-bounces@lists.openembedded.org [mailto:bitbake-
> devel-bounces@lists.openembedded.org] On Behalf Of Richard Purdie
> Sent: Wednesday, August 3, 2016 17:23
> To: 张忠山 <zzs213@126.com>; Yang, Liezhi (Wind River)
> <liezhi.yang@windriver.com>; bitbake-devel@lists.openembedded.org
> Subject: Re: [bitbake-devel] howto build specific version package
> 
> On Wed, 2016-08-03 at 14:14 +0800, 张忠山 wrote:
> > 在 2016年08月02日 22:56, Robert Yang 写道:
> > > Hi,
> > >
> > > On 08/02/2016 10:34 PM, zzs wrote:
> > > >
> > > >
> > > > Hello, everyone
> > > >
> > > > I have two version .bb recipe, sya test_1.0.bb and test_2.0.bb.
> > > > When build the `test` package  using the flowwing cmd:
> > > >      bitbake test
> > > > Always 2.0 was built.
> > > > My question is: how to let bitbake to build version 1.0 of the
> > > > test package
> > >
> > > You can:
> > > 1) PREFERRED_VERSION_test = "1.0" in conf file such as local.conf
> > > Or:
> > > 2) Set DEFAULT_PREFERENCE = "-1" in test_2.0.bb.
> > >
> > > // Robert
> > >
> > Thanks for your repley.
> >
> > Your suggested method can select any version sure.
> >
> > But whenever I finish  my project. some time later I wan't rebuilt
> > this project.
> > Then I must edit the source to select specific version. It is not
> > convenient and buggy.
> > Is there a way to select version that no need to edit the source, e.g.
> > select it on command line
> 
> You can't select everything from the commandline. Its for the reasons of
> reproducibility that we suggest people set things in configuration files like
> local.conf. You can then provide the exact configuration to reproduce any
> given build by saving that configuration file.
> 
> Cheers,
> 
> Richard

Hi,
I do see two options for you.
1.) As explained by the folks already you create two build directories which share download and sstate folders. Then you create one local.conf with the "Production Version" and one with the "Development Version". Depending on which build folder you utilize you get the product or development version. 
2.) If you incline to use the command line to switch, there is the option to specify a config file explicitely read by bitbake. If called with "-R product.conf" you get your product version and otherwise you stick with Yocto choice of taking newest one.

Example:
bash-4.3$ cat -> product.conf
PREFERRED_VERSION_test="1.0"
bash-4.3$ bitbake -R product.conf test
...

Option One is the most conflict free variant as your configurations are cleanly separated and your calls to bitbake are identical. At the cost of having the build directory two times and two different environments (Shell instances).
Option Two is risky if you do not tell bitbake to clean (bitbake -c cleanall test) from the former build as you may end up with a mixed sysroot.

Hope this helps.

Kind Regards
 Henning
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

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

* Re: howto build specific version package
  2016-08-03  6:14   ` 张忠山
@ 2016-08-03 15:23     ` Richard Purdie
  2016-08-04 11:44       ` Schroeder, Henning
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Purdie @ 2016-08-03 15:23 UTC (permalink / raw)
  To: 张忠山, Robert Yang, bitbake-devel

On Wed, 2016-08-03 at 14:14 +0800, 张忠山 wrote:
> 在 2016年08月02日 22:56, Robert Yang 写道:
> > Hi,
> > 
> > On 08/02/2016 10:34 PM, zzs wrote:
> > > 
> > > 
> > > Hello, everyone
> > > 
> > > I have two version .bb recipe, sya test_1.0.bb and test_2.0.bb.
> > > When build the `test` package  using the flowwing cmd:
> > >      bitbake test
> > > Always 2.0 was built.
> > > My question is: how to let bitbake to build version 1.0 of the
> > > test
> > > package
> > 
> > You can:
> > 1) PREFERRED_VERSION_test = "1.0" in conf file such as local.conf
> > Or:
> > 2) Set DEFAULT_PREFERENCE = "-1" in test_2.0.bb.
> > 
> > // Robert
> > 
> Thanks for your repley.
> 
> Your suggested method can select any version sure.
> 
> But whenever I finish  my project. some time later I wan't rebuilt
> this 
> project.
> Then I must edit the source to select specific version. It is not 
> convenient and buggy.
> Is there a way to select version that no need to edit the source,
> e.g. 
> select it on command line

You can't select everything from the commandline. Its for the reasons
of reproducibility that we suggest people set things in configuration
files like local.conf. You can then provide the exact configuration to
reproduce any given build by saving that configuration file.

Cheers,

Richard




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

* Re: howto build specific version package
  2016-08-02 14:56 ` Robert Yang
@ 2016-08-03  6:14   ` 张忠山
  2016-08-03 15:23     ` Richard Purdie
  0 siblings, 1 reply; 9+ messages in thread
From: 张忠山 @ 2016-08-03  6:14 UTC (permalink / raw)
  To: Robert Yang, bitbake-devel

在 2016年08月02日 22:56, Robert Yang 写道:
> Hi,
>
> On 08/02/2016 10:34 PM, zzs wrote:
>>
>>
>> Hello, everyone
>>
>> I have two version .bb recipe, sya test_1.0.bb and test_2.0.bb.
>> When build the `test` package  using the flowwing cmd:
>>      bitbake test
>> Always 2.0 was built.
>> My question is: how to let bitbake to build version 1.0 of the test
>> package
>
> You can:
> 1) PREFERRED_VERSION_test = "1.0" in conf file such as local.conf
> Or:
> 2) Set DEFAULT_PREFERENCE = "-1" in test_2.0.bb.
>
> // Robert
>
Thanks for your repley.

Your suggested method can select any version sure.

But whenever I finish  my project. some time later I wan't rebuilt this 
project.
Then I must edit the source to select specific version. It is not 
convenient and buggy.
Is there a way to select version that no need to edit the source, e.g. 
select it on command line





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

* Re: howto build specific version package
  2016-08-02 14:34 zzs
@ 2016-08-02 14:56 ` Robert Yang
  2016-08-03  6:14   ` 张忠山
  0 siblings, 1 reply; 9+ messages in thread
From: Robert Yang @ 2016-08-02 14:56 UTC (permalink / raw)
  To: zzs, bitbake-devel

Hi,

On 08/02/2016 10:34 PM, zzs wrote:
>
>
> Hello, everyone
>
> I have two version .bb recipe, sya test_1.0.bb and test_2.0.bb.
> When build the `test` package  using the flowwing cmd:
>      bitbake test
> Always 2.0 was built.
> My question is: how to let bitbake to build version 1.0 of the test package

You can:
1) PREFERRED_VERSION_test = "1.0" in conf file such as local.conf
Or:
2) Set DEFAULT_PREFERENCE = "-1" in test_2.0.bb.

// Robert

>
>
>
>
>


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

* howto build specific version package
@ 2016-08-02 14:34 zzs
  2016-08-02 14:56 ` Robert Yang
  0 siblings, 1 reply; 9+ messages in thread
From: zzs @ 2016-08-02 14:34 UTC (permalink / raw)
  To: bitbake-devel



Hello, everyone

I have two version .bb recipe, sya test_1.0.bb and test_2.0.bb.
When build the `test` package  using the flowwing cmd:
    bitbake test
Always 2.0 was built.
My question is: how to let bitbake to build version 1.0 of the test package 



 

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

end of thread, other threads:[~2016-08-05 14:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-02 14:29 howto build specific version package zzs
2016-08-05  9:06 ` Gary Thomas
2016-08-05 14:29 ` Khem Raj
2016-08-02 14:34 zzs
2016-08-02 14:56 ` Robert Yang
2016-08-03  6:14   ` 张忠山
2016-08-03 15:23     ` Richard Purdie
2016-08-04 11:44       ` Schroeder, Henning
2016-08-05  3:14         ` 张忠山

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.