public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH 1/2] cachability: ignore BBLAYERS in get_build_id
@ 2022-08-31 13:30 Felix Moessbauer
  2022-08-31 13:30 ` [PATCH 2/2] ignore wic tasks in isar-sstate lint Felix Moessbauer
  2022-09-08 14:07 ` [PATCH 1/2] cachability: ignore BBLAYERS in get_build_id Anton Mikanovich
  0 siblings, 2 replies; 3+ messages in thread
From: Felix Moessbauer @ 2022-08-31 13:30 UTC (permalink / raw)
  To: isar-users; +Cc: Felix Moessbauer

The get_build_id task just provides a convenience check for
issues around a missed ISAR_RELEASE_CMD.
While it uses the BBLAYERS variable internally, this does not
have any effect on a generated artifact, hence the value of the
variable can be ignored.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 meta/classes/image.bbclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index ba2dfa87..ccff8106 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -308,6 +308,7 @@ python() {
 # this could be "git describe" or something similar.
 # set ISAR_RELEASE_CMD to customize, or override do_mark_rootfs to do something
 # completely different
+get_build_id[vardepsexclude] += "BBLAYERS"
 get_build_id() {
 	if [ $(echo ${BBLAYERS} | wc -w) -ne 2 ] &&
 	   [ "${ISAR_RELEASE_CMD}" = "${ISAR_RELEASE_CMD_DEFAULT}" ]; then
-- 
2.30.2


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

* [PATCH 2/2] ignore wic tasks in isar-sstate lint
  2022-08-31 13:30 [PATCH 1/2] cachability: ignore BBLAYERS in get_build_id Felix Moessbauer
@ 2022-08-31 13:30 ` Felix Moessbauer
  2022-09-08 14:07 ` [PATCH 1/2] cachability: ignore BBLAYERS in get_build_id Anton Mikanovich
  1 sibling, 0 replies; 3+ messages in thread
From: Felix Moessbauer @ 2022-08-31 13:30 UTC (permalink / raw)
  To: isar-users; +Cc: Felix Moessbauer

This patch improves the isar-sstate linter.
It adds support to ignore well-known tasks that
are not cacheable anyway (e.g. rootfs_wicenv and image_wic).

This sensible default can be overwritten by using --pedantic
to also check for cachability issues in these tasks.
This helps to spot transitive caching issues happening when
performing image-in-image builds, but requires special preparation
of the calling environment (mainly no absolute paths in BBLAYERS).

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 scripts/isar-sstate | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/scripts/isar-sstate b/scripts/isar-sstate
index 5972144d..c7672656 100755
--- a/scripts/isar-sstate
+++ b/scripts/isar-sstate
@@ -586,6 +586,9 @@ def arguments():
     parser.add_argument(
         '--build-dir', type=str, default='/build/tmp/',
         help="lint: absolute path to build folder")
+    parser.add_argument(
+        '--pedantic', default=False, action='store_true',
+        help="lint: also check non-cacheable tasks")
     parser.add_argument(
         '--exit-code', type=int, default=None,
         help="lint: return this instead of number of found issues")
@@ -795,8 +798,13 @@ def sstate_analyze(source, target, **kwargs):
             print('\n'.join(out))
 
 
-def sstate_lint(target, verbose, sources_dir, build_dir, exit_code, **kwargs):
+def sstate_lint(target, verbose, sources_dir, build_dir, exit_code, pedantic, **kwargs):
     ADDITIONAL_IGNORED_VARNAMES = 'PP'.split()
+    # only list non-cacheable tasks here
+    # note that these still can break caching of other tasks that depend on these.
+    # Run in pedantic mode to also look for these issues (e.g. in image-in-image builds)
+    # To make a build fully cacheable, avoid absolute paths in BBLAYERS
+    ADDITIONAL_IGNORED_TASKS = list() if pedantic else 'rootfs_wicenv image_wic'.split()
     if not target.exists():
         print(f"WARNING: target {target} does not exist. Nothing to analyze.")
         return 0
@@ -807,6 +815,9 @@ def sstate_lint(target, verbose, sources_dir, build_dir, exit_code, **kwargs):
     hits_builddir = 0
     hits_other = 0
     for sig in cache_sigs.values():
+        if sig.task in ADDITIONAL_IGNORED_TASKS:
+            continue
+
         sig_file = target.download(sig.path)
         with open(sig_file, 'rb') as f:
             try:
-- 
2.30.2


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

* Re: [PATCH 1/2] cachability: ignore BBLAYERS in get_build_id
  2022-08-31 13:30 [PATCH 1/2] cachability: ignore BBLAYERS in get_build_id Felix Moessbauer
  2022-08-31 13:30 ` [PATCH 2/2] ignore wic tasks in isar-sstate lint Felix Moessbauer
@ 2022-09-08 14:07 ` Anton Mikanovich
  1 sibling, 0 replies; 3+ messages in thread
From: Anton Mikanovich @ 2022-09-08 14:07 UTC (permalink / raw)
  To: Felix Moessbauer, isar-users

31.08.2022 16:30, Felix Moessbauer wrote:
> The get_build_id task just provides a convenience check for
> issues around a missed ISAR_RELEASE_CMD.
> While it uses the BBLAYERS variable internally, this does not
> have any effect on a generated artifact, hence the value of the
> variable can be ignored.
>
> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>

Patchset applied to next, thanks.


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

end of thread, other threads:[~2022-09-08 14:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-31 13:30 [PATCH 1/2] cachability: ignore BBLAYERS in get_build_id Felix Moessbauer
2022-08-31 13:30 ` [PATCH 2/2] ignore wic tasks in isar-sstate lint Felix Moessbauer
2022-09-08 14:07 ` [PATCH 1/2] cachability: ignore BBLAYERS in get_build_id Anton Mikanovich

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