]> code.ossystems Code Review - openembedded-core.git/commitdiff
ccache.bbclass: use ccache from host distribution
authorAlexander Kanavin <alex.kanavin@gmail.com>
Mon, 28 Dec 2020 20:04:34 +0000 (21:04 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 31 Dec 2020 11:53:21 +0000 (11:53 +0000)
ccache 4.x has hard dependencies on cmake-native (used as
build system) and zstd, which means inserting ccache-native
as DEPENDS into everything creates circular dependencies which
are impossible to break.

ccache 3.x did not have this problem as it used plain makefiles
and an in-tree copy of zlib.

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/ccache.bbclass
meta/conf/bitbake.conf
meta/lib/oeqa/selftest/cases/buildoptions.py

index b5457359ca3e5bbd1f499bf1fffdc09a2eedb700..11a3f1cb52e2149fc4254f7df67018bd59c74e97 100644 (file)
@@ -1,5 +1,7 @@
 #
 # Usage:
+# - Install ccache package on the host distribution and set up a build directory
+#
 # - Enable ccache
 #   Add the following line to a conffile such as conf/local.conf:
 #   INHERIT += "ccache"
@@ -47,7 +49,6 @@ 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 ')
 }
 
index 92b6866d4d2dbfbcb856fbc1ee7a5f6f9ee262b5..af614ff34764a73ddde21dbbf075d50fb085f96c 100644 (file)
@@ -498,7 +498,7 @@ HOSTTOOLS += " \
 HOSTTOOLS += "${@'ip ping ps scp ssh stty' if (bb.utils.contains_any('IMAGE_CLASSES', 'testimage testsdk', True, False, d) or any(x in (d.getVar("BBINCLUDED") or "") for x in ["testimage.bbclass", "testsdk.bbclass"])) else ''}"
 
 # Link to these if present
-HOSTTOOLS_NONFATAL += "aws gcc-ar gpg ld.bfd ld.gold nc pigz sftp socat ssh sudo"
+HOSTTOOLS_NONFATAL += "aws ccache gcc-ar gpg ld.bfd ld.gold nc pigz sftp socat ssh sudo"
 
 # Temporary add few more detected in bitbake world
 HOSTTOOLS_NONFATAL += "join nl size yes zcat"
index e91f0bd18f6c3af0880cb59c73c01a56fe282864..d0f64773002aecf0fada59edf4f2e620703c9901 100644 (file)
@@ -33,10 +33,10 @@ class ImageOptionsTests(OESelftestTestCase):
         self.assertTrue(incremental_removed, msg = "Match failed in:\n%s" % log_data_removed)
 
     def test_ccache_tool(self):
-        bitbake("ccache-native")
-        bb_vars = get_bb_vars(['SYSROOT_DESTDIR', 'bindir'], 'ccache-native')
-        p = bb_vars['SYSROOT_DESTDIR'] + bb_vars['bindir'] + "/" + "ccache"
-        self.assertTrue(os.path.isfile(p), msg = "No ccache found (%s)" % p)
+        bb_vars = get_bb_vars(['HOSTTOOLS_DIR'], 'm4-native')
+        p = bb_vars['HOSTTOOLS_DIR'] + "/" + "ccache"
+        if not os.path.isfile(p):
+            self.skipTest("No ccache binary found in %s" % bb_vars['HOSTTOOLS_DIR'])
         self.write_config('INHERIT += "ccache"')
         self.add_command_to_tearDown('bitbake -c clean m4-native')
         bitbake("m4-native -c clean")