Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] bitbake: do not set CCACHE_DISABLE=0
@ 2012-07-21 11:55 Enrico Scholz
  2012-07-22  8:41 ` Richard Purdie
  0 siblings, 1 reply; 7+ messages in thread
From: Enrico Scholz @ 2012-07-21 11:55 UTC (permalink / raw)
  To: openembedded-core; +Cc: Enrico Scholz

ccache checks for existence of environment; not for its value:

  ---- ccache-3.1.7/ccache.c ---
        if (getenv("CCACHE_DISABLE")) {
                cc_log("ccache is disabled");

Hence, avoid setting of $CCACHE_DISABLE instead of assigning '0'.

Unfortunately, bitbake has a similar behavior when evaluating 'export'
and 'unexport' flags so that this variable must be set in a python
function instead of declaring it in bitbake.conf.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
---
 meta/classes/base.bbclass |    8 ++++++++
 meta/conf/bitbake.conf    |    3 ---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 1f76023..9f9c803 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -309,6 +309,14 @@ do_build () {
 python () {
     import exceptions, string, re
 
+    # Disable ccache explicitly if CCACHE is null since gcc may be a
+    # symlink of ccache some distributions (e.g., Fedora 17). Please
+    # note that only the existence of $CCACHE_DISABLE matters; the
+    # value is ignored.
+    if d.getVar('CCACHE', True) == '':
+        d.setVar('CCACHE_DISABLE', True)
+        d.setVarFlag('CCACHE_DISABLE', 'export', True)
+
     # Handle PACKAGECONFIG
     #
     # These take the form:
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index a8a1665..1bb66ad 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -420,9 +420,6 @@ export PATH
 ##################################################################
 
 CCACHE ??= ""
-# Disable ccache explicitly if CCACHE is null since gcc may be a symlink
-# of ccache some distributions (e.g., Fedora 17).
-export CCACHE_DISABLE ??= "${@[0,1][d.getVar('CCACHE', True) == '']}"
 # Assign CCACHE_DIR a default value to fix a bug of ccache 3.1.7,
 # since it would always create CCACHE_DIR/.ccache even if
 # CCACHE_DISABLE = 1.
-- 
1.7.10.4




^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-07-22 19:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-21 11:55 [PATCH] bitbake: do not set CCACHE_DISABLE=0 Enrico Scholz
2012-07-22  8:41 ` Richard Purdie
2012-07-22  9:39   ` Enrico Scholz
2012-07-22 10:32     ` Richard Purdie
2012-07-22 11:03       ` Enrico Scholz
2012-07-22 11:39         ` Richard Purdie
2012-07-22 19:38           ` Enrico Scholz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox