All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] RFC - CCACHE_DIR to not impact sstate
@ 2012-05-14  2:28 Jason Wessel
  2012-05-14  2:28 ` [PATCH 1/2] bitbake/lib/bb/data.py: Allow an exported variable to be excluded from dependency processing Jason Wessel
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Jason Wessel @ 2012-05-14  2:28 UTC (permalink / raw)
  To: openembedded-core

I am not exactly sure how to fix this, so I thought I might ask in the
form of a working patch.  The problem is that I want to use an
external CCACHE_DIR on some build servers, but use the defaults on
others.  Ultimately the sstate sums should be the same in either case,
but they are not due to the way that bitbake tracks the "export"
variables for inclusion i the sum dependencies.  My example test is to
simply set CCACHE_DIR = "/tmp/ccache" in the local.conf and recompile
the quilt-native package.

I ended up adding another check to the dependency generator because
simply trying to use "unexport" had undesired effects.  If there is a
better or correct way of fixing this such that CCACHE_DIR will not
impact the sstate sum, I would really like to know how to do this. :-)

Thanks,
Jason.




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

* [PATCH 1/2] bitbake/lib/bb/data.py: Allow an exported variable to be excluded from dependency processing
  2012-05-14  2:28 [PATCH 0/2] RFC - CCACHE_DIR to not impact sstate Jason Wessel
@ 2012-05-14  2:28 ` Jason Wessel
  2012-05-14  2:28 ` [PATCH 2/2] bitbake.conf: A change to CCACHE_DIR should not change the sstate sum Jason Wessel
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Jason Wessel @ 2012-05-14  2:28 UTC (permalink / raw)
  To: openembedded-core

This change is intended to allow an exported variable to not impact
the sstate sum in oe-core.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
---
 lib/bb/data.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/bb/data.py b/lib/bb/data.py
index c0636e1..a68ab43 100644
--- a/lib/bb/data.py
+++ b/lib/bb/data.py
@@ -313,7 +313,7 @@ def build_dependencies(key, keys, shelldeps, vardepvals, d):
 def generate_dependencies(d):
 
     keys = set(key for key in d.keys() if not key.startswith("__"))
-    shelldeps = set(key for key in keys if d.getVarFlag(key, "export") and not d.getVarFlag(key, "unexport"))
+    shelldeps = set(key for key in keys if d.getVarFlag(key, "export") and not d.getVarFlag(key, "unexport") and not d.getVarFlag(key, "undep"))
     vardepvals = set(key for key in keys if d.getVarFlag(key, "vardepvalue"))
 
     deps = {}
-- 
1.7.1




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

* [PATCH 2/2] bitbake.conf: A change to CCACHE_DIR should not change the sstate sum
  2012-05-14  2:28 [PATCH 0/2] RFC - CCACHE_DIR to not impact sstate Jason Wessel
  2012-05-14  2:28 ` [PATCH 1/2] bitbake/lib/bb/data.py: Allow an exported variable to be excluded from dependency processing Jason Wessel
