Re: [OE-core] [PATCH 3/5] ccache.bbclass: Only let native recipes depend on ccache-native

2019-01-24 Thread Robert Yang




On 1/24/19 8:46 PM, Richard Purdie wrote:

On Thu, 2019-01-24 at 14:57 +0800, Robert Yang wrote:

Make native recipes depend on ccache-native should be enough since native
recipes are on target/nativesdk recipes' dependency chain, this can reduce the
size of DEPENDS.

Signed-off-by: Robert Yang 
---
  meta/classes/ccache.bbclass | 5 -
  1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/classes/ccache.bbclass b/meta/classes/ccache.bbclass
index b545735..6caaca7 100644
--- a/meta/classes/ccache.bbclass
+++ b/meta/classes/ccache.bbclass
@@ -47,8 +47,11 @@ python() {
  # quilt-native doesn't need ccache since no c files
  if not (pn in ('ccache-native', 'quilt-native') or
  bb.utils.to_boolean(d.getVar('CCACHE_DISABLE'))):
-d.appendVar('DEPENDS', ' ccache-native')
  d.setVar('CCACHE', 'ccache ')
+# Make native recipes depend on ccache-native should be enough since
+# native recipes are on target recipes' dependency chain.
+if bb.data.inherits_class('native', d):
+d.appendVar('DEPENDS', ' ccache-native')
  }
  
  addtask cleanccache after do_clean


This is not correct. Think about the case where the native recipes were
installed from sstate. The target recipe dependencies would then be
incorrect.


It seems that it is OK, I used base-files to do a test:

- Add 'DEPENDS += "m4-native"' to base-files_3.0.14.bb
- Add INHERIT += "ccache" to local.conf

$ bitbake m4-native

# Got the ones have been built
$ bitbake m4-native -g

Clean all the native builds to make them installed from sstate:
$ bitbake `cat pn-buildlist` -cclean

$ bitbake base-files -cconfigure

Now m4-native is installed from sstate, but ccache is still be installed
to base-files/3.0.14-r89/recipe-sysroot-native/usr/bin/ccache.

I looked at staging.bbclass:extend_recipe_sysroot(), it seems that it
did install all the dependencies on the chain.

// Robert



Cheers,

Richard



--
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 3/5] ccache.bbclass: Only let native recipes depend on ccache-native

2019-01-24 Thread Richard Purdie
On Thu, 2019-01-24 at 14:57 +0800, Robert Yang wrote:
> Make native recipes depend on ccache-native should be enough since native
> recipes are on target/nativesdk recipes' dependency chain, this can reduce the
> size of DEPENDS.
> 
> Signed-off-by: Robert Yang 
> ---
>  meta/classes/ccache.bbclass | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/classes/ccache.bbclass b/meta/classes/ccache.bbclass
> index b545735..6caaca7 100644
> --- a/meta/classes/ccache.bbclass
> +++ b/meta/classes/ccache.bbclass
> @@ -47,8 +47,11 @@ python() {
>  # quilt-native doesn't need ccache since no c files
>  if not (pn in ('ccache-native', 'quilt-native') or
>  bb.utils.to_boolean(d.getVar('CCACHE_DISABLE'))):
> -d.appendVar('DEPENDS', ' ccache-native')
>  d.setVar('CCACHE', 'ccache ')
> +# Make native recipes depend on ccache-native should be enough since
> +# native recipes are on target recipes' dependency chain.
> +if bb.data.inherits_class('native', d):
> +d.appendVar('DEPENDS', ' ccache-native')
>  }
>  
>  addtask cleanccache after do_clean

This is not correct. Think about the case where the native recipes were
installed from sstate. The target recipe dependencies would then be
incorrect.

Cheers,

Richard

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core