[OE-core] [PATCH] bitbake.conf: point PERSISTENT_DIR outside TMPDIR

Richard Purdie richard.purdie at linuxfoundation.org
Fri Mar 4 14:01:26 UTC 2011


On Fri, 2011-03-04 at 11:40 +0100, Martin Jansa wrote:
> * sanity check warning user that he still has peristent cache in old location
> * similar patch was sent to OE, to keep PERSISTENT_DIR location consistent
>   http://lists.linuxtogo.org/pipermail/openembedded-devel/2011-March/030623.html
> 
> Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>
> ---
>  meta/classes/sanity.bbclass |    8 ++++++++
>  meta/conf/bitbake.conf      |    2 +-
>  meta/conf/sanity.conf       |    1 +
>  3 files changed, 10 insertions(+), 1 deletions(-)

When I saw this on the OE list, I'd assumed you'd done what Poky had
done, I've just realised you're moving this file to TOPDIR instead of
TMPDIR.

My big concern here is that we really shouldn't be writing to data to
the conf directory as its not what the user expects.

I say this knowing the raft of usability problems we've had every time
we take something outside of TMPDIR as users have the expectation that
deleting tmp wipes out all stored state and rebuilds. Having this file
hidden in the conf directory breaks that expectation. Note there are
only two things we place outside of TMPDIR, downloads and sstate data.
Even things like buildstats which you might want to preserve over
different builds are still inside TMPDIR.

Can we put it in cache as a top level file rather than machine specific?

Cheers,

Richard


> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
> index 64af555..9a0dfcc 100644
> --- a/meta/classes/sanity.bbclass
> +++ b/meta/classes/sanity.bbclass
> @@ -302,6 +302,14 @@ def check_sanity(e):
>      elif oeroot.find (' ') != -1:
>          messages = messages + "Error, you have a space in your POKYBASE directory path. Please move Poky to a directory which doesn't include a space."
>  
> +    #
> +    # Check there isn't old persistent cache
> +    #
> +    persistent_dir = data.getVar('PERSISTENT_DIR', e.data, True)
> +    persistent_cache_filename = data.getVar('SANITY_PERSIST_DATA_FILE', e.data, True)
> +    if os.path.exists(tmpdir + '/cache/' + persistent_cache_filename):
> +        messages = messages + "Error, persistent cache file '%s' exists in old location '%s', please migrate it to new location '%s' and merge them together if you have one for each MACHINE.\n" % (persistent_cache_filename, tmpdir + '/cache/', persistent_dir)
> +
>      if messages != "":
>          raise_sanity_error(messages)
>  
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index 55db1ab..1fdd4c5 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -270,7 +270,7 @@ FILESDIR = "${@bb.which(bb.data.getVar('FILESPATH', d, 1), '.')}"
>  TMPDIR ?= "${TOPDIR}/tmp"
>  CACHE = "${TMPDIR}/cache${@['', '/' + str(bb.data.getVar('MACHINE', d, 1))][bool(bb.data.getVar('MACHINE', d, 1))]}${@['', '/' + str(bb.data.getVar('SDKMACHINE', d, 1))][bool(bb.data.getVar('SDKMACHINE', d, 1))]}"
>  # The persistent cache should be shared by all builds
> -PERSISTENT_DIR = "${TMPDIR}/cache"
> +PERSISTENT_DIR = "${TOPDIR}/conf/persistent"
>  LOG_DIR = "${TMPDIR}/log"
>  CO_DIR = "${DL_DIR}"
>  CVSDIR = "${CO_DIR}/cvs"
> diff --git a/meta/conf/sanity.conf b/meta/conf/sanity.conf
> index fcaed11..46b542d 100644
> --- a/meta/conf/sanity.conf
> +++ b/meta/conf/sanity.conf
> @@ -6,6 +6,7 @@
>  BB_MIN_VERSION = "1.8.10"
>  
>  SANITY_ABIFILE = "${TMPDIR}/abi_version"
> +SANITY_PERSIST_DATA_FILE = "bb_persist_data.sqlite3"
>  
>  SANITY_VERSION = "1"
>  POKY_CONF_VERSION  = "1"






More information about the Openembedded-core mailing list