@ 2012-05-14  2:28 ` Jason Wessel
  2012-05-14  2:47 ` [PATCH 0/2] RFC - CCACHE_DIR to not impact sstate Chris Larson
  2012-05-14 21:33 ` Khem Raj
  3 siblings, 0 replies; 8+ messages in thread
From: Jason Wessel @ 2012-05-14  2:28 UTC (permalink / raw)
  To: openembedded-core

If the location of the CCACHE_DIR changes it should not impact the
sstate sum.  This allows a build generated with an external CCACHE_DIR
to have the same sstate sum as a build that uses the ccache dir
located in the temp build area.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
---
 meta/conf/bitbake.conf |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 9f4e4d4..9085779 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -413,6 +413,8 @@ CCACHE = "${@bb.which(d.getVar('PATH', True), 'ccache') and 'ccache '}"
 TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TARGET}"
 
 export CCACHE_DIR = "${TMPDIR}/ccache/${MULTIMACH_HOST_SYS}/${PN}"
+# The sstate cache dependencies should not depend on the value of CCACHE_DIR
+CCACHE_DIR[undep] = "1"
 export CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
 export CXX = "${CCACHE}${HOST_PREFIX}g++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
 export F77 = "${CCACHE}${HOST_PREFIX}g77 ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
-- 
1.7.1




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

* Re: [PATCH 0/2] RFC - CCACHE_DIR to not impact sstate
  2012-05-14  2:28 [PATCH 0/2] RFC - CCACHE_DIR to not impact sstate Jason Wessel
  2012-05-14  2:28 ` [PATCH 1/2] bitbake/lib/bb/data.py: Allow an exported variable to be excluded from dependency processing Jason Wessel
  2012-05-14  2:28 ` [PATCH 2/2] bitbake.conf: A change to CCACHE_DIR should not change the sstate sum Jason Wessel
@ 2012-05-14  2:47 ` Chris Larson
  2012-05-14 11:18   ` Jason Wessel
  2012-05-14 21:33 ` Khem Raj
  3 siblings, 1 reply; 8+ messages in thread
From: Chris Larson @ 2012-05-14  2:47 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Sun, May 13, 2012 at 7:28 PM, Jason Wessel
<jason.wessel@windriver.com> wrote:
> I am not exactly sure how to fix this, so I thought I might ask in the
> form of a working patch.  The problem is that I want to use an
> external CCACHE_DIR on some build servers, but use the defaults on
> others.  Ultimately the sstate sums should be the same in either case,
> but they are not due to the way that bitbake tracks the "export"
> variables for inclusion i the sum dependencies.  My example test is to
> simply set CCACHE_DIR = "/tmp/ccache" in the local.conf and recompile
> the quilt-native package.
>
> I ended up adding another check to the dependency generator because
> simply trying to use "unexport" had undesired effects.  If there is a
> better or correct way of fixing this such that CCACHE_DIR will not
> impact the sstate sum, I would really like to know how to do this. :-)

Add it to BB_HASHBASE_WHITELIST next to other variables like TMPDIR,
FILE, and BBPATH.
-- 
Christopher Larson



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

* Re: [PATCH 0/2] RFC - CCACHE_DIR to not impact sstate
  2012-05-14  2:47 ` [PATCH 0/2] RFC - CCACHE_DIR to not impact sstate Chris Larson
@ 2012-05-14 11:18   ` Jason Wessel
  0 siblings, 0 replies; 8+ messages in thread
From: Jason Wessel @ 2012-05-14 11:18 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: Chris Larson

On 05/13/2012 09:47 PM, Chris Larson wrote:
> On Sun, May 13, 2012 at 7:28 PM, Jason Wessel
> <jason.wessel@windriver.com> wrote:
>> I am not exactly sure how to fix this, so I thought I might ask in the
>> form of a working patch.  The problem is that I want to use an
>> external CCACHE_DIR on some build servers, but use the defaults on
>> others.  Ultimately the sstate sums should be the same in either case,
>> but they are not due to the way that bitbake tracks the "export"
>> variables for inclusion i the sum dependencies.  My example test is to
>> simply set CCACHE_DIR = "/tmp/ccache" in the local.conf and recompile
>> the quilt-native package.
>>
>> I ended up adding another check to the dependency generator because
>> simply trying to use "unexport" had undesired effects.  If there is a
>> better or correct way of fixing this such that CCACHE_DIR will not
>> impact the sstate sum, I would really like to know how to do this. :-)
> 
> Add it to BB_HASHBASE_WHITELIST next to other variables like TMPDIR,
> FILE, and BBPATH.


Many thanks for the response, this definitely works for the CCACHE_DIR case.

I do have a question however.  With the patch I had created I was also able to add new exported variables to the local.conf like CCACHE_DISABLE on demand  Example:

export CCACHE_DISABLE = "1"
CCACHE_DISABLE[undep] = "1"

I would like to be able to do the same thing with the BB_HASHBASE_WHITELIST, like:

export CCACHE_DISABLE = "1"
BB_HASHBASE_WHITELIST += "CCACHE_DISABLE"

