public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH 1/2] Setup ccache in devshell as well
@ 2021-12-03 15:21 Felix Moessbauer
  2021-12-03 15:21 ` [PATCH 2/2] refactor: inject ccache environment similar to proxy env Felix Moessbauer
  2021-12-17 11:03 ` [PATCH 1/2] Setup ccache in devshell as well Anton Mikanovich
  0 siblings, 2 replies; 3+ messages in thread
From: Felix Moessbauer @ 2021-12-03 15:21 UTC (permalink / raw)
  To: isar-users; +Cc: jan.kiszka, adriaan.schmidt, Felix Moessbauer

This patch also enables the ccache in the devshell for recipes
that use the ccache. By that, also ccache statistics can be
inspected.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 meta/classes/base.bbclass      | 5 +++++
 meta/classes/dpkg-base.bbclass | 4 +++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index c43ec19..d8347b9 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -166,6 +166,11 @@ def isar_export_proxies(d):
 
     return bb.utils.export_proxies(d)
 
+def isar_export_ccache(d):
+    if d.getVar('USE_CCACHE') == '1':
+        os.environ['CCACHE_DIR'] = '/ccache'
+        os.environ['PATH_PREPEND'] = '/usr/lib/ccache'
+
 do_fetch[dirs] = "${DL_DIR}"
 do_fetch[file-checksums] = "${@bb.fetch.get_checksum_file_list(d)}"
 do_fetch[vardeps] += "SRCREV"
diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index 6704385..cb5ce4a 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -278,10 +278,12 @@ python do_devshell() {
     bb.build.exec_func('dpkg_do_mounts', d)
 
     isar_export_proxies(d)
+    isar_export_ccache(d)
 
     buildchroot = d.getVar('BUILDCHROOT_DIR')
     pp_pps = os.path.join(d.getVar('PP'), d.getVar('PPS'))
-    termcmd = "sudo -E chroot {0} sh -c 'cd {1}; $SHELL -i'"
+    # the PATH variable is not forwarded by sudo -E.
+    termcmd = "sudo -E chroot {0} sh -c 'cd {1}; export PATH=$PATH_PREPEND:$PATH; $SHELL -i'"
     oe_terminal(termcmd.format(buildchroot, pp_pps), "Isar devshell", d)
 
     bb.build.exec_func('dpkg_undo_mounts', d)
-- 
2.30.2


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

end of thread, other threads:[~2021-12-17 11:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-03 15:21 [PATCH 1/2] Setup ccache in devshell as well Felix Moessbauer
2021-12-03 15:21 ` [PATCH 2/2] refactor: inject ccache environment similar to proxy env Felix Moessbauer
2021-12-17 11:03 ` [PATCH 1/2] Setup ccache in devshell as well Anton Mikanovich

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