From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7353323043876241408 X-Received: by 2002:a05:6e02:1c89:b0:368:efa4:bdf4 with SMTP id w9-20020a056e021c8900b00368efa4bdf4mr1330945ill.19.1712334747518; Fri, 05 Apr 2024 09:32:27 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6e02:2206:b0:368:8295:6251 with SMTP id j6-20020a056e02220600b0036882956251ls1569854ilf.0.-pod-prod-04-us; Fri, 05 Apr 2024 09:32:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFXuOwtegpJnoNq3T/BaNraO7Po7VioJDa4HHpaPaz51LNEXJRgSlQFCfn8VZgCRbPOJwtq X-Received: by 2002:a05:6e02:2197:b0:368:82f1:802f with SMTP id j23-20020a056e02219700b0036882f1802fmr2118596ila.25.1712334746160; Fri, 05 Apr 2024 09:32:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712334746; cv=none; d=google.com; s=arc-20160816; b=YXhv2iEzr/UdNFz7apRoCjY+6HasgMbG/GSZywOpOZZ5dWgM9beZEEAvtAgCbji4B3 7QqAqI5cZm8vN/+M+SOYl7rZIZe1rcq/onzHTtDDvYNnZQ7Bnud1IgNkO6I40DStV5gW 7aM5EwYm5oO/hmmyTpKiSvQTpierYO/ed5LtEIhKTtR5LqLlrsVBbVWLY5TfLNaSo8JA ACbkXXWBl8q4TLGHga1vc+ZjJtUT84DJYKjJrv73igoVC9dsKb9H37ufnecoz4VccZ5p ThkWwwJXS5XomezpxZ7i1vFXmLTEAxZ/MwqF0TA0LjuMThNGq3jE/0KKSKh+cSPU5MzS w/QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=hh9kCRsfi7eiBKmPpoEUDqaDW8052964g5TJn1B/qcw=; fh=3bh9z2BWAzGAc1byRhMi0K+arMZmX5BQHE0sOxINdyU=; b=CJjxUxhQne5pxB9bNsDxkCLg7jgEMNx1+sLtyz3UZARZ6XBFxiBNmhwmq0oCOyEtqa Mhyh265kGAiQE/+YEYa+6ARWcTzvRh5/IA6pjBJGWoiW9L2Ag7hJxWKhxkrY6I7jjal7 eSAqwpk2NykXL2n/LkF1Ezr0y6nspYIB3z++WY6JVMh4KTr/PoXPNjLF67i2KOK3UhXZ KzGZqChg4n3mS4JxsWEJWP6Vqx4YxP/ikQ4ljgq5n3jgBC9zj8bOEb0D0Qqakcse2x13 BDVRTdPugQgXgjxibiUF1APoY2igDm4fQ9fXrY5Ui67SqrRIaZ+86/JT6RkBKxMM7ij0 IFtw==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=R44fIvUL; spf=pass (google.com: domain of fm-1325773-20240405163225b1cf2978f16d381092-7thw9a@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-1325773-20240405163225b1cf2978f16d381092-7tHw9a@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Return-Path: Received: from mta-64-228.siemens.flowmailer.net (mta-64-228.siemens.flowmailer.net. [185.136.64.228]) by gmr-mx.google.com with ESMTPS id c4-20020a63d504000000b005f0a5113629si153309pgg.3.2024.04.05.09.32.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Apr 2024 09:32:26 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-1325773-20240405163225b1cf2978f16d381092-7thw9a@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) client-ip=185.136.64.228; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=R44fIvUL; spf=pass (google.com: domain of fm-1325773-20240405163225b1cf2978f16d381092-7thw9a@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-1325773-20240405163225b1cf2978f16d381092-7tHw9a@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: by mta-64-228.siemens.flowmailer.net with ESMTPSA id 20240405163225b1cf2978f16d381092 for ; Fri, 05 Apr 2024 18:32:25 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=chris.larson@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=hh9kCRsfi7eiBKmPpoEUDqaDW8052964g5TJn1B/qcw=; b=R44fIvUL5FPbZSnLQGnfnrlxuO4tkk1zl0G9lTDVY4QzXNZJtEEiKvkEZAPA9V96hP1eyN /VI3waI04tl2vY799eITcwyGpJYgWPetWoPvTSFvNvWqIc3VcpmSNzdPQg3CxBvcuBjdylRH yxzi4bXTtRiPRW+QutiBsvUlpDDrI=; From: chris.larson@siemens.com To: isar-users@googlegroups.com Cc: Christopher Larson Subject: [PATCH 5/9] isar-sstate: add --excluded-tasks argument Date: Fri, 5 Apr 2024 16:31:31 +0000 Message-Id: <20240405163135.2987489-6-chris.larson@siemens.com> In-Reply-To: <20240405163135.2987489-1-chris.larson@siemens.com> References: <20240405163135.2987489-1-chris.larson@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1325773:519-21489:flowmailer X-TUID: 8mvl1RCzRF3D From: Christopher Larson This allows the user to override the default lists of tasks to ignore when linting the sstate cache. Submitted at https://groups.google.com/g/isar-users/c/2NB-PXyswq8/m/Ca1TO65TAQAJ. Signed-off-by: Christopher Larson --- scripts/isar-sstate | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/isar-sstate b/scripts/isar-sstate index d68b8938..a4429b7a 100755 --- a/scripts/isar-sstate +++ b/scripts/isar-sstate @@ -128,6 +128,7 @@ apt-get install python3-botocore import argparse from collections import namedtuple import datetime +from fnmatch import fnmatchcase import os import re import shutil @@ -154,6 +155,8 @@ try: except ModuleNotFoundError: s3_supported = False +DEFAULT_IGNORED_TASKS = "rootfs_wicenv,image_wic" + SstateCacheEntry = namedtuple( 'SstateCacheEntry', 'hash path arch pn task suffix islink age size'.split()) @@ -614,6 +617,9 @@ def arguments(): parser.add_argument( '--lint-stamps', default=False, action='store_true', help="lint: assume target is a stamps directory (target must be a local path)") + parser.add_argument( + '--excluded-tasks', type=str, default=DEFAULT_IGNORED_TASKS, + help="lint: comma-separated list of tasks to ignore (default: %(default)s)") args = parser.parse_args() if args.command in 'upload analyze'.split() and args.source is None: @@ -622,6 +628,7 @@ def arguments(): elif args.command in 'info clean'.split() and args.source is not None: print(f"ERROR: '{args.command}' must not have a source (only a target)") sys.exit(1) + args.excluded_tasks = args.excluded_tasks.split(',') return args @@ -820,13 +827,14 @@ def sstate_analyze(source, target, **kwargs): print('\n'.join(out)) -def sstate_lint(target, verbose, sources_dir, build_dir, exit_code, pedantic, lint_stamps, **kwargs): +def sstate_lint(target, verbose, sources_dir, build_dir, exit_code, pedantic, lint_stamps, + excluded_tasks, **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() + ADDITIONAL_IGNORED_TASKS = list() if pedantic else excluded_tasks if not target.exists(): print(f"WARNING: target {target} does not exist. Nothing to analyze.") return 0 @@ -840,7 +848,7 @@ def sstate_lint(target, verbose, sources_dir, build_dir, exit_code, pedantic, li hits_builddir = 0 hits_other = 0 for sig in cache_sigs.values(): - if sig.task in ADDITIONAL_IGNORED_TASKS: + if any(fnmatchcase(sig.task, pattern) for pattern in ADDITIONAL_IGNORED_TASKS): continue sig_file = target.download(sig.path) -- 2.39.2