]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
ccache: do not use ccache if it is explicitly forbidden
authorPeter Marko <peter.marko@siemens.com>
Thu, 7 Aug 2025 17:50:45 +0000 (19:50 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 11 Aug 2025 17:03:13 +0000 (18:03 +0100)
Some recipes explicitly disable ccache via CCACHE_DISABLE variable since
they are known issues with ccache in those recipes.
This setting should not be ignored also when ccache in in HOSTOOLS.

Rework a hard to read if clause so that it is in format
if (not CCACHE_DISABLE and (cond1 or cond2 or cond2)):

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
meta/classes/ccache.bbclass

index 5ce23e50f342b451eea7114c856cc17e4f60d798..f6bd972ff427326d39fef119094592c83c8abd37 100644 (file)
@@ -51,10 +51,10 @@ python() {
     Enable ccache for the recipe
     """
     pn = d.getVar('PN')
-    if ("ccache" in d.getVar("HOSTTOOLS").split() or
+    if (not bb.utils.to_boolean(d.getVar('CCACHE_DISABLE')) and
+        ("ccache" in d.getVar("HOSTTOOLS").split() or
         pn in d.getVar('CCACHE_NATIVE_RECIPES_ALLOWED') or
-        not (bb.data.inherits_class("native", d) or
-        bb.utils.to_boolean(d.getVar('CCACHE_DISABLE')))):
+        not bb.data.inherits_class("native", d))):
         d.appendVar('DEPENDS', ' ccache-native')
         d.setVar('CCACHE', 'ccache ')
 }