From: Ross Burton <
ross....@arm.com>
Kas allows SSTATE_DIR to be set via an environment variable, but the
latest oe-core will now warn if hashequiv has been enabled[1], the
sstate is outside the build tree, but the hashequiv database is inside
the build tree. This is because the hashequiv data is needed to make
full use of the sstate objects.
The solution here is to also set the hashserver database location, but
this can't be done in the same way as SSTATE_DIR as we can't set it as
an environment variable. Add BB_HASHSERVE_DB_DIR to the list of
variables that can be set in the environment so that callers can set
them both if needed.
[1] oe-core 491de0db64a ("sanity.bbclass: warn when sstate is outside of
build dir, but hash equiv database is inside it")
[Felix: support kas-container as well, document feature]
Signed-off-by: Ross Burton <
ross....@arm.com>
docs/userguide/environment-variables.inc | 7 ++++---
kas-container | 3 +++
kas/libkas.py | 3 ++-
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/docs/userguide/environment-variables.inc b/docs/userguide/environment-variables.inc
index 0f01d98a6..fecf9f504 100644
--- a/docs/userguide/environment-variables.inc
+++ b/docs/userguide/environment-variables.inc
@@ -130,9 +130,10 @@ overwritten using the ``env`` section of the config file.
| | ``SSH_PRIVATE_KEY_FILE``). |
+--------------------------+--------------------------------------------------+
| ``DL_DIR`` | Environment variables that are transferred to |
-| ``SSTATE_DIR`` | the bitbake environment. The ``DL_DIR`` and |
-| ``SSTATE_MIRRORS`` | ``SSTATE_DIR`` directories are created along |
-| (C,K,E,c) | with their parents, if set. |
+| ``SSTATE_DIR`` | the bitbake environment. The ``DL_DIR``, |
+| ``SSTATE_MIRRORS`` | ``SSTATE_DIR`` and ``BB_HASHSERVE_DB_DIR`` |
+| ``BB_HASHSERVE_DB_DIR`` | directories are created along with their |
+| (C,K,E,c) | parents, if set. |
+--------------------------+--------------------------------------------------+
| ``TMPDIR`` (K,E,c) | Directory for temporary files. |
+--------------------------+--------------------------------------------------+
diff --git a/kas-container b/kas-container
index 75315a8a9..4af3c5bbd 100755
--- a/kas-container
+++ b/kas-container
@@ -242,6 +242,7 @@ setup_kas_dirs()
KAS_REPO_REF_DIR="$(check_and_expand KAS_REPO_REF_DIR required)"
DL_DIR="$(check_and_expand DL_DIR createrec)"
SSTATE_DIR="$(check_and_expand SSTATE_DIR createrec)"
+ BB_HASHSERVE_DB_DIR="$(check_and_expand BB_HASHSERVE_DB_DIR createrec)"
KAS_BUILDTOOLS_DIR="$(check_and_expand KAS_BUILDTOOLS_DIR createrec)"
}
@@ -632,6 +633,7 @@ forward_dir KAS_BUILD_DIR "/build" "rw"
forward_dir DL_DIR "/downloads" "rw"
forward_dir KAS_REPO_REF_DIR "/repo-ref" "rw"
forward_dir SSTATE_DIR "/sstate" "rw"
+forward_dir BB_HASHSERVE_DB_DIR "/bb-hashserve-db" "rw"
forward_dir KAS_BUILDTOOLS_DIR "/buildtools" "rw"
if git_com_dir=$(git -C "${KAS_REPO_DIR}" rev-parse --git-common-dir 2>/dev/null) \
@@ -753,6 +755,7 @@ fi
for var in TERM KAS_DISTRO KAS_MACHINE KAS_TARGET KAS_TASK KAS_CLONE_DEPTH \
KAS_PREMIRRORS DISTRO_APT_PREMIRRORS BB_NUMBER_THREADS PARALLEL_MAKE \
GIT_CREDENTIAL_USEHTTPPATH \
+ BB_HASHSERVE BB_HASHSERVE_UPSTREAM \
TZ; do
if [ -n "$(eval echo \$${var})" ]; then
set -- "$@" -e "${var}=$(eval echo \"\$${var}\")"
diff --git a/kas/libkas.py b/kas/libkas.py
index 58321288c..b9b2d70e7 100644
--- a/kas/libkas.py
+++ b/kas/libkas.py
@@ -494,7 +494,8 @@ def get_build_environ(build_system, ctx):
conf_env = ctx.config.get_environment()
- env_vars = ['SSTATE_DIR', 'SSTATE_MIRRORS', 'DL_DIR', 'TMPDIR']
+ env_vars = ['SSTATE_DIR', 'SSTATE_MIRRORS', 'BB_HASHSERVE_DB_DIR',
+ 'DL_DIR', 'TMPDIR']
env_vars.extend(conf_env)
env.update(conf_env)
--
2.53.0