Skip to contentSkip to conversation

The design document for ccache-native

Yocto Saul Wold 5 participants 6 messages Jun 9, 2011 – Jun 10, 2011 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Saul Wold

author
#1 lore raw
Quoted 23 lines · wenzong fan

Hi Folks,

Please help me to review the design document for ccache-native, and I also have two questions about it, any answers or suggestions are appreciated.

* Feature name: ccache-native
Priority: P3; M2
Owner: Wenzong Fan
Summary: Integrate ccache-native to yocto

* Description:
Bitbake supports the 'CCACHE Mechanism', but 'ccache' hasn't been included by poky/yocto, just add it as a native tool.

* Usage:
Build ccache as a native tool by default and enable it for speeding target packages build.

* Implementation:
1) Copy bb file from OE upstream to:
meta/recipes-devtools/ccache/

Quoted 6 lines

2) Update bb file to get the latest ccache_3.1.5 and split the single bb file to:

      'ccache_3.1.5.bb', 'ccache.inc'

3) Enable ccache in the native tools building.

You will need to have it be a dependency pretty early on in the build.
Additionally, this is a bit a new part to this task, we want to have the default CCACHE_DIR for the build default to a directory in TMPDIR instead of the user's home directory. This will mean setting an environment variable somewhere early also.

Quoted 3 lines

* Questions:
1) Do we want to add it as a target package? And which images should include it?

Yes, it should be included as part of any SDK image, to do this you would add it to the task-core-sdk list.

Quoted 2 lines

2) How to add it into native tools build list and build it by default?

You use BBCLASSEXTEND = "native" in the recipe, that will give you the native for free.

Quoted 4 lines

Thanks
Wenzong

#2 lore raw
Quoted 28 lines · Saul Wold
Quoted 27 lines · wenzong fan

Hi Folks,

Please help me to review the design document for ccache-native, and I also have two questions about it, any answers or suggestions are appreciated.

* Feature name: ccache-native
Priority: P3; M2
Owner: Wenzong Fan
Summary: Integrate ccache-native to yocto

* Description:
Bitbake supports the 'CCACHE Mechanism', but 'ccache' hasn't been included by poky/yocto, just add it as a native tool.

* Usage:
Build ccache as a native tool by default and enable it for speeding target packages build.

* Implementation:
1) Copy bb file from OE upstream to:
meta/recipes-devtools/ccache/

2) Update bb file to get the latest ccache_3.1.5 and split the single bb file to:

      'ccache_3.1.5.bb', 'ccache.inc'
Quoted 7 lines
Quoted 2 lines

3) Enable ccache in the native tools building.

You will need to have it be a dependency pretty early on in the build. Additionally, this is a bit a new part to this task, we want to have the default CCACHE_DIR for the build default to a directory in TMPDIR instead of the user's home directory. This will mean setting an environment variable somewhere early also.

There is a little more detail on:

https://wiki.yoctoproject.org/wiki/Yocto_1.1_Schedule

Specifically, "c) Set CCACHE on a per recipe basis. need to figure out whether ccache data can be shared and under what circumstances."

so something like adding:

export CCACHE_DIR = "${TMPDIR}/ccache/${TARGET_SYS}/${PN}"

to bitbake.conf with a bit more thought into working out the right components to add to the variable.

Cheers,

Richard

#3 lore raw
In reply to Saul Wold
Quoted 28 lines · Saul Wold
Quoted 27 lines · wenzong fan

Hi Folks,

Please help me to review the design document for ccache-native, and I also have two questions about it, any answers or suggestions are appreciated.

* Feature name: ccache-native
Priority: P3; M2
Owner: Wenzong Fan
Summary: Integrate ccache-native to yocto

* Description:
Bitbake supports the 'CCACHE Mechanism', but 'ccache' hasn't been included by poky/yocto, just add it as a native tool.

* Usage:
Build ccache as a native tool by default and enable it for speeding target packages build.

* Implementation:
1) Copy bb file from OE upstream to:
meta/recipes-devtools/ccache/

2) Update bb file to get the latest ccache_3.1.5 and split the single bb file to:

      'ccache_3.1.5.bb', 'ccache.inc'
Quoted 7 lines
Quoted 2 lines

3) Enable ccache in the native tools building.

You will need to have it be a dependency pretty early on in the build. Additionally, this is a bit a new part to this task, we want to have the default CCACHE_DIR for the build default to a directory in TMPDIR instead of the user's home directory. This will mean setting an environment variable somewhere early also.

Can we instead veto ccache and remove it from the bitbake docs? I can't count the number of times I've run into what I can only imagine are ccache conflicts to explain why a random build failure with ccache in use.

Signature · 2 lines
Tom Rini
Mentor Graphics Corporation
#4 lore raw
Quoted 37 lines · Tom Rini
Quoted 28 lines · Saul Wold
Quoted 27 lines · wenzong fan

Hi Folks,

