public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Felix Moessbauer <felix.moessbauer@siemens.com>
To: isar-users@googlegroups.com
Cc: Felix Moessbauer <felix.moessbauer@siemens.com>
Subject: [PATCH 2/2] ignore wic tasks in isar-sstate lint
Date: Wed, 31 Aug 2022 15:30:57 +0200	[thread overview]
Message-ID: <20220831133057.216312-2-felix.moessbauer@siemens.com> (raw)
In-Reply-To: <20220831133057.216312-1-felix.moessbauer@siemens.com>

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


  reply	other threads:[~2022-08-31 13:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-31 13:30 [PATCH 1/2] cachability: ignore BBLAYERS in get_build_id Felix Moessbauer
2022-08-31 13:30 ` Felix Moessbauer [this message]
2022-09-08 14:07 ` Anton Mikanovich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220831133057.216312-2-felix.moessbauer@siemens.com \
    --to=felix.moessbauer@siemens.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox