summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2021-01-19 01:23:44 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-01-20 00:41:39 +0000
commit631bbd4896882ba2acbe5bc85bc90ab7abc794ef (patch)
treee7185ff9a3fff1aeed7af048932f8def5cae8d27
parent1b659623430e1a6e6dd266e65bab7ca8155a7138 (diff)
downloadopenembedded-core-contrib-631bbd4896882ba2acbe5bc85bc90ab7abc794ef.tar.gz
openembedded-core-contrib-631bbd4896882ba2acbe5bc85bc90ab7abc794ef.tar.bz2
openembedded-core-contrib-631bbd4896882ba2acbe5bc85bc90ab7abc794ef.zip
ccache.bbclass: Use ccache-native and disable ccache for native recipes
Since host's ccache is not reliable, so disable ccache for native recipes and use ccache-native for other types of recipes. We need disable ccache for native recipes is because ccache-native now depends on cmake-native which causes circular dependencies, and it's not easy to break the circular. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/ccache.bbclass2
-rw-r--r--meta/lib/oeqa/selftest/cases/buildoptions.py11
2 files changed, 7 insertions, 6 deletions
diff --git a/meta/classes/ccache.bbclass b/meta/classes/ccache.bbclass
index fc4745609c..4532894c57 100644
--- a/meta/classes/ccache.bbclass
+++ b/meta/classes/ccache.bbclass
@@ -49,7 +49,7 @@ python() {
"""
pn = d.getVar('PN')
# quilt-native doesn't need ccache since no c files
- if not (pn in ('ccache-native', 'quilt-native') or
+ if not (bb.data.inherits_class("native", d) or
bb.utils.to_boolean(d.getVar('CCACHE_DISABLE'))):
d.appendVar('DEPENDS', ' ccache-native')
d.setVar('CCACHE', 'ccache ')
diff --git a/meta/lib/oeqa/selftest/cases/buildoptions.py b/meta/lib/oeqa/selftest/cases/buildoptions.py
index e91f0bd18f..fb0a5ebfed 100644
--- a/meta/lib/oeqa/selftest/cases/buildoptions.py
+++ b/meta/lib/oeqa/selftest/cases/buildoptions.py
@@ -38,13 +38,14 @@ class ImageOptionsTests(OESelftestTestCase):
p = bb_vars['SYSROOT_DESTDIR'] + bb_vars['bindir'] + "/" + "ccache"
self.assertTrue(os.path.isfile(p), msg = "No ccache found (%s)" % p)
self.write_config('INHERIT += "ccache"')
- self.add_command_to_tearDown('bitbake -c clean m4-native')
- bitbake("m4-native -c clean")
- bitbake("m4-native -f -c compile")
- log_compile = os.path.join(get_bb_var("WORKDIR","m4-native"), "temp/log.do_compile")
+ recipe = "binutils-cross-x86_64"
+ self.add_command_to_tearDown('bitbake -c clean %s' % recipe)
+ bitbake("%s -c clean" % recipe)
+ bitbake("%s -f -c compile" % recipe)
+ log_compile = os.path.join(get_bb_var("WORKDIR", recipe), "temp/log.do_compile")
with open(log_compile, "r") as f:
loglines = "".join(f.readlines())
- self.assertIn("ccache", loglines, msg="No match for ccache in m4-native log.do_compile. For further details: %s" % log_compile)
+ self.assertIn("ccache", loglines, msg="No match for ccache in %s log.do_compile. For further details: %s" % (recipe , log_compile))
def test_read_only_image(self):
distro_features = get_bb_var('DISTRO_FEATURES')