Please help me to review the design document for ccache-native, and I also have two questions about it, any answers or suggestions are appreciated.

* Feature name: ccache-native
Priority: P3; M2
Owner: Wenzong Fan
Summary: Integrate ccache-native to yocto

* Description:
Bitbake supports the 'CCACHE Mechanism', but 'ccache' hasn't been included by poky/yocto, just add it as a native tool.

* Usage:
Build ccache as a native tool by default and enable it for speeding target packages build.

* Implementation:
1) Copy bb file from OE upstream to:
meta/recipes-devtools/ccache/

2) Update bb file to get the latest ccache_3.1.5 and split the single bb file to:

       'ccache_3.1.5.bb', 'ccache.inc'
Quoted 7 lines
Quoted 2 lines

3) Enable ccache in the native tools building.

You will need to have it be a dependency pretty early on in the build. Additionally, this is a bit a new part to this task, we want to have the default CCACHE_DIR for the build default to a directory in TMPDIR instead of the user's home directory. This will mean setting an environment variable somewhere early also.

Quoted 4 lines

Can we instead veto ccache and remove it from the bitbake docs? I can't count the number of times I've run into what I can only imagine are ccache conflicts to explain why a random build failure with ccache in use.

It works on some hosts somewhat reliably and is unpredictable on some as you say. I think keeping it optional is probably the right thing but making it default may not be a good thing.

#5 lore raw
Quoted 38 lines · Khem Raj
Quoted 37 lines · Tom Rini
Quoted 35 lines · Saul Wold
Quoted 23 lines · wenzong fan

Hi Folks,

Please help me to review the design document for ccache-native, and I also have two questions about it, any answers or suggestions are appreciated.

* Feature name: ccache-native
Priority: P3; M2
Owner: Wenzong Fan
Summary: Integrate ccache-native to yocto

* Description:
Bitbake supports the 'CCACHE Mechanism', but 'ccache' hasn't been included by poky/yocto, just add it as a native tool.

* Usage:
Build ccache as a native tool by default and enable it for speeding target packages build.

* Implementation:
1) Copy bb file from OE upstream to:
meta/recipes-devtools/ccache/

Quoted 6 lines

2) Update bb file to get the latest ccache_3.1.5 and split the single bb file to:

       'ccache_3.1.5.bb', 'ccache.inc'

3) Enable ccache in the native tools building.

You will need to have it be a dependency pretty early on in the build. Additionally, this is a bit a new part to this task, we want to have the default CCACHE_DIR for the build default to a directory in TMPDIR instead of the user's home directory. This will mean setting an environment variable somewhere early also.

Quoted 8 lines
Quoted 4 lines

Can we instead veto ccache and remove it from the bitbake docs? I can't count the number of times I've run into what I can only imagine are ccache conflicts to explain why a random build failure with ccache in use.

It works on some hosts somewhat reliably and is unpredictable on some as you say. I think keeping it optional is probably the right thing but making it default may not be a good thing.

I'm pretty sure it's not reliable so much as lucky, but shoving the cache somewhere else and making it per-recipe makes me less worried.

Signature · 2 lines
Tom Rini
Mentor Graphics Corporation
#6 lore raw
In reply to Saul Wold
Quoted 34 lines · Saul Wold
Quoted 23 lines · wenzong fan

Hi Folks,

Please help me to review the design document for ccache-native, and I also have two questions about it, any answers or suggestions are appreciated.

* Feature name: ccache-native
Priority: P3; M2
Owner: Wenzong Fan
Summary: Integrate ccache-native to yocto

* Description:
Bitbake supports the 'CCACHE Mechanism', but 'ccache' hasn't been included by poky/yocto, just add it as a native tool.

* Usage:
Build ccache as a native tool by default and enable it for speeding target packages build.

* Implementation:
1) Copy bb file from OE upstream to:
meta/recipes-devtools/ccache/

Quoted 6 lines

2) Update bb file to get the latest ccache_3.1.5 and split the single bb file to:

      'ccache_3.1.5.bb', 'ccache.inc'

3) Enable ccache in the native tools building.

You will need to have it be a dependency pretty early on in the build.
Additionally, this is a bit a new part to this task, we want to have the default CCACHE_DIR for the build default to a directory in TMPDIR instead of the user's home directory. This will mean setting an environment variable somewhere early also.

Quoted 8 lines
Quoted 3 lines

* Questions:
1) Do we want to add it as a target package? And which images should include it?

Yes, it should be included as part of any SDK image, to do this you would add it to the task-core-sdk list.

Quoted 2 lines

2) How to add it into native tools build list and build it by default?

You use BBCLASSEXTEND = "native" in the recipe, that will give you the native for free.

Sorry for the confusions, actually I want to know how can I enable the ccache in native tools build, I think you have given the answers in 'Implementation #3'.

Thanks a lot.

Wenzong

Quoted 7 lines
Quoted 5 lines

Thanks
Wenzong