From patchwork Mon Oct 19 14:39:22 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Otavio Salvador X-Patchwork-Id: 101289 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3988CCF2E3 for ; Mon, 19 Oct 2026 14:39:41 +0000 (UTC) Received: from mail-dl1-f54.google.com (mail-dl1-f54.google.com [74.125.82.54]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.36168.1792420776743002069 for ; Mon, 19 Oct 2026 07:39:36 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: gmail.com, ip: 74.125.82.54, mailfrom: otavio.salvador@gmail.com) Received: by mail-dl1-f54.google.com with SMTP id a92af1059eb24-14fc585291cso419103c88.1 for ; Mon, 19 Oct 2026 07:39:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792420776; x=1793025576; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=5enOFX9A5/SUMjHCoqypP1fihy+KGdCQPpQgu0yd0Zg=; b=q9R+ArA/gIC5SNkYmTyLbc/Qt3P9bSkUOVy6GuvsEEirDOz/NaWW1N7DKV2XT+QYHL EO6mxkrgSI8r/b33BFLu9elgvi7nx3GdclRaxHIfOGYegoPY9g7M1Bh7ZcXA+H5KdeJs bNgPQQWA2gPF9Darl3zxKzwe1AA7gRsd22YpjXKLDZJKZDZXdYTZhuyPwevPVwH79ei5 9n0RRmZ6nKojj6W4A1ZkQhCOmcm30NikOZKh8jsstFWGPk1fzVhUbfCsRD5WTUMVEKx9 CcJv8yPsjlufjoR/qyTntu1fzjLG/Jn9epiClqxESJJu1joiavVesuX1odJaSP7v0/U2 kNuQ== X-Gm-Message-State: AFq9FYIl4SmT2wZ1XlA9q82Wcwxy+U3UwPUD0GM/LlYVmp1uUutmQtT2 TsgKYa0YMwX9jnGIl4Ob+Ki6vd3aiDhyHfjxfcljaKj4/JrVn4ctxfqkwXWSAD+C X-Gm-Gg: AYBFou3wA9RLCiQ3dA5yyhKl5b8MLmgEjIVvl5/zXcbC6qbApqpIz7GQ1SKnJUpG0ih 94Q9Op2PepfXD2OHpp9qZjXQC+2iez/+xdcmxZbbRZEWzta2Y6X49v6u1c6MJJMIVDczI1dEclh V2fzYxR8feQudrwIScJ1kW0SNolRgGW/xbXPng6g5pitiGCsdlF02C8oXXJ6p788iLhzCYASDCi Tt5XhZu94g2Gm/rucqMVC6fxEoUIJeek83J5jQgJ8xmh9xTzTy62V4M++QFPf+R2yh6LQT/9GD1 D5wV4wxyF17qYzT6Dd+I6noJ21bGUB0ricZ8X7nlXffmsAJm8OHOnag3jNGc9yf5iSQzyQQRqEZ btE/d/GzPl86MCWrBoDULE9972ig/W2TFRhfA2RKs7kNlXDbTQBx6MbM1PdP8ewHVsHPUbFvpZw y+/Hg4btRL/gldq7GZuMDKK2EMXoN1dPalRT37cHK1B4f7JBFrkaGi7XTKADhSRNo2sJdiktu6b DYZu3NHVBGSn3Zpukb0qraegh8mRGTSMnUHgbtrBG2Fk9lMl9LFe07P72y6r1Q7P/XC08jR7xlK s1YbGCIoJ1iY0rDPuV8hu/MpV+y5qZIn0kax/8LjsjpbAB2YgU9wIrrO2wPfv14iWg71+9L3v7E p X-Received: by 2002:a05:701b:4550:10b0:150:1cea:31a8 with SMTP id a92af1059eb24-185125790a4mr11609911c88.19.1792420775916; Mon, 19 Oct 2026 07:39:35 -0700 (PDT) Received: from localhost ([201.89.183.74]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-36081ab80f9sm53384824eec.12.2026.10.19.07.39.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Oct 2026 07:39:33 -0700 (PDT) From: Otavio Salvador To: openembedded-core@lists.openembedded.org Cc: Paul Barker , Otavio Salvador , Luciano Dittgen Subject: [PATCH v2 1/3] yocto-check-layer: Add --run-tests to select the tests to run Date: Mon, 19 Oct 2026 11:39:22 -0300 Message-ID: <20261019143924.1521981-2-otavio@ossystems.com.br> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20261019143924.1521981-1-otavio@ossystems.com.br> References: <20261017225656.680168-1-otavio@ossystems.com.br> <20261019143924.1521981-1-otavio@ossystems.com.br> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 19 Oct 2026 14:39:41 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/248176 The common and distro tests ignore --machines, so a BSP layer checked in several runs, one per group of machines, repeats them in each. Add --run-tests, taking [.[.]] as oe-test does, so the common tests can run once and only the BSP ones in the others. A name matching no test is an error rather than a run that checked nothing. Tested on meta-freescale with "--run-tests common distro" and "--run-tests bsp --machines imx8mm-ddr4-evk imx8mn-ddr4-evk". Suggested-by: Luciano Dittgen AI-Generated: Uses Claude Code (Claude Opus 5.5) Signed-off-by: Otavio Salvador --- scripts/yocto-check-layer | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/yocto-check-layer b/scripts/yocto-check-layer index 8c8b4dbcad..e747451366 100755 --- a/scripts/yocto-check-layer +++ b/scripts/yocto-check-layer @@ -32,14 +32,14 @@ CASES_PATHS = [os.path.join(os.path.abspath(os.path.dirname(__file__)), 'lib', 'checklayer', 'cases')] logger = scriptutils.logger_create(PROGNAME, stream=sys.stdout) -def test_layer(td, layer, test_software_layer_signatures): +def test_layer(td, layer, test_software_layer_signatures, run_tests): from checklayer.context import CheckLayerTestContext logger.info("Starting to analyze: %s" % layer['name']) logger.info('Distro: %s' % td['bbvars']["DISTRO"]) logger.info("----------------------------------------------------------------------") tc = CheckLayerTestContext(td=td, logger=logger, layer=layer, test_software_layer_signatures=test_software_layer_signatures) - tc.loadTests(CASES_PATHS) + tc.loadTests(CASES_PATHS, modules=run_tests, modules_required=run_tests) return tc.runTests() def dump_layer_debug(layer): @@ -70,6 +70,8 @@ def main(): help='check that software layers do not change signatures (on by default)') group.add_argument('--without-software-layer-signature-check', action='store_false', dest='test_software_layer_signatures', help='disable signature checking for software layers') + parser.add_argument('--run-tests', nargs='+', metavar='TEST', default=[], + help='Tests to run, as [.[.]] (default: all)') parser.add_argument('-n', '--no-auto', help='Disable auto layer discovery', action='store_true') parser.add_argument('-d', '--debug', help='Enable debug output', @@ -228,7 +230,7 @@ def main(): layers_tested = layers_tested + 1 continue - result = test_layer(td, layer, args.test_software_layer_signatures) + result = test_layer(td, layer, args.test_software_layer_signatures, args.run_tests) results[layer['name']] = result results_status[layer['name']] = 'PASS' if results[layer['name']].wasSuccessful() else 'FAIL' layers_tested = layers_tested + 1 From patchwork Mon Oct 19 14:39:23 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Otavio Salvador X-Patchwork-Id: 101290 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D30CBCCF2E6 for ; Mon, 19 Oct 2026 14:39:41 +0000 (UTC) Received: from mail-dy1-f172.google.com (mail-dy1-f172.google.com [74.125.82.172]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.36373.1792420780017272927 for ; Mon, 19 Oct 2026 07:39:40 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: gmail.com, ip: 74.125.82.172, mailfrom: otavio.salvador@gmail.com) Received: by mail-dy1-f172.google.com with SMTP id 5a478bee46e88-3535bf8b3e0so4640680eec.0 for ; Mon, 19 Oct 2026 07:39:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792420779; x=1793025579; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=QixYrsBApXnXr0nnzdwFL94BOHZO34Po1CcREZ9O3mw=; b=QzHGuuMSAPThX011XOEjr3uBnmAbTwBuOLBQbtbVHwbVNz+6KHqO5FWlAx+sqwSOT/ 8GNi1g0zS71IrGiVCGyc0r7mDyeSTanSk4Ick6l2CszyOPEjH1aSpcJQnkAaIIYDTKyR +EIuxHKrazfbAYiaDIc44yLI5IAYoNN7OPrGMhzQFugCdHwQphjAPRqsb66Ym+oEvCu5 zKZmmPjfWpsFd2wsqTVJkSWiCK1B1ZetGNs4i7NOTuggl9IM+hXD/dVoIpGKwcHDuXVc oGaysNDG/InKMpMETuQyVr0nolU6gdDjfb58Kf33zCdokY3tN8kT97eZxsqHFFU0JEZZ 3kkQ== X-Gm-Message-State: AFq9FYLypiye52hdzsqCZfrY/2o2DLDHwauyOjnVse71/6xK0IoZqSWo Cf9NhusVBDPYvbKlr/4TLgC/TqerY5HUQYw74NpW0Em4OFpqZk/o5p+EsVMBtPXL X-Gm-Gg: AYBFou2RbZXGSnGoUkxlnMlBEFLoThcTzHDoBRpu8lr/bC9ROC6+u+uxKrUaOOuBbjG NCF56OnC5ZpcAsn5uNzyVBBpbtItvOJa2qGGPBIGH2mBRDwirNLyjFm7upUlj3rH9fzs0lcR+gT nNrwZB7cC2iojSUjleqEOVGSLVaKezxAd2dvtK6FQ9cUgB7HLmmYFlkul7WLBAztV+FuhIluqIN +yfV6jL3sAZvt83e47Ubznzh0EA8FENOjsrRckZJ7UGMwIkGjywWSW7A1jiyH6567b59UkivTsf l1PTpRaZi/VI7AyLXrJ/NInytc3X/wfBsFt2514WVSZmI1v21lppbwbLaUZ7si6tpoOMhlfJulu iQbBJWWQysa6VDuYNIbzbE/n1UfWCz/0CG4XqWvTumlD3NvVDJjWTxG/tMhNSphZXFb4k7bes// LT5jQhIHC3BTW2LvIIZkDHHOj7Q+gy4gcmA5FmMysl8EcRQ9Lz+08gPW5vong6zoA+d0eah/dxn 8t7gP5cmVtl3gUZbCAVmv/tkCnRm22izSENetJ5L4ZJ1yCWbsxsH513oEHLYvFerqgJlWuPBiQY keK6bEdWJwnj27/H0g0dEKgWRhfkm6p8jhADYfKqKFSmwV1XakX6ksP3///I4umUBJsD/wY/iTo d X-Received: by 2002:a05:693c:8345:b0:351:bb8f:540c with SMTP id 5a478bee46e88-361a2e36fbamr9940493eec.35.1792420779146; Mon, 19 Oct 2026 07:39:39 -0700 (PDT) Received: from localhost ([201.89.183.74]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-360813b792bsm33957324eec.5.2026.10.19.07.39.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Oct 2026 07:39:38 -0700 (PDT) From: Otavio Salvador To: openembedded-core@lists.openembedded.org Cc: Paul Barker , Otavio Salvador , Luciano Dittgen Subject: [PATCH v2 2/3] yocto-check-layer: Skip initial signatures unless test_signatures runs Date: Mon, 19 Oct 2026 11:39:23 -0300 Message-ID: <20261019143924.1521981-3-otavio@ossystems.com.br> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20261019143924.1521981-1-otavio@ossystems.com.br> References: <20261017225656.680168-1-otavio@ossystems.com.br> <20261019143924.1521981-1-otavio@ossystems.com.br> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 19 Oct 2026 14:39:41 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/248177 Only test_signatures compares against the world signatures dumped before the layer is added, so a run without it, such as "--run-tests bsp", spent a world parse on a dump it never used. Dump them only when --run-tests selects common tests, as it does by default. Tested on meta-freescale with "--run-tests bsp": no initial dump, same results. Suggested-by: Luciano Dittgen AI-Generated: Uses Claude Code (Claude Opus 5.5) Signed-off-by: Otavio Salvador --- scripts/yocto-check-layer | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/yocto-check-layer b/scripts/yocto-check-layer index e747451366..2fcb90acdc 100755 --- a/scripts/yocto-check-layer +++ b/scripts/yocto-check-layer @@ -214,7 +214,9 @@ def main(): logger.info('Getting initial signatures ...') td['builddir'] = builddir try: - td['sigs'], td['tunetasks'] = get_signatures(td['builddir']) + # Only test_signatures, a common test, compares against them + if not args.run_tests or 'common' in [t.split('.')[0] for t in args.run_tests]: + td['sigs'], td['tunetasks'] = get_signatures(td['builddir']) except RuntimeError as e: logger.info(str(e)) results[layer['name']] = None From patchwork Mon Oct 19 14:39:24 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Otavio Salvador X-Patchwork-Id: 101291 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D825CCCF2E3 for ; Mon, 19 Oct 2026 14:39:51 +0000 (UTC) Received: from mail-dy1-f173.google.com (mail-dy1-f173.google.com [74.125.82.173]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.36171.1792420784771859431 for ; Mon, 19 Oct 2026 07:39:44 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: gmail.com, ip: 74.125.82.173, mailfrom: otavio.salvador@gmail.com) Received: by mail-dy1-f173.google.com with SMTP id 5a478bee46e88-3282db206d3so3522835eec.0 for ; Mon, 19 Oct 2026 07:39:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792420784; x=1793025584; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=Dt1guIKB4Ofh5tRDUncqBUYGkXcGxTD/JRznKNGVq10=; b=HEYcpt9yfPSqYUZrxK2h/LKU7I3bW9tKvOklTpchTtEQdks+LZNnqDmlIZA11JoEoG 6NJlzK9lM4GNU1rW7Fh2JVtBkrIR2u5YOWq5U+vrnSJnr+BCc5TP7kJtB8HGAJRIiNdO Vg0ncefS7rLSeDEKk8Eht/uN76i6UmbAok46zsnTPTouvh1AuAXVN7Hu7MtnrSq+kzvR iogbkqz1YNurLHi4+2CG3VwvE9vNCyvoRxKroYAVdng9ee+2a9jTWccxzwJkag2GeWy5 zYnmpfrYxJKDgUkNcVrgGCFQ4g7ge+s14JkxelzFdOHhi0xsmC6qQE6TH1jgtg1pqA1Y FE9Q== X-Gm-Message-State: AFq9FYJXOrRcDkD/JnaLxcZkfDzCGPxSYJJ9zihJ+j5HZjBFqTruE9eM BDaG/0vdr3mIdpRjxaTRt0K9uJi/RfA/r1aZPVCYV1hdy7nvhwqqh3kKJAF/drAQ X-Gm-Gg: AYBFou2FbZpEspEHn50XN7dgamqXVIbIcTMoLAgDlqYjyM3T8PuT4fxPF1fy3T92qif b3CXeOI8bEPhscaWnLyhbMi3Bl1q3ZnrSkOx1N/HNyHFnP2Kif/XFYkKxWQ8U+ijGTcrSnhrQIB FYD01LnN8ZaRLnhMHa10yGomj3Xc7ZX6/Fi18B1eh4CenTVZsADregTEjHVpC6b0zUr/9taVc/Y RJ495OtWC5Hjvynv6zVUkPBq+g6NufPjhrli0rVwsjFTB2JeZ5DKKOkqG0V8r2d/KMFcmHLHH5M p/PWFCdQ5cW2x+E+pfwo7inYI9MgjIPkBcpDtE3LmPyQv/Mb7c/S1rFhPPFaHiwjvIcobOFqgoW /jlLI6rVUyOEDfkm+JUGCuziE6hHl1k0iTjijSd4Zj5WURawGL2YOD0YWo0nhZgkle/KUET8dme YJD5NjO5r30ZVnzCh5EvbHy2KGUyvNdsa7PqaT8Go/N3xptO1HVWj+lNhBPdQnVxFcFHkHoru3A yp69HfJ0L2wIpyS787fp+6lPuarRJBGqstLU30mH79xJDMuY23IUlCjs6iPJEEzcI33k4D5CVJ7 z8J8AlQ7XRz7iJJjpIYC+NPppBU5ulzYZJ8cDClCeaYBkrRcHifsp36e3wYAMrY5TuQY3Xmg3xO 7lIX4RheV7fM= X-Received: by 2002:a05:7301:6447:b0:358:eccb:af7c with SMTP id 5a478bee46e88-361a312cb5emr15309987eec.33.1792420782372; Mon, 19 Oct 2026 07:39:42 -0700 (PDT) Received: from localhost ([201.89.183.74]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-360813b6791sm37384569eec.6.2026.10.19.07.39.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Oct 2026 07:39:41 -0700 (PDT) From: Otavio Salvador To: openembedded-core@lists.openembedded.org Cc: Paul Barker , Otavio Salvador , Luciano Dittgen Subject: [PATCH v2 3/3] checklayer: Share each world signature dump between the tests needing it Date: Mon, 19 Oct 2026 11:39:24 -0300 Message-ID: <20261019143924.1521981-4-otavio@ossystems.com.br> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20261019143924.1521981-1-otavio@ossystems.com.br> References: <20261017225656.680168-1-otavio@ossystems.com.br> <20261019143924.1521981-1-otavio@ossystems.com.br> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 19 Oct 2026 14:39:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/248178 test_signatures and test_world dump the same world signatures, with and without -k, and so do test_machine_signatures and test_machine_world for each machine; when the dump succeeds, the second only repeats a world parse. Make get_signatures() always run bitbake with -k and return the error along with the signatures, and dump once in setUpClass(): for the common tests, and per machine for the BSP ones. test_world and test_machine_world check the stored error, the signature tests use the stored signatures. Tested on meta-freescale with two machines: 5 world dumps instead of 8, same results; a recipe breaking world on one machine fails test_machine_world for that machine only, now listing all its errors. Suggested-by: Luciano Dittgen Suggested-by: Paul Barker AI-Generated: Uses Claude Code (Claude Opus 5.5) Signed-off-by: Otavio Salvador --- Changes in v2: - Replace the cache in get_signatures(), keyed on bblayers.conf, MACHINE and the extra variables, with one dump in setUpClass(): once for the common tests and once per machine for the BSP tests (Paul Barker). - get_signatures() always runs with -k and returns the error, or None, with the signatures, instead of taking failsafe. A failed dump is no longer run a second time without -k. scripts/lib/checklayer/__init__.py | 28 +++++++++++++------------- scripts/lib/checklayer/cases/bsp.py | 15 +++++++++----- scripts/lib/checklayer/cases/common.py | 20 +++++++++++------- scripts/yocto-check-layer | 4 +++- 4 files changed, 40 insertions(+), 27 deletions(-) diff --git a/scripts/lib/checklayer/__init__.py b/scripts/lib/checklayer/__init__.py index aa19a8e2ae..9d79ae9cd0 100644 --- a/scripts/lib/checklayer/__init__.py +++ b/scripts/lib/checklayer/__init__.py @@ -287,7 +287,12 @@ def check_command(error_msg, cmd, cwd=None): raise RuntimeError(msg) return output -def get_signatures(builddir, failsafe=False, machine=None, extravars=None): +def get_signatures(builddir, machine=None, extravars=None): + ''' + Returns the world signatures, the tasks of each tune and None, or the + error when some recipes failed, with the signatures of the others + (None when none were written). + ''' import re # some recipes needs to be excluded like meta-world-pkgdata @@ -304,25 +309,20 @@ def get_signatures(builddir, failsafe=False, machine=None, extravars=None): cmd += ' ' if machine: cmd += 'MACHINE=%s ' % machine - cmd += 'bitbake ' - if failsafe: - cmd += '-k ' - cmd += '-S lockedsigs world' + cmd += 'bitbake -k -S lockedsigs world' sigs_file = os.path.join(builddir, 'locked-sigs.inc') if os.path.exists(sigs_file): os.unlink(sigs_file) + error = None try: check_command('Generating signatures failed. This might be due to some parse error and/or general layer incompatibilities.', cmd, builddir) except RuntimeError as ex: - if failsafe and os.path.exists(sigs_file): - # Ignore the error here. Most likely some recipes active - # in a world build lack some dependencies. There is a - # separate test_machine_world_build which exposes the - # failure. - pass - else: - raise + # Most likely some recipes active in a world build lack some + # dependencies: the caller decides whether that is fatal. + error = str(ex) + if not os.path.exists(sigs_file): + return (None, None, error) sig_regex = re.compile(r"^(?P[^:]*:[^:]*):(?P[^:]*) .$") assignment_regex = re.compile(r"^\s*(?P\S+)\s*\+?=") @@ -362,7 +362,7 @@ def get_signatures(builddir, failsafe=False, machine=None, extravars=None): if not sigs: raise RuntimeError('Can\'t load signatures from %s' % sigs_file) - return (sigs, tune2tasks) + return (sigs, tune2tasks, error) def get_depgraph(targets=['world'], failsafe=False): ''' diff --git a/scripts/lib/checklayer/cases/bsp.py b/scripts/lib/checklayer/cases/bsp.py index b76163fb56..6bf04b5b00 100644 --- a/scripts/lib/checklayer/cases/bsp.py +++ b/scripts/lib/checklayer/cases/bsp.py @@ -14,6 +14,10 @@ class BSPCheckLayer(OECheckLayerTestCase): if self.tc.layer['type'] not in (LayerType.BSP, LayerType.CORE): raise unittest.SkipTest("BSPCheckLayer: Layer %s isn't BSP one." %\ self.tc.layer['name']) + # test_machine_world and test_machine_signatures share one world + # dump per machine + self.machine_sigs = {machine: get_signatures(self.td['builddir'], machine=machine) + for machine in self.td['machines'] or []} def test_bsp_defines_machines(self): self.assertTrue(self.tc.layer['conf']['machines'], @@ -45,10 +49,9 @@ class BSPCheckLayer(OECheckLayerTestCase): msg = [] for machine in self.td['machines']: # In contrast to test_machine_signatures() below, errors are fatal here. - try: - get_signatures(self.td['builddir'], failsafe=False, machine=machine) - except RuntimeError as ex: - msg.append(str(ex)) + error = self.machine_sigs[machine][2] + if error: + msg.append(error) if msg: msg.insert(0, 'The following machines broke a world build:') self.fail('\n'.join(msg)) @@ -80,7 +83,9 @@ class BSPCheckLayer(OECheckLayerTestCase): tunes = {} # Preserve ordering of machines as chosen by the user. for machine in self.td['machines']: - curr_sigs, tune2tasks = get_signatures(self.td['builddir'], failsafe=True, machine=machine) + curr_sigs, tune2tasks, error = self.machine_sigs[machine] + if curr_sigs is None: + raise RuntimeError(error) # Invert the tune -> [tasks] mapping. tasks2tune = {} for tune, tasks in tune2tasks.items(): diff --git a/scripts/lib/checklayer/cases/common.py b/scripts/lib/checklayer/cases/common.py index d20559e163..812bb6e637 100644 --- a/scripts/lib/checklayer/cases/common.py +++ b/scripts/lib/checklayer/cases/common.py @@ -11,6 +11,11 @@ from checklayer import get_signatures, LayerType, check_command, compare_signatu from checklayer.case import OECheckLayerTestCase class CommonCheckLayer(OECheckLayerTestCase): + @classmethod + def setUpClass(cls): + # test_world and test_signatures share one world dump + cls.world_sigs, _, cls.world_error = get_signatures(cls.td['builddir']) + def test_readme(self): """ Test that the layer contains a valid README file and that is meets @@ -98,7 +103,8 @@ class CommonCheckLayer(OECheckLayerTestCase): are not actually buildable, so here we fail when "bitbake -S none world" fails. ''' - get_signatures(self.td['builddir'], failsafe=False) + if self.world_error: + raise RuntimeError(self.world_error) def test_world_inherit_class(self): ''' @@ -106,10 +112,9 @@ class CommonCheckLayer(OECheckLayerTestCase): class, which can do additional per-recipe test cases. ''' msg = [] - try: - get_signatures(self.td['builddir'], failsafe=False, machine=None, extravars='BB_ENV_PASSTHROUGH_ADDITIONS="$BB_ENV_PASSTHROUGH_ADDITIONS INHERIT" INHERIT="yocto-check-layer"') - except RuntimeError as ex: - msg.append(str(ex)) + _, _, error = get_signatures(self.td['builddir'], machine=None, extravars='BB_ENV_PASSTHROUGH_ADDITIONS="$BB_ENV_PASSTHROUGH_ADDITIONS INHERIT" INHERIT="yocto-check-layer"') + if error: + msg.append(error) if msg: msg.insert(0, 'Layer %s failed additional checks from yocto-check-layer.bbclass\nSee below log for specific recipe parsing errors:\n' % \ self.tc.layer['name']) @@ -135,8 +140,9 @@ class CommonCheckLayer(OECheckLayerTestCase): raise unittest.SkipTest("Not testing for signature changes in a software layer %s." \ % self.tc.layer['name']) - curr_sigs, _ = get_signatures(self.td['builddir'], failsafe=True) - msg = compare_signatures(self.td['sigs'], curr_sigs) + if self.world_sigs is None: + raise RuntimeError(self.world_error) + msg = compare_signatures(self.td['sigs'], self.world_sigs) if msg is not None: self.fail('Adding layer %s changed signatures.\n%s' % (self.tc.layer['name'], msg)) diff --git a/scripts/yocto-check-layer b/scripts/yocto-check-layer index 2fcb90acdc..ed8841d1f3 100755 --- a/scripts/yocto-check-layer +++ b/scripts/yocto-check-layer @@ -216,7 +216,9 @@ def main(): try: # Only test_signatures, a common test, compares against them if not args.run_tests or 'common' in [t.split('.')[0] for t in args.run_tests]: - td['sigs'], td['tunetasks'] = get_signatures(td['builddir']) + td['sigs'], td['tunetasks'], error = get_signatures(td['builddir']) + if error: + raise RuntimeError(error) except RuntimeError as e: logger.info(str(e)) results[layer['name']] = None