My question is if it would be ok to move the hashbase setup above all the requires *.conf lines such that this possible?

Thanks,
Jason.



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

* Re: [PATCH 0/2] RFC - CCACHE_DIR to not impact sstate
  2012-05-14  2:28 [PATCH 0/2] RFC - CCACHE_DIR to not impact sstate Jason Wessel
                   ` (2 preceding siblings ...)
  2012-05-14  2:47 ` [PATCH 0/2] RFC - CCACHE_DIR to not impact sstate Chris Larson
@ 2012-05-14 21:33 ` Khem Raj
  2012-05-14 21:50   ` Jason Wessel
  3 siblings, 1 reply; 8+ messages in thread
From: Khem Raj @ 2012-05-14 21:33 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Sun, May 13, 2012 at 7:28 PM, Jason Wessel
<jason.wessel@windriver.com> wrote:
> I am not exactly sure how to fix this, so I thought I might ask in the
> form of a working patch.  The problem is that I want to use an
> external CCACHE_DIR on some build servers, but use the defaults on
> others.  Ultimately the sstate sums should be the same in either case,

hmmm so how do you ensure that both ccache stashes are exactly same ?



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

* Re: [PATCH 0/2] RFC - CCACHE_DIR to not impact sstate
  2012-05-14 21:33 ` Khem Raj
@ 2012-05-14 21:50   ` Jason Wessel
  2012-05-14 22:34     ` Khem Raj
  0 siblings, 1 reply; 8+ messages in thread
From: Jason Wessel @ 2012-05-14 21:50 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On 05/14/2012 04:33 PM, Khem Raj wrote:
> On Sun, May 13, 2012 at 7:28 PM, Jason Wessel
> <jason.wessel@windriver.com> wrote:
>> I am not exactly sure how to fix this, so I thought I might ask in the
>> form of a working patch.  The problem is that I want to use an
>> external CCACHE_DIR on some build servers, but use the defaults on
>> others.  Ultimately the sstate sums should be the same in either case,
> hmmm so how do you ensure that both ccache stashes are exactly same ?

Why do they need to be the same?  

The end result of the compiler is the same with ccache, and that is all that matters in this case, meaning you get the same .o with "ccache gcc".  I might have several ccache directories with different sizes on different systems (it takes ~3.4 gigs for a full ccache).

CCACHE_DIR=/tmp/place1 ccache target-gcc ....
CCACHE_DIR=/tmp/place2 ccache target-gcc ....

Regardless of the state of the CCACHE_DIR the .o will be the same.

Jason.



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

* Re: [PATCH 0/2] RFC - CCACHE_DIR to not impact sstate
  2012-05-14 21:50   ` Jason Wessel
@ 2012-05-14 22:34     ` Khem Raj
  0 siblings, 0 replies; 8+ messages in thread
From: Khem Raj @ 2012-05-14 22:34 UTC (permalink / raw)
  To: Jason Wessel; +Cc: Patches and discussions about the oe-core layer

On Mon, May 14, 2012 at 2:50 PM, Jason Wessel
<jason.wessel@windriver.com> wrote:
>
> Regardless of the state of the CCACHE_DIR the .o will be the same.

and .o are part of checksum right ?



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

end of thread, other threads:[~2012-05-14 22:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-14  2:28 [PATCH 0/2] RFC - CCACHE_DIR to not impact sstate Jason Wessel
2012-05-14  2:28 ` [PATCH 1/2] bitbake/lib/bb/data.py: Allow an exported variable to be excluded from dependency processing Jason Wessel
2012-05-14  2:28 ` [PATCH 2/2] bitbake.conf: A change to CCACHE_DIR should not change the sstate sum Jason Wessel
2012-05-14  2:47 ` [PATCH 0/2] RFC - CCACHE_DIR to not impact sstate Chris Larson
2012-05-14 11:18   ` Jason Wessel
2012-05-14 21:33 ` Khem Raj
2012-05-14 21:50   ` Jason Wessel
2012-05-14 22:34     ` Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.