* [PATCH(sbuild) 0/1] avoid absolute SCHROOT_* paths to improve caching
@ 2022-04-28 14:52 Felix Moessbauer
2022-04-28 14:52 ` [PATCH(sbuild) 1/1] " Felix Moessbauer
0 siblings, 1 reply; 2+ messages in thread
From: Felix Moessbauer @ 2022-04-28 14:52 UTC (permalink / raw)
To: isar-users; +Cc: jan.kiszka, adriaan.schmidt, ubely, Felix Moessbauer
This patch is an addition to the ubely/sbuild series.
It fixes a cachability problem introduced in the sbuild.bblcass.
In general, we should be VERY careful when working with paths
in BB variables and make sure these are never expanded when assigning to another variable.
This is especially important for variables that influence the signature of many tasks,
as otherwise sstate caching in a gitlab CI will no longer be possible.
For gitlab-ci, the build folder has to be relocatable, as it gets mounted from the host into the build container.
Note: This was found with the recently added isar-sstate script:
Sample output (before / after fix):
**** comparing to eafc8f6a ****
basehash changed from 5398d6d1 to cbbae538
List of dependencies for variable SCHROOT_DIR changed from 'set()' to '{'DISTRO_ARCH', 'DISTRO'}'
Variable SCHROOT_DIR value changed from '/builds/gitlabrunner/4/build/tmp/deploy/schroot-target/debian-bullseye-amd64' to '${DEPLOY_DIR}/schroot-target/${DISTRO}-${DISTRO_ARCH}'
Unfortunately, manually finding these flaws is not easy.
The best strategy is to grep through the signature data in the stamps folder and search for absolute paths.
But the data is not pure ASCII, so this is just a heuristic.
Maybe the isar-sstate script could be extended to automatically find such cases.
Best regards,
Felix
Felix Moessbauer (1):
avoid absolute SCHROOT_* paths to improve caching
meta/classes/sbuild.bbclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--
2.30.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH(sbuild) 1/1] avoid absolute SCHROOT_* paths to improve caching
2022-04-28 14:52 [PATCH(sbuild) 0/1] avoid absolute SCHROOT_* paths to improve caching Felix Moessbauer
@ 2022-04-28 14:52 ` Felix Moessbauer
0 siblings, 0 replies; 2+ messages in thread
From: Felix Moessbauer @ 2022-04-28 14:52 UTC (permalink / raw)
To: isar-users; +Cc: jan.kiszka, adriaan.schmidt, ubely, Felix Moessbauer
This patch reworks the logic to setup the SCHROOT_* bitbake
variables by making sure nothing is expanded.
By that, no absolute paths into the build host are exposed,
which finally makes the recipe cachable.
Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
meta/classes/sbuild.bbclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meta/classes/sbuild.bbclass b/meta/classes/sbuild.bbclass
index 760a0203..0ea26181 100644
--- a/meta/classes/sbuild.bbclass
+++ b/meta/classes/sbuild.bbclass
@@ -14,11 +14,11 @@ python __anonymous() {
if mode == "0" or d.getVar('HOST_ARCH') == distro_arch or \
(d.getVar('HOST_DISTRO') == "debian-stretch" and distro_arch == "i386"):
d.setVar('SBUILD_HOST_ARCH', distro_arch)
- d.setVar('SCHROOT_DIR', d.getVar('SCHROOT_TARGET_DIR'))
+ d.setVar('SCHROOT_DIR', d.getVar('SCHROOT_TARGET_DIR', False))
dep = "sbuild-chroot-target:do_build"
else:
d.setVar('SBUILD_HOST_ARCH', d.getVar('HOST_ARCH'))
- d.setVar('SCHROOT_DIR', d.getVar('SCHROOT_HOST_DIR'))
+ d.setVar('SCHROOT_DIR', d.getVar('SCHROOT_HOST_DIR', False))
dep = "sbuild-chroot-host:do_build"
d.setVar('SCHROOT_DEP', dep)
}
--
2.30.2
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-28 14:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-28 14:52 [PATCH(sbuild) 0/1] avoid absolute SCHROOT_* paths to improve caching Felix Moessbauer
2022-04-28 14:52 ` [PATCH(sbuild) 1/1] " Felix Moessbauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox