* [PATCH] add flag to enable ccache debug mode
@ 2022-07-12 13:34 Felix Moessbauer
2022-07-20 5:50 ` Anton Mikanovich
0 siblings, 1 reply; 2+ messages in thread
From: Felix Moessbauer @ 2022-07-12 13:34 UTC (permalink / raw)
To: isar-users; +Cc: jan.kiszka, Felix Moessbauer
This patch adds the bitbake variable CCACHE_DEBUG which
can be set to 1 to enable the ccache debug mode.
Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
doc/user_manual.md | 4 ++++
meta-isar/conf/local.conf.sample | 2 ++
meta/classes/base.bbclass | 3 +++
meta/classes/buildchroot.bbclass | 2 +-
meta/conf/bitbake.conf | 3 ++-
5 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/doc/user_manual.md b/doc/user_manual.md
index 3faa8f17..546ae75c 100644
--- a/doc/user_manual.md
+++ b/doc/user_manual.md
@@ -1012,6 +1012,10 @@ adjusted by `CCACHE_TOP_DIR` variable in `local.conf`. Ccache directory
`CCACHE_DIR` default value is `"${CCACHE_TOP_DIR}/${DISTRO}-${DISTRO_ARCH}"`,
that means caches for different distros and architectures are not overlapped.
+The ccache debug mode can be enabled by setting `CCACHE_DEBUG = "1"`
+in the `local.conf`.
+The debug artifacts will be placed in `${CCACHE_DIR}/debug`.
+
## Using sstate-cache
diff --git a/meta-isar/conf/local.conf.sample b/meta-isar/conf/local.conf.sample
index 58f3e1a2..ce7b58ee 100644
--- a/meta-isar/conf/local.conf.sample
+++ b/meta-isar/conf/local.conf.sample
@@ -250,3 +250,5 @@ USER_isar[flags] += "clear-text-password"
#USE_CCACHE = "1"
# Uncomment and set own top level ccache directory to share between builds
#CCACHE_TOP_DIR ?= "${TMPDIR}/ccache"
+# Enable ccache debug mode
+#CCACHE_DEBUG = "1"
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 4ec2c813..e989f69f 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -174,6 +174,9 @@ def isar_export_ccache(d):
if d.getVar('USE_CCACHE') == '1':
os.environ['CCACHE_DIR'] = '/ccache'
os.environ['PATH_PREPEND'] = '/usr/lib/ccache'
+ if d.getVar('CCACHE_DEBUG') == '1':
+ os.environ['CCACHE_DEBUG'] = '1'
+ os.environ['CCACHE_DEBUGDIR'] = '/ccache/debug'
do_fetch[dirs] = "${DL_DIR}"
do_fetch[file-checksums] = "${@bb.fetch.get_checksum_file_list(d)}"
diff --git a/meta/classes/buildchroot.bbclass b/meta/classes/buildchroot.bbclass
index 11489661..48b9f207 100644
--- a/meta/classes/buildchroot.bbclass
+++ b/meta/classes/buildchroot.bbclass
@@ -25,7 +25,7 @@ MOUNT_LOCKFILE = "${BUILDCHROOT_DIR}.lock"
buildchroot_do_mounts() {
if [ "${USE_CCACHE}" = "1" ]; then
- mkdir -p ${CCACHE_DIR}
+ mkdir -p ${CCACHE_DIR}/debug
fi
sudo -s <<'EOSUDO'
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 6451cb59..48e3c8e9 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -100,7 +100,7 @@ BB_HASHBASE_WHITELIST ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH BBSERVER DL_DI
SSTATE_DIR THISDIR FILESEXTRAPATHS FILE_DIRNAME HOME LOGNAME SHELL TERM \
USER FILESPATH STAGING_DIR_HOST STAGING_DIR_TARGET COREBASE PRSERV_HOST \
PRSERV_DUMPDIR PRSERV_DUMPFILE PRSERV_LOCKDOWN PARALLEL_MAKE \
- CCACHE_DIR EXTERNAL_TOOLCHAIN CCACHE CCACHE_NOHASHDIR LICENSE_PATH SDKPKGSUFFIX \
+ CCACHE_DIR CCACHE_DEBUG EXTERNAL_TOOLCHAIN CCACHE CCACHE_NOHASHDIR LICENSE_PATH SDKPKGSUFFIX \
WORKDIR STAMPCLEAN PKGDATA_DIR BUILD_ARCH SSTATE_PKGARCH \
BB_WORKERCONTEXT BB_LIMITEDDEPS DEPLOY_DIR BUILDCHROOT_DIR \
REPO_ISAR_DIR REPO_ISAR_DB_DIR REPO_BASE_DIR REPO_BASE_DB_DIR LAYERDIR_core \
@@ -133,6 +133,7 @@ INHERIT += "${@'buildstats' if d.getVar('USE_BUILDSTATS') == '1' else ''}"
USE_CCACHE ??= "0"
CCACHE_TOP_DIR ?= "${TMPDIR}/ccache"
CCACHE_DIR ?= "${CCACHE_TOP_DIR}/${DISTRO}-${DISTRO_ARCH}"
+CCACHE_DEBUG ?= "0"
include conf/local.conf
include conf/multiconfig/${BB_CURRENT_MC}.conf
--
2.30.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] add flag to enable ccache debug mode
2022-07-12 13:34 [PATCH] add flag to enable ccache debug mode Felix Moessbauer
@ 2022-07-20 5:50 ` Anton Mikanovich
0 siblings, 0 replies; 2+ messages in thread
From: Anton Mikanovich @ 2022-07-20 5:50 UTC (permalink / raw)
To: Felix Moessbauer, isar-users; +Cc: jan.kiszka
12.07.2022 16:34, Felix Moessbauer wrote:
> This patch adds the bitbake variable CCACHE_DEBUG which
> can be set to 1 to enable the ccache debug mode.
>
> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
Applied to next, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-07-20 5:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-12 13:34 [PATCH] add flag to enable ccache debug mode Felix Moessbauer
2022-07-20 5:50 ` Anton Mikanovich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox