Skip to contentSkip to conversation

howto build specific version package

DISCUSSION zzs 4 participants 6 messages Aug 2, 2016 – Aug 5, 2016

lore
Share & tools
lore

zzs

author
#0 lore raw

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

#1 lore raw

Hi,

Quoted 9 lines · zzs

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

Quoted 5 lines
author
#2 lore raw
Quoted 14 lines · Robert Yang

Hi,

Quoted 10 lines · zzs

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

Quoted 7 lines

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

#3 lore raw
Quoted 27 lines · 张忠山
Quoted 15 lines · Robert Yang

Hi,

Quoted 11 lines · zzs

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

Quoted 7 lines

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.

Quoted 8 lines

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

#4 lore raw
Quoted 42 lines

-----Original Message-----
From: [email protected] [mailto:bitbake- [email protected]] On Behalf Of Richard Purdie
Sent: Wednesday, August 3, 2016 17:23
To: 张忠山 <[email protected]>; Yang, Liezhi (Wind River) <[email protected]>; [email protected]
Subject: Re: [bitbake-devel] howto build specific version package

Quoted 24 lines · 张忠山
Quoted 14 lines · Robert Yang

Hi,

Quoted 10 lines · zzs

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

Quoted 7 lines

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.

Quoted 8 lines

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

Quoted 8 lines

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

author
#5 lore raw
Quoted 62 lines · Henning
Quoted 42 lines

-----Original Message-----
From: [email protected] [mailto:bitbake- [email protected]] On Behalf Of Richard Purdie
Sent: Wednesday, August 3, 2016 17:23
To: 张忠山 <[email protected]>; Yang, Liezhi (Wind River) <[email protected]>; [email protected]
Subject: Re: [bitbake-devel] howto build specific version package

Quoted 24 lines · 张忠山
Quoted 14 lines · Robert Yang

Hi,

Quoted 10 lines · zzs

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

Quoted 7 lines

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.

Quoted 8 lines

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

Quoted 8 lines

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
...

Quoted 5 lines

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.