From patchwork Tue Feb 27 21:56:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 40173 X-Patchwork-Delegate: steve@sakoman.com 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 D0E9BC5478C for ; Tue, 27 Feb 2024 21:57:20 +0000 (UTC) Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) by mx.groups.io with SMTP id smtpd.web10.1938.1709071031595008604 for ; Tue, 27 Feb 2024 13:57:11 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20230601.gappssmtp.com header.s=20230601 header.b=1tMWqqXz; spf=softfail (domain: sakoman.com, ip: 209.85.167.171, mailfrom: steve@sakoman.com) Received: by mail-oi1-f171.google.com with SMTP id 5614622812f47-3c132695f1bso2731774b6e.2 for ; Tue, 27 Feb 2024 13:57:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20230601.gappssmtp.com; s=20230601; t=1709071031; x=1709675831; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Ig4YnMfLk9lH9UyCMPPVihuSoTd9cKR5BAEbjcye/lQ=; b=1tMWqqXz7Ucl7gE3btv8BbqDoCZFMVrVar9V72tU8Z5MsEQ7I4hyCbm6VuC99CN6ub ZyguJr51DEIRZKq9DvOwtuvXbq61t1fdgp7QwEn51ZO27mJ7pjaFbAI83pVrsWb7ZnUN CPKSc+7JAyLe8QFfjhjPXo7d06wC9wLDXvhIkmzZeBVixoPyH88tMjtB8YXFfQUIv4v5 +pmm9la9zE4C9QZ4S0GovH4yR4Ku91+UXxWeNmvJ72yQ1+BatTuo5oiW5FTZBbyvNvHt zur8mfvSpBf3+elFg93XUNebZkawwnA6Af087NDDf+Klf1mEWh5X6huAQiSAfvTi0yKU hSIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709071031; x=1709675831; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ig4YnMfLk9lH9UyCMPPVihuSoTd9cKR5BAEbjcye/lQ=; b=Pbi1wrXoVM0woz8eV7jHnz/ZgCWypei428B8sU8YKdIwc1G3JOtJhPBkhrhneJWF99 /cpphMCPHxW9M7VTZux+pLHUFnUc94Yvaxg5NAdUDI6JwP5ygSiek9DsierjYFZwfKhr WJQHnpgZhattjof6gPeBnMSeEfyAZs7hQT+gOO141mgbGMwR/llK5asY2dxLFk8p2Im/ lgf21j4lEdjUnxGBgd/75bzURLLrWnkvUKmtTYVJPkbrGY+cKoIIDxfwVpsjFyyYh7AN a2Pg30XgqZtq/Rkd8vgGg4ABH+heNhaKTOjCrsKaHiZcl4buQg7GhVmF7fk1BCW/YqSz feow== X-Gm-Message-State: AOJu0Yx2eIWRWy1hHwER9hM09SFatLl7x3p7YeqqvnI+AXXXq7uBF7yn hKRswQ5blgfObUSclTfYb2dM566DdDh8ssdMbhQQGwetOC0MdZYya2KacsuVVYyhpAAaLnrAjju 0gw4= X-Google-Smtp-Source: AGHT+IHWE7opyP5uEeAinMDX0Exs8Hv+0BXEvxD8upQ9fZy3zY19VQF3t5Ffkyw+9Q/qHHoNK8nYcg== X-Received: by 2002:a05:6808:e8c:b0:3c1:b1b1:2a19 with SMTP id k12-20020a0568080e8c00b003c1b1b12a19mr2316050oil.55.1709071030700; Tue, 27 Feb 2024 13:57:10 -0800 (PST) Received: from hexa.router0800d9.com (dhcp-72-234-108-41.hawaiiantel.net. [72.234.108.41]) by smtp.gmail.com with ESMTPSA id n7-20020aa78a47000000b006e50bbf4e71sm4936428pfa.9.2024.02.27.13.57.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 13:57:10 -0800 (PST) From: Steve Sakoman To: openembedded-core@lists.openembedded.org Subject: [OE-core][kirkstone 01/16] recipetool/create_buildsys_python: use importlib instead of imp Date: Tue, 27 Feb 2024 11:56:48 -1000 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 27 Feb 2024 21:57:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/196300 From: Chris Laplante 'imp' was deprecated in Python 3.4 and removed in 3.12. The piece of importlib we use has been around since 3.3. Signed-off-by: Chris Laplante Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie Cherry-picked from master: 457f0dad87b4e45a53865b5ad2c150215bd74019 Signed-off-by: Adrian Freihofer Signed-off-by: Steve Sakoman --- scripts/lib/recipetool/create_buildsys_python.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/lib/recipetool/create_buildsys_python.py b/scripts/lib/recipetool/create_buildsys_python.py index 5686a62d3f..a7eed3256f 100644 --- a/scripts/lib/recipetool/create_buildsys_python.py +++ b/scripts/lib/recipetool/create_buildsys_python.py @@ -10,7 +10,7 @@ import codecs import collections import setuptools.command.build_py import email -import imp +import importlib import glob import itertools import logging @@ -561,7 +561,6 @@ class PythonRecipeHandler(RecipeHandler): return deps def parse_pkgdata_for_python_packages(self): - suffixes = [t[0] for t in imp.get_suffixes()] pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR') ldata = tinfoil.config_data.createCopy() @@ -585,7 +584,7 @@ class PythonRecipeHandler(RecipeHandler): continue for fn in files_info: - for suffix in suffixes: + for suffix in importlib.machinery.all_suffixes(): if fn.endswith(suffix): break else: From patchwork Tue Feb 27 21:56:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 40174 X-Patchwork-Delegate: steve@sakoman.com 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 0423EC54E51 for ; Tue, 27 Feb 2024 21:57:21 +0000 (UTC) Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by mx.groups.io with SMTP id smtpd.web10.1939.1709071033024216872 for ; Tue, 27 Feb 2024 13:57:13 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20230601.gappssmtp.com header.s=20230601 header.b=DdjOLc7I; spf=softfail (domain: sakoman.com, ip: 209.85.210.170, mailfrom: steve@sakoman.com) Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-6e4e7e2594cso2715554b3a.2 for ; Tue, 27 Feb 2024 13:57:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20230601.gappssmtp.com; s=20230601; t=1709071032; x=1709675832; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=R0iq8lT/QRFaHWmZOJYB5DfWQpI/c8c4LN02QJ5KwSs=; b=DdjOLc7Ifj4LCSL/F9LcSAXhTBEUTXRGkDdw/9qclkKzsipSZvRsrOW0I/bJ3xvJsK dce0OFKVEQRM/wWaAax2Nil3f+IG9lLWpCxIo625sA6mfIn3xi87Y62P4rj873Fww1FB YEkpTcyYxeJOte4I8JlJx1t9wTxUT+eUpJCpBdMotaxso4BDJ2/ta73gyjiJlq/hzh2U xlxeFpF4Hjg/etgYZ884kVVWVZwoVx0prik5w9mRY1vjZg10m5ed7E+LS2KpHHbbEJiQ WIGlD6Li8Dm3GlOUB2td04qWm5NmrdE6SF4vPewA+m5a+VS1CkYeQhaH3j8cSWdY7VKy k1LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709071032; x=1709675832; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R0iq8lT/QRFaHWmZOJYB5DfWQpI/c8c4LN02QJ5KwSs=; b=qEyRkwdWtqmqj9LeKY5OY4nYzDUIvBFAw3eTDe3sUBqg6VAScUr+hloKvslDD6gGxk 8G5pjSQaCwqoWOjYCOpZ85ee+RGqsSu1zjc42KXIP32Dc86AFEqL6pRSNikd9jFcBDtL HkqaDG5fNfPBaelGZjNBJX8HelWCP+ldQKtqYN9qdKqPrQtZRRmbPjKxtjgcWUb5e6k3 BPjf4CZVF/yEq0p6ZgyzcRKz/CowE3wEIm/PAFq8h4a8AlQSysOpk6XrYOVF/aVJ0dxR c7EL6cBnRdXzF8CT5IcOgU28FWrdvvvYetTSOO866Tl/9RHAlFY071WanGus0uRH+CKy GR6A== X-Gm-Message-State: AOJu0Yw99E/sLyWrY1o6G/tAF3lx56nDlySYpUOOsogIlNcgfZ9mKh7x lRmbRE7xaUPRVa0klqaNlSBneq8P4eDfnC50Q+PYlI7IJ4VI/4+FAqSx1B4txMbw0QRE6lUbGLl wOIs= X-Google-Smtp-Source: AGHT+IFwqqMAT7P7HGHTNv6aqtIw1cGhR7+4UvuKfnTCJcXmn314ureuoDg3yPcVQYTzl0ON5BVd9A== X-Received: by 2002:a05:6a00:1e13:b0:6e4:e43e:dc1f with SMTP id gx19-20020a056a001e1300b006e4e43edc1fmr10465034pfb.32.1709071032311; Tue, 27 Feb 2024 13:57:12 -0800 (PST) Received: from hexa.router0800d9.com (dhcp-72-234-108-41.hawaiiantel.net. [72.234.108.41]) by smtp.gmail.com with ESMTPSA id n7-20020aa78a47000000b006e50bbf4e71sm4936428pfa.9.2024.02.27.13.57.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 13:57:12 -0800 (PST) From: Steve Sakoman To: openembedded-core@lists.openembedded.org Subject: [OE-core][kirkstone 02/16] scripts/runqemu: fix regex escape sequences Date: Tue, 27 Feb 2024 11:56:49 -1000 Message-Id: <2f8982ef4c903f43867da56fcfd080a6556daa8b.1709070850.git.steve@sakoman.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 27 Feb 2024 21:57:21 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/196301 From: Trevor Gamblin When invoking runqemu with Python 3.12, the following warning is encountered: |SyntaxWarning: invalid escape sequence '\.' This is because the interpreter scans the string before it is processed by the regex module, and it interprets the backslash as part of an escape sequence, but not a standard one. This will be registered as an error rather than a warning in future Python versions. To avoid the it, simply add an extra backslash so that Python doesn't misinterpret the string, while the regex parser still sees an escaped '.' character. Signed-off-by: Trevor Gamblin Signed-off-by: Richard Purdie Backported from master: 0e8a4142bb90a92d175df6b2537d24a372356f98 Signed-off-by: Adrian Freihofer Signed-off-by: Steve Sakoman --- scripts/runqemu | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/runqemu b/scripts/runqemu index 8e5d22888d..81d95133b6 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -362,7 +362,7 @@ class BaseConfig(object): if p.endswith('.qemuboot.conf'): self.qemuboot = p self.qbconfload = True - elif re.search('\.bin$', p) or re.search('bzImage', p) or \ + elif re.search('\\.bin$', p) or re.search('bzImage', p) or \ re.search('zImage', p) or re.search('vmlinux', p) or \ re.search('fitImage', p) or re.search('uImage', p): self.kernel = p @@ -376,13 +376,13 @@ class BaseConfig(object): fst = t break if not fst: - m = re.search('.*\.(.*)$', self.rootfs) + m = re.search('.*\\.(.*)$', self.rootfs) if m: fst = m.group(1) if fst: self.check_arg_fstype(fst) - qb = re.sub('\.' + fst + "$", '', self.rootfs) - qb = '%s%s' % (re.sub('\.rootfs$', '', qb), '.qemuboot.conf') + qb = re.sub('\\.' + fst + "$", '', self.rootfs) + qb = '%s%s' % (re.sub('\\.rootfs$', '', qb), '.qemuboot.conf') if os.path.exists(qb): self.qemuboot = qb self.qbconfload = True From patchwork Tue Feb 27 21:56:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 40175 X-Patchwork-Delegate: steve@sakoman.com 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 10A1AC54E56 for ; Tue, 27 Feb 2024 21:57:21 +0000 (UTC) Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by mx.groups.io with SMTP id smtpd.web11.1994.1709071034769359741 for ; Tue, 27 Feb 2024 13:57:14 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20230601.gappssmtp.com header.s=20230601 header.b=fs5ryi2J; spf=softfail (domain: sakoman.com, ip: 209.85.210.180, mailfrom: steve@sakoman.com) Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-6e554f64971so199937b3a.1 for ; Tue, 27 Feb 2024 13:57:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20230601.gappssmtp.com; s=20230601; t=1709071034; x=1709675834; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=wck+Dfnd/ZAjdp9xOoUEc5BQEa0C2oDhVMDLmwR36Bo=; b=fs5ryi2JhRH92iACtHyt3n8XbroqvSGCeRUmNMud1AFaUTenw0hnYL4buEROksNSmG kXz03AGDeXpDOzc6C80avzUvorKQCQyQZuhmh1elasVoUMBPmzUG1kWE7p8bBSVLG6n8 ap3eb7H+Z2MVthVV6G+JV+vNHeb6yYqQPrZlp0HY2kz+St9o1tSimO7kkrmGXFyJFQ4Q EoIG4t18kiE00z92nJgKf2oYtlwGYQSAZCuyvbzKjIbPk7/v8ogyrsjhQjAE8dkO6Guu tXq4DNXHepesnQtPWjxeHQ9uRXdx6D8Xj1sh4OFTPyIXw5vBFnYXR3vUdqi/z7TLS2FB 8gRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709071034; x=1709675834; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wck+Dfnd/ZAjdp9xOoUEc5BQEa0C2oDhVMDLmwR36Bo=; b=isqye+Iuk3K3W4kUCGZ1ZuidnQkbRC8d0XamTZXclAANgb0rdGwZZNEoibB91+Gz3N Wr8DknMcQTQdkLYU2bBTQH/3MP7YXVbuxS+pR1np9D+WlOOqDWn6qWx1vQUqOg4ehANi +zCXagvvcis497gLKJDcBwAfBAN1cRXxpPnZ25aFIGs9p49ALkBkfHD4l9vDu4YRHgV4 1XD1pmryJhxTo61qQ2BwJmP8bkwwzyTil68upb7iD+hf79aI3CGGCldhlgndIew+H9Mp Qy+fqe0cFNaiYAWXiy9TLIoGSF0B3Nlvel61IdxeOlk49jzKmp9kGneufPuj8XsY3ZAD lR/g== X-Gm-Message-State: AOJu0Yz2nZKHavVGAw3wM2607aW8tDiwpUvrB6CNk725Cf55Av53/Z1b 2J+rpObzbM82HxkcvWWnrBY4JV6ukS4e72KL2Rkva4EZiJA/ABXZ3YmdCEbpFQp7uyqV641hlvk I3NU= X-Google-Smtp-Source: AGHT+IHbp3bf8EK2xRCjH79hRSswN22zNmvcF3/wlDWRGwTEtTKB8EvTJuv1oDak34+X1lNdBtCVzg== X-Received: by 2002:a05:6a00:9283:b0:6e5:32e9:2954 with SMTP id jw3-20020a056a00928300b006e532e92954mr805830pfb.16.1709071034048; Tue, 27 Feb 2024 13:57:14 -0800 (PST) Received: from hexa.router0800d9.com (dhcp-72-234-108-41.hawaiiantel.net. [72.234.108.41]) by smtp.gmail.com with ESMTPSA id n7-20020aa78a47000000b006e50bbf4e71sm4936428pfa.9.2024.02.27.13.57.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 13:57:13 -0800 (PST) From: Steve Sakoman To: openembedded-core@lists.openembedded.org Subject: [OE-core][kirkstone 03/16] populate_sdk_ext: use ConfigParser instead of SafeConfigParser Date: Tue, 27 Feb 2024 11:56:50 -1000 Message-Id: <50815c328e677ac079d38dc8555a909f049cf5be.1709070850.git.steve@sakoman.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 27 Feb 2024 21:57:21 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/196302 From: Ross Burton SafeConfigParser was renamed to ConfigParser in 3.2, and the SafeConfigParser alias will be removed in 3.12. Signed-off-by: Ross Burton Signed-off-by: Alexandre Belloni Cherry-picked from master: 71b3e7f71727137b4b996cc4160c9cc1581824b8 Signed-off-by: Adrian Freihofer Signed-off-by: Steve Sakoman --- meta/classes/populate_sdk_ext.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/classes/populate_sdk_ext.bbclass b/meta/classes/populate_sdk_ext.bbclass index ca1b7753cb..bdd86863c6 100644 --- a/meta/classes/populate_sdk_ext.bbclass +++ b/meta/classes/populate_sdk_ext.bbclass @@ -227,7 +227,7 @@ python copy_buildsystem () { # Write out config file for devtool import configparser - config = configparser.SafeConfigParser() + config = configparser.ConfigParser() config.add_section('General') config.set('General', 'bitbake_subdir', conf_bbpath) config.set('General', 'init_path', conf_initpath) From patchwork Tue Feb 27 21:56:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 40172 X-Patchwork-Delegate: steve@sakoman.com 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 D1E30C54E4A for ; Tue, 27 Feb 2024 21:57:20 +0000 (UTC) Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by mx.groups.io with SMTP id smtpd.web11.1996.1709071036434480274 for ; Tue, 27 Feb 2024 13:57:16 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20230601.gappssmtp.com header.s=20230601 header.b=bRABDLR4; spf=softfail (domain: sakoman.com, ip: 209.85.210.170, mailfrom: steve@sakoman.com) Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-6e09143c7bdso2914260b3a.3 for ; Tue, 27 Feb 2024 13:57:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20230601.gappssmtp.com; s=20230601; t=1709071036; x=1709675836; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=gn2GrBm2b8UMJwz9z8J6Rk+NNiDahCAp8AXqltDoxow=; b=bRABDLR4BIifaXlVerKYqNy6W740W0GZWuR+OdfXM7BdVatzLqKd63tsA9sKiGEahz BIkKoUTE6Rikv3jIodeXDjSJtKzPowuv0ilF27ABFbNrW2h6UQBe48rvnBIoQtCCmHtn 1xEojcBjPoLd6D13l0Gwkv7D+vp5BV6McxwT+OXVNIJ61P8OantX7Dxp1eS7m9w7u8jn jN4o/y1AYKspVsNCDl2Tl+yQKhmbqFopfB1nW4TR8gaqqnzjaty/F1nVbucp3/oVlwri bT4Lgwjx8GXPxUj/XUJBUqrsXqtxx/FAAj9aSSgW06k+RmczXji4ORppZbD3ihjnP9l7 PHmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709071036; x=1709675836; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gn2GrBm2b8UMJwz9z8J6Rk+NNiDahCAp8AXqltDoxow=; b=mfmIOrCAWBTkq3ZO6sPQmj2ghvjT3poXVhaKeH3k3eRKPuXXYU/xZ/4tyIWhKxueS2 mbErkAq3OrRsgc3VP1K6GwZ7ZdHbNrykq0PmWWLMtnKuFvSmEvgSZ7tuo86gHjflgDgF Lw1Yvc/F0BsrbtK1t+1mWzuUbailry4zAlkr7pNo0rOUJDw+pLTwgbAkFybFWapBArf9 yiT6j0etTWU8S6hzujmZwEriogGIATy7K3ji9Skj5nAae+FI4clZufYatXPY8I2/l9kd IqX5EjzsPvO32PJ9r+Pv4nnW2eJGdwvHN/vEJOvTvmfi6W+c0PJHnApP8WJuyBqWyKe8 zjFg== X-Gm-Message-State: AOJu0YwgEn1zRxIiUq9T/hI2vNrPw65kKKZEQb7vRTLINKhqXbeuBmfz 6Q6yirppVPrUhQ7dxjKO26ibwPERTKWd1pwJd61CBvpMJpAE4gG3VKMJ9KnlVbjtFaaUH/Xr2zN r15E= X-Google-Smtp-Source: AGHT+IHV5ziBXrWkHIIez4hVvMFtuWKPXzzQ5ZMRINo4ASIUQU55a2Knr3T43aHsoFrxy7jzJX0Mlg== X-Received: by 2002:a05:6a00:982:b0:6e5:584d:8d17 with SMTP id u2-20020a056a00098200b006e5584d8d17mr1805373pfg.15.1709071035638; Tue, 27 Feb 2024 13:57:15 -0800 (PST) Received: from hexa.router0800d9.com (dhcp-72-234-108-41.hawaiiantel.net. [72.234.108.41]) by smtp.gmail.com with ESMTPSA id n7-20020aa78a47000000b006e50bbf4e71sm4936428pfa.9.2024.02.27.13.57.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 13:57:15 -0800 (PST) From: Steve Sakoman To: openembedded-core@lists.openembedded.org Subject: [OE-core][kirkstone 04/16] runqemu: add qmp socket support Date: Tue, 27 Feb 2024 11:56:51 -1000 Message-Id: <31de620e9d899b93c6e982d3a563bbf618ce79c6.1709070850.git.steve@sakoman.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 27 Feb 2024 21:57:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/196303 From: Ross Burton Add support for qmp sockets and defaults to unix:qmp.sock if unspecified Signed-off-by: Ross Burton Signed-off-by: Eilís 'pidge' Ní Fhlannagáin Signed-off-by: Richard Purdie Backported from master: 380631797f0d63124a8c21efa93ab672dbd79283 Qemu throws many warnings without qmp and many runtime tests fail without this patch also on kirkstone. Signed-off-by: Adrian Freihofer Signed-off-by: Steve Sakoman --- scripts/runqemu | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/runqemu b/scripts/runqemu index 81d95133b6..ba7c1b2461 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -82,6 +82,7 @@ of the following environment variables (in any order): kvm-vhost - enable KVM with vhost when running x86/x86_64 (VT-capable CPU required) publicvnc - enable a VNC server open to all hosts audio - enable audio + qmp= - create a QMP socket (defaults to unix:qmp.sock if unspecified) [*/]ovmf* - OVMF firmware file or base name for booting with UEFI tcpserial= - specify tcp serial port number qemuparams= - specify custom parameters to QEMU @@ -216,6 +217,7 @@ class BaseConfig(object): self.cleaned = False # Files to cleanup after run self.cleanup_files = [] + self.qmp = None def acquire_taplock(self, error=True): logger.debug("Acquiring lockfile %s..." % self.taplock) @@ -512,6 +514,10 @@ to your build configuration. elif arg == 'publicvnc': self.publicvnc = True self.qemu_opt_script += ' -vnc :0' + elif arg == "qmp": + self.qmp = "unix:qmp.sock" + elif arg.startswith("qmp="): + self.qmp = arg[len('qmp='):] elif arg.startswith('tcpserial='): self.tcpserial_portnum = '%s' % arg[len('tcpserial='):] elif arg.startswith('qemuparams='): @@ -1332,6 +1338,10 @@ to your build configuration. raise RunQemuError("Failed to boot, QB_SYSTEM_NAME is NULL!") self.qemu_system = qemu_system + def setup_qmp(self): + if self.qmp: + self.qemu_opt += " -qmp %s,server,nowait" % self.qmp + def setup_vga(self): if self.nographic == True: if self.sdl == True: @@ -1462,6 +1472,7 @@ to your build configuration. if self.snapshot: self.qemu_opt += " -snapshot" + self.setup_qmp() self.setup_serial() self.setup_vga() From patchwork Tue Feb 27 21:56:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 40177 X-Patchwork-Delegate: steve@sakoman.com 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 DDC3BC54798 for ; Tue, 27 Feb 2024 21:57:20 +0000 (UTC) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by mx.groups.io with SMTP id smtpd.web11.1998.1709071037963623360 for ; Tue, 27 Feb 2024 13:57:18 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20230601.gappssmtp.com header.s=20230601 header.b=T6tpg6Ov; spf=softfail (domain: sakoman.com, ip: 209.85.210.177, mailfrom: steve@sakoman.com) Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-6e55731af5cso552584b3a.0 for ; Tue, 27 Feb 2024 13:57:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20230601.gappssmtp.com; s=20230601; t=1709071037; x=1709675837; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=6oIouzdcbsfVSPbxD+bzcJLEN+NUMk4RDzRztv/eX04=; b=T6tpg6Ovtywnr83Gr3nOAglR28QS6V0l/9PQ6uyJGc8T1OkaWmFjRlTy68UMOsfS7O gFoKA/tUvNP8sFuF+e176DUlVovOWHAfn8F9BEPuC3BVcGWSfXtLA83bp1fp3O5QVHn/ ialDJMe9hScXR024LMMn8yMENoWpfrn5SUfYp64mcHUdyAP6Q/LJKXfAZUnjIXvZY8sH 4SQLbuw04JuSkSU6/LxK4wb8weIFoiFHNOerIC8tUJtHNafMND5SP8oThN5QRxueIorE i6SKrvXZQu15IV0NRoSNAIWoEkCTSDk+XSGxhr48YGeS8pSCcfMMFsl5NXy4v+Od3pfc nMSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709071037; x=1709675837; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6oIouzdcbsfVSPbxD+bzcJLEN+NUMk4RDzRztv/eX04=; b=LZ4G8X37SdJR7BhBvn++YSRdzQfcccH/K47dW+Y9S9nZJs+BrsQ5zrrcLk/3kurMX0 zFlkswZ+SBBFzmFxPsOy4FUsWM6Jt6WueFWWs7WA89tKO4Kp1+mqXSkKVgfdUoMRmTQy PEWmvz/6K/auZoiJ213czvHMa/HH1lz5H63Qj9KU4XGr5LuLRWHKN6Oiu1fgis80Mpta nGMLpGG1MduMvnRJZYco+qksioE+TDi1kZkrFh7Xlvsoab2HP27spV78b/9KnL8xy4wp YP8jnx9LzCIts3wJqmjPVuFzq86jfjMVf2p6pILQ1zz9QyCf25rC582CJrIzXPE0GGo/ 3IBQ== X-Gm-Message-State: AOJu0Yzdc/LxBjAz//w9adJ80kRRp+pRD1vkFKg/eCcfwQeMlwVtPsR/ uQcQpvbZjC1Tv8QYyeNefIRqvhObSQmfUD6fH9RvprwEbhvIZ48ADcCcrpy2ZNw0aaylKWt0Tzz qYc4= X-Google-Smtp-Source: AGHT+IF+tFSS4ATPASgLtSNr1HVVt0AqPHo+3JwbqFOhpsfTPSERS1PVET3Ys7r8NBWHakREbTZUyg== X-Received: by 2002:a62:ce0d:0:b0:6e1:29ee:aae8 with SMTP id y13-20020a62ce0d000000b006e129eeaae8mr10449499pfg.25.1709071037241; Tue, 27 Feb 2024 13:57:17 -0800 (PST) Received: from hexa.router0800d9.com (dhcp-72-234-108-41.hawaiiantel.net. [72.234.108.41]) by smtp.gmail.com with ESMTPSA id n7-20020aa78a47000000b006e50bbf4e71sm4936428pfa.9.2024.02.27.13.57.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 13:57:16 -0800 (PST) From: Steve Sakoman To: openembedded-core@lists.openembedded.org Subject: [OE-core][kirkstone 05/16] oeqa: replace deprecated assertEquals Date: Tue, 27 Feb 2024 11:56:52 -1000 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 27 Feb 2024 21:57:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/196304 From: Adrian Freihofer assertEquals is deprecated since Python 2.7: https://docs.python.org/2/library/unittest.html#deprecated-aliases It throws errors at least on Python 3.12. Replace it by assertEqual. Signed-off-by: Adrian Freihofer Signed-off-by: Richard Purdie Backported from master: 68286d0b70cf09a0d2950b48945c9192fb8c8769 Signed-off-by: Adrian Freihofer Signed-off-by: Steve Sakoman --- meta/lib/oeqa/sdk/buildtools-cases/sanity.py | 2 +- meta/lib/oeqa/selftest/cases/devtool.py | 2 +- meta/lib/oeqa/selftest/cases/liboe.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/meta/lib/oeqa/sdk/buildtools-cases/sanity.py b/meta/lib/oeqa/sdk/buildtools-cases/sanity.py index 64baaa8f84..68b19f4d47 100644 --- a/meta/lib/oeqa/sdk/buildtools-cases/sanity.py +++ b/meta/lib/oeqa/sdk/buildtools-cases/sanity.py @@ -19,4 +19,4 @@ class SanityTests(OESDKTestCase): # Canonicalise the location of this command tool_path = os.path.realpath(self._run("command -v %s" % command).strip()) # Assert that the tool was found inside the SDK root - self.assertEquals(os.path.commonprefix((sdk_base, tool_path)), sdk_base) + self.assertEqual(os.path.commonprefix((sdk_base, tool_path)), sdk_base) diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index aea2ad6561..dc0fc35062 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py @@ -919,7 +919,7 @@ class DevtoolModifyTests(DevtoolBase): runCmd('git -C %s checkout %s' % (tempdir, branch)) with open(source, "rt") as f: content = f.read() - self.assertEquals(content, expected) + self.assertEqual(content, expected) check('devtool', 'This is a test for something\n') check('devtool-no-overrides', 'This is a test for something\n') check('devtool-override-qemuarm', 'This is a test for qemuarm\n') diff --git a/meta/lib/oeqa/selftest/cases/liboe.py b/meta/lib/oeqa/selftest/cases/liboe.py index afe8f8809f..da88ff480e 100644 --- a/meta/lib/oeqa/selftest/cases/liboe.py +++ b/meta/lib/oeqa/selftest/cases/liboe.py @@ -97,6 +97,6 @@ class LibOE(OESelftestTestCase): dstcnt = len(os.listdir(dst)) srccnt = len(os.listdir(src)) - self.assertEquals(dstcnt, len(testfiles), "Number of files in dst (%s) differs from number of files in src(%s)." % (dstcnt, srccnt)) + self.assertEqual(dstcnt, len(testfiles), "Number of files in dst (%s) differs from number of files in src(%s)." % (dstcnt, srccnt)) oe.path.remove(testloc) From patchwork Tue Feb 27 21:56:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 40176 X-Patchwork-Delegate: steve@sakoman.com 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 EBC9DC54E55 for ; Tue, 27 Feb 2024 21:57:20 +0000 (UTC) Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by mx.groups.io with SMTP id smtpd.web10.1943.1709071039563514129 for ; Tue, 27 Feb 2024 13:57:19 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20230601.gappssmtp.com header.s=20230601 header.b=YqSMftgd; spf=softfail (domain: sakoman.com, ip: 209.85.210.174, mailfrom: steve@sakoman.com) Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-6e46dcd8feaso1731514b3a.2 for ; Tue, 27 Feb 2024 13:57:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20230601.gappssmtp.com; s=20230601; t=1709071039; x=1709675839; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=8NxQipcEdhvhYX9/1TDx27LVifFQLgX/GnCKjILzxLA=; b=YqSMftgdwmpYLYpw4M0ldsvE81mlC2ZdtZnrVGmioxkUd1IWr3dS0cLm40hrSgVB32 P3wO6efmsDq4TwdIU2i2zmOI+8542jWeO/gfN3WL8Vp8unv8sP2BkFKIc0yLjZUskviw boKskVx7mzO9txmM1MI/Qrpyf5JLLkIQk4vzDqNuVbchcNJU8MqGbkcyV6wuEsbbJ6QI Iq5vzLiAwCt+fBDK7+xF8TxnPKCzqEJ5YzEu/w0JucU7KQRgiDbUnAccSadL81xXau9+ dAymcFUzAVK/yIqeJq/x7WnZNyurJGXjiXihtNaQtZjJTphRjGXBdGgyr2LwNy1pbmNm 447w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709071039; x=1709675839; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8NxQipcEdhvhYX9/1TDx27LVifFQLgX/GnCKjILzxLA=; b=E/XdpZuZn92MTh8Es6TjZpjwCVdILNYXV18xQpOfjL25fRHp7cejNsyle2ebKdCpBj +kph1cafFhnZ+a+oE1jisTvSrBUPZJhReVW58FC9F8F4o8pok8ui/bp1aDJPuFGdHrVW 2gCQfxf8MMIE2oAlFb0ouVKollefIVlpbWhESddbCFjEAJBlKDsw7uorpC8t+0UOrn+6 EEDL94d1G4txfhhnWmgx6tlnKDtFr4VYV2LAqRZGyAI+aYgO3+u3sRiuiefkPD00il4m mD/NUrGoIw2EsqRVnU16LoxZg+eH2Lrwo6Mpx2b0zVtY22VqHisLD4bpCuNeZw9AFV9h 1BVw== X-Gm-Message-State: AOJu0YxO9j41hvH9mWnfdV0qUJCCLeJBhZgnPhu+kHDYQFqe6/WbL9kb ZCMOrc43hVchytdJcTwjkStBOgdCAdOReDzxJ3rF4BN1KfwQGHannGbMlpsN1l+Ig6YK86Qfv0x dBCg= X-Google-Smtp-Source: AGHT+IHkzpZWwio8fTPwW3F9R/NXaOy1vA/kG1vGlTc65jPhf1wOZqrA35BIDE/CKujVKIVsUvIf8g== X-Received: by 2002:a05:6a00:1ac7:b0:6e4:6484:1a36 with SMTP id f7-20020a056a001ac700b006e464841a36mr12375241pfv.21.1709071038809; Tue, 27 Feb 2024 13:57:18 -0800 (PST) Received: from hexa.router0800d9.com (dhcp-72-234-108-41.hawaiiantel.net. [72.234.108.41]) by smtp.gmail.com with ESMTPSA id n7-20020aa78a47000000b006e50bbf4e71sm4936428pfa.9.2024.02.27.13.57.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 13:57:18 -0800 (PST) From: Steve Sakoman To: openembedded-core@lists.openembedded.org Subject: [OE-core][kirkstone 06/16] oeqa/selftest/recipetool: fix for python 3.12 Date: Tue, 27 Feb 2024 11:56:53 -1000 Message-Id: <9c1a1110a317e1d64668badb13e74e474f96a7a9.1709070850.git.steve@sakoman.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 27 Feb 2024 21:57:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/196305 From: Adrian Freihofer test_recipetool_create_github and test_recipetool_create_github_tarball fail because the old meson version used by these tests cases does not run on Python 3.12. The issue is in the dependencies.py which comes with meson: ERROR: build/tmp/work/recipetool-3z4osyl7/source/git/mesonbuild/ dependencies.py:777: SyntaxWarning: invalid escape sequence '\.' Use meson 1.3.1 (what is currently also used on master) as a reference for these tests. With this version of meson, recipetool creates recipes named meson_git.bb or meson_1.3.1.bb. Since this looks more reasonable than e.g. python3-meson_git.bb the test gets adapted. Signed-off-by: Adrian Freihofer Signed-off-by: Richard Purdie Backported from master: 7374a8a2810a6cf027bfefefe87691a3529123ff Signed-off-by: Adrian Freihofer Signed-off-by: Steve Sakoman --- meta/lib/oeqa/selftest/cases/recipetool.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py index db8790b57b..db21325155 100644 --- a/meta/lib/oeqa/selftest/cases/recipetool.py +++ b/meta/lib/oeqa/selftest/cases/recipetool.py @@ -444,13 +444,13 @@ class RecipetoolCreateTests(RecipetoolBase): temprecipe = os.path.join(self.tempdir, 'recipe') os.makedirs(temprecipe) recipefile = os.path.join(temprecipe, 'meson_git.bb') - srcuri = 'https://github.com/mesonbuild/meson;rev=0.32.0' + srcuri = 'https://github.com/mesonbuild/meson;rev=1.3.1' result = runCmd(['recipetool', 'create', '-o', temprecipe, srcuri]) self.assertTrue(os.path.isfile(recipefile)) checkvars = {} - checkvars['LICENSE'] = set(['Apache-2.0']) - checkvars['SRC_URI'] = 'git://github.com/mesonbuild/meson;protocol=https;branch=master' - inherits = ['setuptools3'] + checkvars['LICENSE'] = set(['Apache-2.0', 'Proprietary', 'Unknown']) + checkvars['SRC_URI'] = 'git://github.com/mesonbuild/meson;protocol=https;branch=1.3' + inherits = ['python_setuptools_build_meta'] self._test_recipe_contents(recipefile, checkvars, inherits) def test_recipetool_create_python3_setuptools(self): @@ -476,15 +476,15 @@ class RecipetoolCreateTests(RecipetoolBase): # Basic test to ensure github URL mangling doesn't apply to release tarballs temprecipe = os.path.join(self.tempdir, 'recipe') os.makedirs(temprecipe) - pv = '0.32.0' + pv = '1.3.1' recipefile = os.path.join(temprecipe, 'meson_%s.bb' % pv) srcuri = 'https://github.com/mesonbuild/meson/releases/download/%s/meson-%s.tar.gz' % (pv, pv) result = runCmd('recipetool create -o %s %s' % (temprecipe, srcuri)) self.assertTrue(os.path.isfile(recipefile)) checkvars = {} - checkvars['LICENSE'] = set(['Apache-2.0']) + checkvars['LICENSE'] = set(['Apache-2.0', 'Proprietary', 'Unknown']) checkvars['SRC_URI'] = 'https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${PV}.tar.gz' - inherits = ['setuptools3'] + inherits = ['python_setuptools_build_meta'] self._test_recipe_contents(recipefile, checkvars, inherits) def _test_recipetool_create_git(self, srcuri, branch=None): From patchwork Tue Feb 27 21:56:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 40179 X-Patchwork-Delegate: steve@sakoman.com 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 0859BC5478C for ; Tue, 27 Feb 2024 21:57:31 +0000 (UTC) Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by mx.groups.io with SMTP id smtpd.web11.2004.1709071041295234460 for ; Tue, 27 Feb 2024 13:57:21 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20230601.gappssmtp.com header.s=20230601 header.b=p46Cu7CK; spf=softfail (domain: sakoman.com, ip: 209.85.210.181, mailfrom: steve@sakoman.com) Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-6e55bb75c9eso242854b3a.3 for ; Tue, 27 Feb 2024 13:57:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20230601.gappssmtp.com; s=20230601; t=1709071040; x=1709675840; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=NOVProOe8ziag0m+VOO0i/wYkSwjiqazMEVbiKxKklQ=; b=p46Cu7CKXy32hKJ2rs4hkT930SWWvPk4WYqIcUES2Gyt6LeBWTCTYEsJEHC4Qk/LVb 89aaBgR5albILOgGfStS94x8LoqT3HteEQMN9oiKyE1ksKrSt5dqIiYi61loTolS9Il2 1r+2zNthomBCM9ROg0oem6sHu1QY9Ecy44yXWlHntVn7InAKe3IIXgpGJtKuWpALsrpX MA5HOAGzbSzHGGGTVn4IGzhR9++gwp+Lc3x0EQdS8ffWwChdPvk7tF3jyHiEWBnHThd8 bd4htmfxubjW4GAn05C8/X/MlhUTd5EqE0NA6Oj1FtjZdjiw+I2vgAdKNU3oKdkIsnTw Hk7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709071040; x=1709675840; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NOVProOe8ziag0m+VOO0i/wYkSwjiqazMEVbiKxKklQ=; b=C2d596qXie6z3pOm7zVTRGdCtyf1LPcyi+S3xSSE50xQat0zipWXHuoR3P3pqA0wra 48B8GeX3wNDRhDX4v2vdMLCE1UOcbnNapA2e+8idtgkg6fquJXupxXGG6d97WvpHy16a s0Ya8RLTDtGP13Q1ahhoz1awDRzO4771XWX3bEZHUtIVkmQytZd0SHELRxPjtYf/wwMC hSIxr+1ZEENLhFqtSFV3qAlJ36XM1FYQUXE3/caO/+grgyDLZ1sLreh+4eumF0aaGABF mHWj/h6j3Era0JOgBZSdQGdf8EM35lI8rbARNO4F61x9fefQ9cbP9s7eZCj+WxeoS6te CrCQ== X-Gm-Message-State: AOJu0YyrP0DAw6n61B1nl0QFjuyVxM/ZWJgPvyhP/Hn+GjaFLskdNoy1 l/oi7wstakT66CholRwB72WCjp4ApOvqIps1Fs4bWxlBmmKiKi1oS9fofjbVJKrtOO/QqLiBn5G bDVo= X-Google-Smtp-Source: AGHT+IHB1eVQxRQC1vRW9/b1ky2QgOKVr7Qff5BPUaMNys+XVuovnShpkjDQ54PKxTO2h3+fGASHwQ== X-Received: by 2002:a05:6a00:23d1:b0:6e4:f303:5d86 with SMTP id g17-20020a056a0023d100b006e4f3035d86mr11336165pfc.11.1709071040553; Tue, 27 Feb 2024 13:57:20 -0800 (PST) Received: from hexa.router0800d9.com (dhcp-72-234-108-41.hawaiiantel.net. [72.234.108.41]) by smtp.gmail.com with ESMTPSA id n7-20020aa78a47000000b006e50bbf4e71sm4936428pfa.9.2024.02.27.13.57.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 13:57:20 -0800 (PST) From: Steve Sakoman To: openembedded-core@lists.openembedded.org Subject: [OE-core][kirkstone 07/16] oeqa/selftest/recipetool: downgrade meson version to not use pyproject.toml Date: Tue, 27 Feb 2024 11:56:54 -1000 Message-Id: <24bf7bbd1fb21f84539b7a4263d76a33dbacacde.1709070850.git.steve@sakoman.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 27 Feb 2024 21:57:31 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/196306 From: Ross Burton recipetool's pyproject.toml parsing needs tomllib (python 3.11+) or tomli (not a hard dependency), so is prone to failing depending on the host configuration. Downgrade the Meson release used for the checks to 0.52.1, which was the last release before moving to pyproject.toml. Signed-off-by: Ross Burton Signed-off-by: Richard Purdie Backported from master: 6dfe573d83687e5431841f062442b54b9fa22ff3 Signed-off-by: Adrian Freihofer Signed-off-by: Steve Sakoman --- meta/lib/oeqa/selftest/cases/recipetool.py | 29 ++++++++++++---------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py index db21325155..c888770533 100644 --- a/meta/lib/oeqa/selftest/cases/recipetool.py +++ b/meta/lib/oeqa/selftest/cases/recipetool.py @@ -440,17 +440,19 @@ class RecipetoolCreateTests(RecipetoolBase): self._test_recipe_contents(recipefile, checkvars, inherits) def test_recipetool_create_github(self): - # Basic test to see if github URL mangling works + # Basic test to see if github URL mangling works. Deliberately use an + # older release of Meson at present so we don't need a toml parser. temprecipe = os.path.join(self.tempdir, 'recipe') os.makedirs(temprecipe) - recipefile = os.path.join(temprecipe, 'meson_git.bb') - srcuri = 'https://github.com/mesonbuild/meson;rev=1.3.1' - result = runCmd(['recipetool', 'create', '-o', temprecipe, srcuri]) - self.assertTrue(os.path.isfile(recipefile)) + recipefile = os.path.join(temprecipe, 'python3-meson_git.bb') + srcuri = 'https://github.com/mesonbuild/meson;rev=0.52.1' + cmd = ['recipetool', 'create', '-o', temprecipe, srcuri] + result = runCmd(cmd) + self.assertTrue(os.path.isfile(recipefile), msg="recipe %s not created for command %s, output %s" % (recipefile, " ".join(cmd), result.output)) checkvars = {} - checkvars['LICENSE'] = set(['Apache-2.0', 'Proprietary', 'Unknown']) - checkvars['SRC_URI'] = 'git://github.com/mesonbuild/meson;protocol=https;branch=1.3' - inherits = ['python_setuptools_build_meta'] + checkvars['LICENSE'] = set(['Apache-2.0', "Unknown"]) + checkvars['SRC_URI'] = 'git://github.com/mesonbuild/meson;protocol=https;branch=0.52' + inherits = ['setuptools3'] self._test_recipe_contents(recipefile, checkvars, inherits) def test_recipetool_create_python3_setuptools(self): @@ -473,18 +475,19 @@ class RecipetoolCreateTests(RecipetoolBase): self._test_recipe_contents(recipefile, checkvars, inherits) def test_recipetool_create_github_tarball(self): - # Basic test to ensure github URL mangling doesn't apply to release tarballs + # Basic test to ensure github URL mangling doesn't apply to release tarballs. + # Deliberately use an older release of Meson at present so we don't need a toml parser. temprecipe = os.path.join(self.tempdir, 'recipe') os.makedirs(temprecipe) - pv = '1.3.1' - recipefile = os.path.join(temprecipe, 'meson_%s.bb' % pv) + pv = '0.52.1' + recipefile = os.path.join(temprecipe, 'python3-meson_%s.bb' % pv) srcuri = 'https://github.com/mesonbuild/meson/releases/download/%s/meson-%s.tar.gz' % (pv, pv) result = runCmd('recipetool create -o %s %s' % (temprecipe, srcuri)) self.assertTrue(os.path.isfile(recipefile)) checkvars = {} - checkvars['LICENSE'] = set(['Apache-2.0', 'Proprietary', 'Unknown']) + checkvars['LICENSE'] = set(['Apache-2.0']) checkvars['SRC_URI'] = 'https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${PV}.tar.gz' - inherits = ['python_setuptools_build_meta'] + inherits = ['setuptools3'] self._test_recipe_contents(recipefile, checkvars, inherits) def _test_recipetool_create_git(self, srcuri, branch=None): From patchwork Tue Feb 27 21:56:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 40180 X-Patchwork-Delegate: steve@sakoman.com 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 2CA8CC54E55 for ; Tue, 27 Feb 2024 21:57:31 +0000 (UTC) Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by mx.groups.io with SMTP id smtpd.web10.1944.1709071043435582258 for ; Tue, 27 Feb 2024 13:57:23 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20230601.gappssmtp.com header.s=20230601 header.b=cd+LW4Qu; spf=softfail (domain: sakoman.com, ip: 209.85.210.175, mailfrom: steve@sakoman.com) Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-6e48eef8be5so3413121b3a.1 for ; Tue, 27 Feb 2024 13:57:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20230601.gappssmtp.com; s=20230601; t=1709071043; x=1709675843; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=ehqBgD11gA5OQRRK8yuMiy6VAOJ3FCUVFXXOgDenIwE=; b=cd+LW4QucrbWxKkjIhjQxK2+okdOsJhPV719gIc5HMLgNTzpYpx1324oIujFnDSL5P Tvf6L+u0cF7ACIgDCDOR39e80KO+HssO/QK953AlisT/28FvjpFHegjeGzzH+z9HHm52 TPd5jiJIYfURLU2vLr30lLRTE45xYhn0pk8ZQgHc5HBPdDsW9FvpkMaKyqGA6x6sWT+A M0GmRmmabvLhs8nDA2LlubBMV+VlMXJsvH8NupCdH+HX0KLScYR+XF9oxQzIXE6ytid0 m18WSyPM3Iw+iZ6ZyxRgl80dmVPPeroyoEWSVptl8G0qFQwE2s/O8wznRH6qTjv3GWS9 BvtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709071043; x=1709675843; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ehqBgD11gA5OQRRK8yuMiy6VAOJ3FCUVFXXOgDenIwE=; b=YKeRrKcui45aaO/cNi/JkZ1xfhXllVe/H6xaI32YELB5m+SAnRgLAMWAs3+9nKL4Uo MZ7T8NK9AxIc4aXNWEqAHmSvRWhLDmfBOhIkJk8up96gC1+0ULCaS7KUH1vBeo1WMyzJ VEIsoDMQCE50g5dVIxLETYeB3N5vzPBPD0tJmbK1Eft26iu2W32bDnP6xFvOlY1wvq4Q FZObmimj97Tr0ILwxUYC03LF31rqgjDZTqw04gfZMyZTlFTddD01nvrFarHIKoVYx2N0 VJEqT9xVYUqlF6QEu0GXoW4H8jAxd6dljhVecj/2sdjN1OtJW+2MTcl0T+Eq1FAWFQKy cu8A== X-Gm-Message-State: AOJu0YxEUzKTE2JOjdHqrNxSifX4c0KmqnUD/ImyBBF4TaL+JYE3gmlW ojbz9GkG8O/DHTL9LS4RqZFsJi7tAbddouHh9pmzt6ALZv09AvrZfvM6pq4C8/uxVdkX51jJaGZ fSb8= X-Google-Smtp-Source: AGHT+IGFG9XiPpOn2Tm3LvpjG55sfdBIW/sKq4ZaGEhfHQsgt8GcHAwl841wyvPgHtFSEvWCuCF/tQ== X-Received: by 2002:aa7:8450:0:b0:6e4:5cf5:1b5b with SMTP id r16-20020aa78450000000b006e45cf51b5bmr9607313pfn.30.1709071042670; Tue, 27 Feb 2024 13:57:22 -0800 (PST) Received: from hexa.router0800d9.com (dhcp-72-234-108-41.hawaiiantel.net. [72.234.108.41]) by smtp.gmail.com with ESMTPSA id n7-20020aa78a47000000b006e50bbf4e71sm4936428pfa.9.2024.02.27.13.57.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 13:57:22 -0800 (PST) From: Steve Sakoman To: openembedded-core@lists.openembedded.org Subject: [OE-core][kirkstone 08/16] oeqa/selftest/recipetool: expect meson.bb Date: Tue, 27 Feb 2024 11:56:55 -1000 Message-Id: <979b216330b2f4e8ab9d4e615d4e83997d59def0.1709070850.git.steve@sakoman.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 27 Feb 2024 21:57:31 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/196307 From: Adrian Freihofer Latest recipetool from master branch generates a pyhton3-meson.bb recipe while the older version from kirkstone generates a meson.bb. Change the test to pass with meson.bb. Signed-off-by: Adrian Freihofer Signed-off-by: Steve Sakoman --- meta/lib/oeqa/selftest/cases/recipetool.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py index c888770533..a2d8d292ad 100644 --- a/meta/lib/oeqa/selftest/cases/recipetool.py +++ b/meta/lib/oeqa/selftest/cases/recipetool.py @@ -444,7 +444,7 @@ class RecipetoolCreateTests(RecipetoolBase): # older release of Meson at present so we don't need a toml parser. temprecipe = os.path.join(self.tempdir, 'recipe') os.makedirs(temprecipe) - recipefile = os.path.join(temprecipe, 'python3-meson_git.bb') + recipefile = os.path.join(temprecipe, 'meson_git.bb') srcuri = 'https://github.com/mesonbuild/meson;rev=0.52.1' cmd = ['recipetool', 'create', '-o', temprecipe, srcuri] result = runCmd(cmd) @@ -480,7 +480,7 @@ class RecipetoolCreateTests(RecipetoolBase): temprecipe = os.path.join(self.tempdir, 'recipe') os.makedirs(temprecipe) pv = '0.52.1' - recipefile = os.path.join(temprecipe, 'python3-meson_%s.bb' % pv) + recipefile = os.path.join(temprecipe, 'meson_%s.bb' % pv) srcuri = 'https://github.com/mesonbuild/meson/releases/download/%s/meson-%s.tar.gz' % (pv, pv) result = runCmd('recipetool create -o %s %s' % (temprecipe, srcuri)) self.assertTrue(os.path.isfile(recipefile)) From patchwork Tue Feb 27 21:56:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 40181 X-Patchwork-Delegate: steve@sakoman.com 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 38EAAC54E51 for ; Tue, 27 Feb 2024 21:57:31 +0000 (UTC) Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) by mx.groups.io with SMTP id smtpd.web11.2008.1709071046624600362 for ; Tue, 27 Feb 2024 13:57:26 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20230601.gappssmtp.com header.s=20230601 header.b=YRn1voiY; spf=softfail (domain: sakoman.com, ip: 209.85.166.51, mailfrom: steve@sakoman.com) Received: by mail-io1-f51.google.com with SMTP id ca18e2360f4ac-7c7db34d162so76838539f.2 for ; Tue, 27 Feb 2024 13:57:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20230601.gappssmtp.com; s=20230601; t=1709071045; x=1709675845; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=icJ2AEAYXxXy9sAaUjPsd9UtqfK6peXDHMxdOF7NsYY=; b=YRn1voiYA6BQb4z4SKOWR1Y8qSPHAZ9Q8O6ggazkiphT6xk0nsYj5sUDgmmskq+Bly Tevr4K34bxuNLjnXpFhc4KR1wA80sK4z2DllPl/9uGg0sgPTqXgFV82b/LANTvAsvCLM Tnyy9hLRFCFavTD9AGYgsZ5OSyfVJS+r70iZd8j+kKZ5566j9UFHVAiYtlKUyf0x997E aolyUnWgMAr9rpGcJd0brXilmCHhUWA3uS9oHuI8OaJ3+fgc6lEk5iIIRGRstLn26AzH W4wFiWUHSdnsUUQ4Dq0zfq7pNBPBnj1uy9jFZLCZxonbDhkYQ57aFtuvUmoVC8OJVXwf 7tZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709071045; x=1709675845; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=icJ2AEAYXxXy9sAaUjPsd9UtqfK6peXDHMxdOF7NsYY=; b=g8t2FLWWMwUfAReF9JTaeCB46zC3fTAheqWUSUnbU1/xwfbNNzwyjSY8NXdy6VU3yz 8hKm+/Xp24/5Jhq/WYkKuIkzl/mPljkb10YBMiGYUqz6U2flJlkjzr49KzIa+oiWnS9i 93ZBfz0iDzKhoMrqTS4lsm9SD9JEsYzolIo1mxEKLzE5TWqlZEyeF1xqZyXPAv8ACNDn +idugiZ+M0koyzGn2ld0aqoWXdLZYwRXznTp9iiEiujvEq1WHmP1lLh0CkyjCS+VIS8z 1huBvGDsZbbll/gbdCaJlPB4xDmN8Bdow3h9fq7GaBjauKiKkdYLlzrZOexNXRip17nk 5FLg== X-Gm-Message-State: AOJu0YyliXS5yyyjgOuW0owbhnH8DcqM5CeLrjp/8lLJBHjpApNnWsDe snSmhhi+F/yTDTHAju0ngLprdvIamobC3rIAV9NA8hDpnIjW+ZKcecL8MBJiTuZUCeS36VJCo57 R8rc= X-Google-Smtp-Source: AGHT+IEFRTROumWDw6+2E9K09Of0z8zyGp2fUtJi+6PHNq/rhTbB2wZAKi7+xo1PGqiUO3LChblAPQ== X-Received: by 2002:a92:cd4a:0:b0:365:3d96:4b98 with SMTP id v10-20020a92cd4a000000b003653d964b98mr10190134ilq.2.1709071045661; Tue, 27 Feb 2024 13:57:25 -0800 (PST) Received: from hexa.router0800d9.com (dhcp-72-234-108-41.hawaiiantel.net. [72.234.108.41]) by smtp.gmail.com with ESMTPSA id n7-20020aa78a47000000b006e50bbf4e71sm4936428pfa.9.2024.02.27.13.57.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 13:57:25 -0800 (PST) From: Steve Sakoman To: openembedded-core@lists.openembedded.org Subject: [OE-core][kirkstone 09/16] oeqa/selftest/oelib/buildhistory: git default branch Date: Tue, 27 Feb 2024 11:56:56 -1000 Message-Id: <095598eb7c9aa64797c8a41255fa28b695398054.1709070850.git.steve@sakoman.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 27 Feb 2024 21:57:31 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/196308 From: Adrian Freihofer On hosts with git defaulting to main branch the following exception occures: File .../buildhistory.py", line 99, in test_compare_dict_blobs_default blob1 = self.repo.heads.master.commit.tree.blobs[0] ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/git/util.py", line 1114, in __getattr__ return list.__getattribute__(self, attr) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'IterableList' object has no attribute 'master' Support main and master branch for these test cases. Note: setting the default branch with --initial-branch requires git version 2.28 or later. Some of the still supported host distros do not provide this feature yet. Signed-off-by: Adrian Freihofer Signed-off-by: Richard Purdie Cherry-picked from master: 7df99843d8f31d8e0c2872ff625f4a5abf28f740 Signed-off-by: Adrian Freihofer Signed-off-by: Steve Sakoman --- .../oeqa/selftest/cases/oelib/buildhistory.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/oelib/buildhistory.py b/meta/lib/oeqa/selftest/cases/oelib/buildhistory.py index 33bd6df2f3..ae12aa0865 100644 --- a/meta/lib/oeqa/selftest/cases/oelib/buildhistory.py +++ b/meta/lib/oeqa/selftest/cases/oelib/buildhistory.py @@ -28,6 +28,16 @@ class TestBlobParsing(OESelftestTestCase): import shutil shutil.rmtree(self.repo_path) + @property + def heads_default(self): + """ + Support repos defaulting to master or to main branch + """ + try: + return self.repo.heads.main + except AttributeError: + return self.repo.heads.master + def commit_vars(self, to_add={}, to_remove = [], msg="A commit message"): if len(to_add) == 0 and len(to_remove) == 0: return @@ -65,10 +75,10 @@ class TestBlobParsing(OESelftestTestCase): changesmap = { "foo-2" : ("2", "8"), "bar" : ("","4"), "bar-2" : ("","5")} self.commit_vars(to_add = { "foo" : "1", "foo-2" : "2", "foo-3" : "3" }) - blob1 = self.repo.heads.master.commit.tree.blobs[0] + blob1 = self.heads_default.commit.tree.blobs[0] self.commit_vars(to_add = { "foo-2" : "8", "bar" : "4", "bar-2" : "5" }) - blob2 = self.repo.heads.master.commit.tree.blobs[0] + blob2 = self.heads_default.commit.tree.blobs[0] change_records = compare_dict_blobs(os.path.join(self.repo_path, self.test_file), blob1, blob2, False, False) @@ -84,10 +94,10 @@ class TestBlobParsing(OESelftestTestCase): defaultmap = { x : ("default", "1") for x in ["PKG", "PKGE", "PKGV", "PKGR"]} self.commit_vars(to_add = { "foo" : "1" }) - blob1 = self.repo.heads.master.commit.tree.blobs[0] + blob1 = self.heads_default.commit.tree.blobs[0] self.commit_vars(to_add = { "PKG" : "1", "PKGE" : "1", "PKGV" : "1", "PKGR" : "1" }) - blob2 = self.repo.heads.master.commit.tree.blobs[0] + blob2 = self.heads_default.commit.tree.blobs[0] change_records = compare_dict_blobs(os.path.join(self.repo_path, self.test_file), blob1, blob2, False, False) From patchwork Tue Feb 27 21:56:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 40178 X-Patchwork-Delegate: steve@sakoman.com 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 17430C54E4A for ; Tue, 27 Feb 2024 21:57:31 +0000 (UTC) Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) by mx.groups.io with SMTP id smtpd.web11.2009.1709071048149730167 for ; Tue, 27 Feb 2024 13:57:28 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20230601.gappssmtp.com header.s=20230601 header.b=MofLgYYe; spf=softfail (domain: sakoman.com, ip: 209.85.167.182, mailfrom: steve@sakoman.com) Received: by mail-oi1-f182.google.com with SMTP id 5614622812f47-3c19b79535aso2538960b6e.0 for ; Tue, 27 Feb 2024 13:57:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20230601.gappssmtp.com; s=20230601; t=1709071047; x=1709675847; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Sz9bHYvM3Dn3dS7kWQIq1olgrVUI5ZZJHfuGrRW9Acc=; b=MofLgYYev0VNJ+XflfxtfCkiKGpfd9ZgQd23pXQiBvQtXYU2P3P1XJG4UzAHfLs1F2 ZcZ+csE2ecOrdY+m/Jq1v/cs1QaNwP9bQtJvGx8c1rGN8OpHxA9LwFi/89i/gW/z3zjf WaAQjBbJWP04xiBZbXV8g4DzpSBGmxH9K2edTrCMlUD7N6ncT2yQu/losGxLWxwaZu1g /JBTREtrYlUL7WgBn3nkXKnciZ6zywHeq/MU5YHppBcVqwS01NmCLLjC1Kh/F8dJIb03 OPCh/s+Pa53FrU1knMh4wQXdzvtR10/a3aszQHvLqSVBuejoJl74Pwf8bl2oxjzEbpRv QXIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709071047; x=1709675847; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Sz9bHYvM3Dn3dS7kWQIq1olgrVUI5ZZJHfuGrRW9Acc=; b=Mfe3++HBYMx5SmSJm+mW7ZOZgNVxm0Z8Xphxvb8xr/pAhLWPXYJ8XVYIA1i2Vc7jKx /WlAMZ/30iLLc/0SniSeH8hjnh1L6wYAexsZ+YiMqB8D6+p8uQtMpzMfMoVXAMraQHkm uP4bpi3CJqjSkPU9pUvypl6l/Up6SfcuRcEU6gLkxLTqUWIONMk8YoOCP1DZDZYevqx4 8n+luFM6auPsPcM1eV6KC76ZeP1xZzWNx3klub0ZDzyvlFiczyc0cariufGKbHuePjNP TCPmSMnOeYsJepHWbcBM7O0eDnbozX1MahPZZWlZSsJTEsBEI6KVawy8q5jx84iaNzCF Y1IA== X-Gm-Message-State: AOJu0YzpUOe2fJ+1xaYNSf4CtU3JM48lGBciFfOoFqGj/5Z97RSugDL0 iM8t5Wam+Z2UbWeRqHnmKEK2uRyzw0BahoD8xeDXtGzVs9u9S9rQ3CL4uIYH0Av2xWwNzJMoFUz EwBg= X-Google-Smtp-Source: AGHT+IGXb67RD3q1Qw71eTJm7bcSYM2T+g5fR44Q7wNQFMe6NJmGav/X0Sv/AsSfiWPKaMb33Ed13Q== X-Received: by 2002:a05:6808:170e:b0:3c1:7875:1c78 with SMTP id bc14-20020a056808170e00b003c178751c78mr3704126oib.55.1709071047390; Tue, 27 Feb 2024 13:57:27 -0800 (PST) Received: from hexa.router0800d9.com (dhcp-72-234-108-41.hawaiiantel.net. [72.234.108.41]) by smtp.gmail.com with ESMTPSA id n7-20020aa78a47000000b006e50bbf4e71sm4936428pfa.9.2024.02.27.13.57.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 13:57:27 -0800 (PST) From: Steve Sakoman To: openembedded-core@lists.openembedded.org Subject: [OE-core][kirkstone 10/16] feature-microblaze-versions.inc: python 3.12 regex Date: Tue, 27 Feb 2024 11:56:57 -1000 Message-Id: <2331982cf4f4649f1ec271640f8f7d33fa6ea88d.1709070850.git.steve@sakoman.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 27 Feb 2024 21:57:31 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/196309 From: Adrian Freihofer Python 3 interprets string literals as Unicode strings, and therefore \s is treated as an escaped Unicode character which is not correct. Declaring the RegEx pattern as a raw string instead of unicode is required for Python 3. Signed-off-by: Adrian Freihofer feature-microblaze-versions.inc# Signed-off-by: Richard Purdie Cherry-picked from master: 662f52f1713c9f070550fc0c874eb62312218ea4 Signed-off-by: Adrian Freihofer Signed-off-by: Steve Sakoman --- .../machine/include/microblaze/feature-microblaze-versions.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/conf/machine/include/microblaze/feature-microblaze-versions.inc b/meta/conf/machine/include/microblaze/feature-microblaze-versions.inc index 5c37f49abb..658e87b8cd 100644 --- a/meta/conf/machine/include/microblaze/feature-microblaze-versions.inc +++ b/meta/conf/machine/include/microblaze/feature-microblaze-versions.inc @@ -16,7 +16,7 @@ def microblaze_current_version(d, gcc = False): # find the current version, and convert it to major/minor integers version = None for t in (d.getVar("TUNE_FEATURES") or "").split(): - m = re.search("^v(\d+)\.(\d+)", t) + m = re.search(r"^v(\d+)\.(\d+)", t) if m: version = int(m.group(1)), int(m.group(2)) break From patchwork Tue Feb 27 21:56:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 40182 X-Patchwork-Delegate: steve@sakoman.com 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 275C9C54798 for ; Tue, 27 Feb 2024 21:57:31 +0000 (UTC) Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by mx.groups.io with SMTP id smtpd.web10.1949.1709071049578101918 for ; Tue, 27 Feb 2024 13:57:29 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20230601.gappssmtp.com header.s=20230601 header.b=gmKRH8/D; spf=softfail (domain: sakoman.com, ip: 209.85.210.169, mailfrom: steve@sakoman.com) Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-6e53f76898fso1335209b3a.0 for ; Tue, 27 Feb 2024 13:57:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20230601.gappssmtp.com; s=20230601; t=1709071049; x=1709675849; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Dq/vKTy0XcgE/4qwCOSVj1eN2SiU2BbCc55D9MMx1mY=; b=gmKRH8/DGY2qiNLmPASo7nxjpYBZaoNtRNw85xWvwXUFe4BEXlBiNTpcbNecdwoZlI L0FlvQ1DTMEwu9x2uLn9fNsCsjsHHDSGi1k0lUd9WLfk2X6aLglGPUo+VvPX1QMC9NW6 t/YRznKpK5Yq4k0W1U72SCX0cD/BJ6O7Wdf2uDZ/xaMIo8YQ3Bon0REYFzMMbIdMl9E4 VDBCbsvFz20/piJB7BT13omzISt3d7PU8CBN4t/mR5hNRVswviprNangEpqAmdUJr6Mf fG8wnD5imoO+VofvsIH2QQalXNelz8k7bykhhOSQDPDJFmEdEIRpUXdTgn2//+MGuJ2h 6mUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709071049; x=1709675849; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Dq/vKTy0XcgE/4qwCOSVj1eN2SiU2BbCc55D9MMx1mY=; b=dLALpgiqcAs4v5yxw0BeiREcoe2kNKSErpndnjTLnjHwrYuAg7UYcRkYVAvROzxRIq cTctEz/5hl75xNFEWNfDbSwonBM8KQrATyzs+/+0s+XPxDmZWXfmr8eVcaBs8PqW5T/M Y9baaQAD+A8r9tpqtz5eYIfYKIoW+lwwevljin9iHCUpj9sv30Tb7kNIrcC5ZNxlvdbG IbrfVAfimr1LyIxHX/DiYE9WYk3sKAYLdhvBz3k2axdhM/9liDDZMdoEy/6YLX+Xl2rN tQchZ9Pi2dRoBkbdQyPxby6F1bU6eq2OyS/Xh3krGCTD4RjBOU3uFryXaVgwUnjteSpW JXZQ== X-Gm-Message-State: AOJu0YzMmhSEhkLYOpzZuq8AlZMulFQhRw0qHIffpulatbla9RK+vcgC U23bntLM1vTLYAqQs/T6LyOWiG7M1xPxGUPOVQf4QkM4AuVw88Ww24W48dcMElf3K8rw+4lVg8K O8/U= X-Google-Smtp-Source: AGHT+IEVS3kXoBgiUceN69On0/VR59EUoL4/ofBFtjaUWomjK7RePVxohuZMllM46JXGX91iyQHmVg== X-Received: by 2002:a05:6a00:198c:b0:6e5:30b8:d46b with SMTP id d12-20020a056a00198c00b006e530b8d46bmr8952523pfl.18.1709071048876; Tue, 27 Feb 2024 13:57:28 -0800 (PST) Received: from hexa.router0800d9.com (dhcp-72-234-108-41.hawaiiantel.net. [72.234.108.41]) by smtp.gmail.com with ESMTPSA id n7-20020aa78a47000000b006e50bbf4e71sm4936428pfa.9.2024.02.27.13.57.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 13:57:28 -0800 (PST) From: Steve Sakoman To: openembedded-core@lists.openembedded.org Subject: [OE-core][kirkstone 11/16] meta/lib/oeqa: python 3.12 regex Date: Tue, 27 Feb 2024 11:56:58 -1000 Message-Id: <939046c5e9ddd71b941c9e389fa4a4687bfcdec0.1709070850.git.steve@sakoman.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 27 Feb 2024 21:57:31 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/196310 From: Adrian Freihofer Python 3 interprets string literals as Unicode strings, and therefore \s is treated as an escaped Unicode character which is not correct. Declaring the RegEx pattern as a raw string instead of unicode is required for Python 3. Signed-off-by: Adrian Freihofer Signed-off-by: Richard Purdie Cherry-picked from master: 9002850f0c2e409d3bc629e36bb360b96326bb64 Signed-off-by: Adrian Freihofer Signed-off-by: Steve Sakoman --- meta/lib/oeqa/oetest.py | 2 +- meta/lib/oeqa/selftest/cases/bblayers.py | 2 +- meta/lib/oeqa/selftest/cases/fitimage.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py index 9c84466dd0..b53c611062 100644 --- a/meta/lib/oeqa/oetest.py +++ b/meta/lib/oeqa/oetest.py @@ -256,7 +256,7 @@ class TestContext(object): modules = [] for test in self.testslist: - if re.search("\w+\.\w+\.test_\S+", test): + if re.search(r"\w+\.\w+\.test_\S+", test): test = '.'.join(t.split('.')[:3]) module = pkgutil.get_loader(test) modules.append(module) diff --git a/meta/lib/oeqa/selftest/cases/bblayers.py b/meta/lib/oeqa/selftest/cases/bblayers.py index 7d74833f61..0b9f16eeae 100644 --- a/meta/lib/oeqa/selftest/cases/bblayers.py +++ b/meta/lib/oeqa/selftest/cases/bblayers.py @@ -46,7 +46,7 @@ class BitbakeLayers(OESelftestTestCase): bb_file = os.path.join(testoutdir, recipe_path, recipe_file) self.assertTrue(os.path.isfile(bb_file), msg = "Cannot find xcursor-transparent-theme_0.1.1.bb in the test_bitbakelayers_flatten local dir.") contents = ftools.read_file(bb_file) - find_in_contents = re.search("##### bbappended from meta-selftest #####\n(.*\n)*include test_recipe.inc", contents) + find_in_contents = re.search(r"##### bbappended from meta-selftest #####\n(.*\n)*include test_recipe.inc", contents) self.assertTrue(find_in_contents, msg = "Flattening layers did not work. bitbake-layers flatten output: %s" % result.output) def test_bitbakelayers_add_remove(self): diff --git a/meta/lib/oeqa/selftest/cases/fitimage.py b/meta/lib/oeqa/selftest/cases/fitimage.py index d732a9020d..4d820faf92 100644 --- a/meta/lib/oeqa/selftest/cases/fitimage.py +++ b/meta/lib/oeqa/selftest/cases/fitimage.py @@ -202,7 +202,7 @@ UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart comment'" signed_sections = {} for line in result.output.splitlines(): if line.startswith((' Configuration', ' Image')): - in_signed = re.search('\((.*)\)', line).groups()[0] + in_signed = re.search(r'\((.*)\)', line).groups()[0] elif re.match('^ *', line) in (' ', ''): in_signed = None elif in_signed: @@ -521,7 +521,7 @@ UBOOT_FIT_HASH_ALG = "sha256" signed_sections = {} for line in result.output.splitlines(): if line.startswith((' Image')): - in_signed = re.search('\((.*)\)', line).groups()[0] + in_signed = re.search(r'\((.*)\)', line).groups()[0] elif re.match(' \w', line): in_signed = None elif in_signed: @@ -675,7 +675,7 @@ FIT_SIGN_INDIVIDUAL = "1" signed_sections = {} for line in result.output.splitlines(): if line.startswith((' Image')): - in_signed = re.search('\((.*)\)', line).groups()[0] + in_signed = re.search(r'\((.*)\)', line).groups()[0] elif re.match(' \w', line): in_signed = None elif in_signed: From patchwork Tue Feb 27 21:56:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 40184 X-Patchwork-Delegate: steve@sakoman.com 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 2B904C54798 for ; Tue, 27 Feb 2024 21:57:41 +0000 (UTC) Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by mx.groups.io with SMTP id smtpd.web11.2013.1709071051206413934 for ; Tue, 27 Feb 2024 13:57:31 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20230601.gappssmtp.com header.s=20230601 header.b=eBbPsNYN; spf=softfail (domain: sakoman.com, ip: 209.85.210.173, mailfrom: steve@sakoman.com) Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-6e55bb75c9eso242953b3a.3 for ; Tue, 27 Feb 2024 13:57:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20230601.gappssmtp.com; s=20230601; t=1709071050; x=1709675850; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=0Uvj4fvUOyJ5qd6Y8zr1jD6ISCOpmrX4bNoXrZ6TmRU=; b=eBbPsNYN4RMDr6P3FYU4lR4X747ROUsQRYl4Z18ojb20oURCs/c4wvO8ImUJarM2Da yjS1nugb8kighhrjo/o2yugs8djMB5MW7W6Xsqu+KA5Mwwl8DGVyUN2tA/OqKN55f7B6 UWfERGCQEEOZUb3HZDaCjBDs+sdQAj8M/45PlQM6Vwkm3rnN9M1sKGmOUT9VSJlKuAxM Ife3EQ9c5gpSEKHJJU123cx5ZgewwvSAd8XG0lJ0burfgl6weRYvCBwhTL1JBE2QH+Al WKWC8n5Mvxb/srb77dEmgxMxyuz+/mVRkiF9C+7wEu7/JDVkMlb241HMyTtdl36/B+Ye sHIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709071050; x=1709675850; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0Uvj4fvUOyJ5qd6Y8zr1jD6ISCOpmrX4bNoXrZ6TmRU=; b=o/lvdI6Ix/OHawo7pxvpIHLsvWSfR6qa1ca7xuBKVYB/nEEly036LFsl+xqLg3MEnh k753tVDHusqqk3nDF1/nEvcRM0YmmHxKpvLUMuqziNQb26lgbLaIbqa+2teQqQPuuZCA igZo+Wlm+jWxw7A/7S05lYa0+bo0aPwoKHf3WnNMWg1PccT75mWT2lvg+QtyqcF4OxN+ C/6Cg2IvBGhPLPuGfBN249Muok44lfz29sRoVoAPKpsZuI0ldsf+7bSfcW1exBi+TcKh DCUL4SzcowpjjHSfPoPdY2NJJuWqQqxj3Haa+kruLd6YSl3rEr3LoB5wIFeaQmYyFaHd BosQ== X-Gm-Message-State: AOJu0YyCnWeAXaQzyzgdLnEL2MUUMtcSdR/dqXzicmo0EJ5t5EStAq1J DutFnzHiPiguJD3S52cHUL8YNvkG66BDU8a7liqlvbDdlIoN/S5n8EmVfsESfgAE+/ib2MWkoQ+ ZeIU= X-Google-Smtp-Source: AGHT+IFAYCIlUGVGGSOc8jUsrK3+P5lHRQA0g1sNWkB5vd0BTqM4HJFdz7bI+4ZcD2NDLVdj6IPg8w== X-Received: by 2002:a05:6a00:87:b0:6e4:e7c3:f148 with SMTP id c7-20020a056a00008700b006e4e7c3f148mr10418060pfj.4.1709071050469; Tue, 27 Feb 2024 13:57:30 -0800 (PST) Received: from hexa.router0800d9.com (dhcp-72-234-108-41.hawaiiantel.net. [72.234.108.41]) by smtp.gmail.com with ESMTPSA id n7-20020aa78a47000000b006e50bbf4e71sm4936428pfa.9.2024.02.27.13.57.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 13:57:30 -0800 (PST) From: Steve Sakoman To: openembedded-core@lists.openembedded.org Subject: [OE-core][kirkstone 12/16] meta/recipes: python 3.12 regex Date: Tue, 27 Feb 2024 11:56:59 -1000 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 27 Feb 2024 21:57:41 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/196311 From: Adrian Freihofer Python 3 interprets string literals as Unicode strings, and therefore \s is treated as an escaped Unicode character which is not correct. Declaring the RegEx pattern as a raw string instead of unicode is required for Python 3. Signed-off-by: Adrian Freihofer Signed-off-by: Richard Purdie Cherry-picked from master: f2d80817baea298b953d6e14daad65087b3b50c9 Signed-off-by: Adrian Freihofer Signed-off-by: Steve Sakoman --- meta/recipes-kernel/perf/perf/sort-pmuevents.py | 8 ++++---- meta/recipes-rt/rt-tests/files/rt_bmark.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/meta/recipes-kernel/perf/perf/sort-pmuevents.py b/meta/recipes-kernel/perf/perf/sort-pmuevents.py index 0362f2d8fa..0a87e553ab 100755 --- a/meta/recipes-kernel/perf/perf/sort-pmuevents.py +++ b/meta/recipes-kernel/perf/perf/sort-pmuevents.py @@ -36,10 +36,10 @@ with open(infile, 'r') as file: preamble_regex = re.compile( '^(.*?)^(struct|const struct|static struct|static const struct)', re.MULTILINE | re.DOTALL ) preamble = re.search( preamble_regex, data ) -struct_block_regex = re.compile( '^(struct|const struct|static struct|static const struct).*?(\w+) (.*?)\[\] = {(.*?)^};', re.MULTILINE | re.DOTALL ) -field_regex = re.compile( '{.*?},', re.MULTILINE | re.DOTALL ) -cpuid_regex = re.compile( '\.cpuid = (.*?),', re.MULTILINE | re.DOTALL ) -name_regex = re.compile( '\.name = (.*?),', re.MULTILINE | re.DOTALL ) +struct_block_regex = re.compile(r'^(struct|const struct|static struct|static const struct).*?(\w+) (.*?)\[\] = {(.*?)^};', re.MULTILINE | re.DOTALL ) +field_regex = re.compile(r'{.*?},', re.MULTILINE | re.DOTALL ) +cpuid_regex = re.compile(r'\.cpuid = (.*?),', re.MULTILINE | re.DOTALL ) +name_regex = re.compile(r'\.name = (.*?),', re.MULTILINE | re.DOTALL ) # create a dictionary structure to store all the structs, their # types and then their fields. diff --git a/meta/recipes-rt/rt-tests/files/rt_bmark.py b/meta/recipes-rt/rt-tests/files/rt_bmark.py index 3b84447a0f..2a4eed412f 100755 --- a/meta/recipes-rt/rt-tests/files/rt_bmark.py +++ b/meta/recipes-rt/rt-tests/files/rt_bmark.py @@ -265,7 +265,7 @@ cmd = ("cyclictest", "-d", str(interval_delta), "-l", str(loop_count) ) -rex = re.compile(b"C:\s*(\d+).*Min:\s*(\d+).*Avg:\s*(\d+).*Max:\s*(\d+)") +rex = re.compile(r"C:\s*(\d+).*Min:\s*(\d+).*Avg:\s*(\d+).*Max:\s*(\d+)") def run_cyclictest_once(): res = subprocess.check_output(cmd) From patchwork Tue Feb 27 21:57:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 40187 X-Patchwork-Delegate: steve@sakoman.com 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 55C57C54E4A for ; Tue, 27 Feb 2024 21:57:41 +0000 (UTC) Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by mx.groups.io with SMTP id smtpd.web10.1952.1709071053962053807 for ; Tue, 27 Feb 2024 13:57:34 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20230601.gappssmtp.com header.s=20230601 header.b=KtgfAXZF; spf=softfail (domain: sakoman.com, ip: 209.85.214.172, mailfrom: steve@sakoman.com) Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1dc3b4b9b62so2226505ad.1 for ; Tue, 27 Feb 2024 13:57:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20230601.gappssmtp.com; s=20230601; t=1709071053; x=1709675853; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=nykGdgrn9qTW67RSkmWPj4K8iUmqBlNwP/a0tOu471o=; b=KtgfAXZFMI+6PjyCD4z705jkPDL862NUMzA8+e9z+JiUbpZvNCiyjGs7jaj4BiwGLp MoRmIKTuok+Z/XEpPUuK8aJcuJRcyqFJVf3VlsyiXu4ZxOrTq7hl4IsarA5JKBEtpyeF I27kdik5JxK2jkWKaXkDOpWBsUssRgwA2uHZe9wTPH+O3fMcbOYErx9BmzzGLkuEo+Ak xrF1NJ8eDgL9PJoz2+wbj2M81+BOF/GH82PoxZG0GsS67Uq6EyZyWsv0tHDEpzoqxrUJ NxER+vsQyBsjGI8Cjn48AOvcOW31ovQMexCNjWJ4HNR21ulEHRP2++CcZLSLyOlZ6AA3 YEpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709071053; x=1709675853; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nykGdgrn9qTW67RSkmWPj4K8iUmqBlNwP/a0tOu471o=; b=wJOL0R0yK+Vsvz48y5ESuwx6ur3l4nofl1zRpnaHficfE0x36/+PCmS5TGwo51GzF9 HgpLpF4hpEDVG/8voMO05emEPqPPFaZwFwTQPsC4pcZFRkkcddaRpMDQ2TL7lL8mclx+ 5k6xrvCzaIV+62t4/lseoVBmi/Q6CerDE5jvq2MNmszY/3Kyqiefye2FiO8mZAIokf/n LTvV7yOG51mBH6qph0AJ1Tzmd+DzcYjcfsuQvmzMvS+rZQ6DegKh/V+HoFuuCTnp6kBy QUzdJD2s9+ci0F6fmsZPrMY6OBWhmYmwZw7eahfa/NvROqtG6uOHQfuTvVMfa3Cw6biB TQMA== X-Gm-Message-State: AOJu0YwW/nCTNVt3s6eLHNPBjsnty1XQ1uUZIfGRfB09VxAiZyU2m13e 61D54xwriuuKMkQgZ1ADPzgqpIqXNmJ+rWR7/aXM9Cofdj2+/Jjk7xWlNe/hhgCtHlVihdcaJJC OUr0= X-Google-Smtp-Source: AGHT+IHyhchfnTJxik9tJU02YhXVRGevJse50DtJ3Re9nLvMFLsLXvdMbK19HN2j73GXrj4qxepy1w== X-Received: by 2002:a17:903:22c2:b0:1dc:737f:401e with SMTP id y2-20020a17090322c200b001dc737f401emr802516plg.18.1709071053114; Tue, 27 Feb 2024 13:57:33 -0800 (PST) Received: from hexa.router0800d9.com (dhcp-72-234-108-41.hawaiiantel.net. [72.234.108.41]) by smtp.gmail.com with ESMTPSA id n7-20020aa78a47000000b006e50bbf4e71sm4936428pfa.9.2024.02.27.13.57.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 13:57:32 -0800 (PST) From: Steve Sakoman To: openembedded-core@lists.openembedded.org Subject: [OE-core][kirkstone 13/16] scripts: python 3.12 regex Date: Tue, 27 Feb 2024 11:57:00 -1000 Message-Id: <63998f13d5263ce19a60ed3fba1ac8b6f23558e3.1709070850.git.steve@sakoman.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 27 Feb 2024 21:57:41 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/196312 From: Adrian Freihofer All the regexes throw a warning like this: WARNING: scripts/lib/recipetool/create_buildsys.py:140: SyntaxWarning: invalid escape sequence '\s' proj_re = re.compile('project\s*\(([^)]*)\)', re.IGNORECASE) Python 3 interprets string literals as Unicode strings, and therefore \s is treated as an escaped Unicode character which is not correct. Declaring the RegEx pattern as a raw string instead of unicode is required for Python 3. Signed-off-by: Adrian Freihofer Signed-off-by: Richard Purdie Backported from master: 24b0ba00d4f0b4d9834f7693ecb6032dfc534a80 Signed-off-by: Adrian Freihofer Signed-off-by: Steve Sakoman --- scripts/combo-layer | 2 +- scripts/contrib/bbvars.py | 6 ++-- scripts/contrib/convert-overrides.py | 8 ++--- scripts/lib/checklayer/__init__.py | 4 +-- scripts/lib/recipetool/create.py | 12 +++---- scripts/lib/recipetool/create_buildsys.py | 38 +++++++++++------------ scripts/oe-check-sstate | 2 +- scripts/oe-pkgdata-util | 2 +- scripts/opkg-query-helper.py | 2 +- 9 files changed, 38 insertions(+), 38 deletions(-) diff --git a/scripts/combo-layer b/scripts/combo-layer index 7f2020fca7..19ad32660d 100755 --- a/scripts/combo-layer +++ b/scripts/combo-layer @@ -483,7 +483,7 @@ def check_repo_clean(repodir): exit if repo is dirty """ output=runcmd("git status --porcelain", repodir) - r = re.compile('\?\? patch-.*/') + r = re.compile(r'\?\? patch-.*/') dirtyout = [item for item in output.splitlines() if not r.match(item)] if dirtyout: logger.error("git repo %s is dirty, please fix it first", repodir) diff --git a/scripts/contrib/bbvars.py b/scripts/contrib/bbvars.py index 090133600b..a9cdf082ab 100755 --- a/scripts/contrib/bbvars.py +++ b/scripts/contrib/bbvars.py @@ -36,8 +36,8 @@ def bbvar_is_documented(var, documented_vars): def collect_documented_vars(docfiles): ''' Walk the docfiles and collect the documented variables ''' documented_vars = [] - prog = re.compile(".*($|[^A-Z_])') + prog = re.compile(r".*($|[^A-Z_])') for d in docfiles: with open(d) as f: documented_vars += var_prog.findall(f.read()) @@ -45,7 +45,7 @@ def collect_documented_vars(docfiles): return documented_vars def bbvar_doctag(var, docconf): - prog = re.compile('^%s\[doc\] *= *"(.*)"' % (var)) + prog = re.compile(r'^%s\[doc\] *= *"(.*)"' % (var)) if docconf == "": return "?" diff --git a/scripts/contrib/convert-overrides.py b/scripts/contrib/convert-overrides.py index 1939757f1b..c69acb4095 100755 --- a/scripts/contrib/convert-overrides.py +++ b/scripts/contrib/convert-overrides.py @@ -81,19 +81,19 @@ skip_ext = [".html", ".patch", ".m4", ".diff"] + args.skip_ext vars_re = {} for exp in vars: - vars_re[exp] = (re.compile('((^|[#\'"\s\-\+])[A-Za-z0-9_\-:${}\.]+)_' + exp), r"\1:" + exp) + vars_re[exp] = (re.compile(r'((^|[#\'"\s\-\+])[A-Za-z0-9_\-:${}\.]+)_' + exp), r"\1:" + exp) shortvars_re = {} for exp in shortvars: - shortvars_re[exp] = (re.compile('((^|[#\'"\s\-\+])[A-Za-z0-9_\-:${}\.]+)_' + exp + '([\(\'"\s:])'), r"\1:" + exp + r"\3") + shortvars_re[exp] = (re.compile(r'((^|[#\'"\s\-\+])[A-Za-z0-9_\-:${}\.]+)_' + exp + r'([\(\'"\s:])'), r"\1:" + exp + r"\3") package_re = {} for exp in packagevars: - package_re[exp] = (re.compile('(^|[#\'"\s\-\+]+)' + exp + '_' + '([$a-z"\'\s%\[<{\\\*].)'), r"\1" + exp + r":\2") + package_re[exp] = (re.compile(r'(^|[#\'"\s\-\+]+)' + exp + r'_' + r'([$a-z"\'\s%\[<{\\\*].)'), r"\1" + exp + r":\2") # Other substitutions to make subs = { - 'r = re.compile("([^:]+):\s*(.*)")' : 'r = re.compile("(^.+?):\s+(.*)")', + 'r = re.compile(r"([^:]+):\s*(.*)")' : 'r = re.compile(r"(^.+?):\s+(.*)")', "val = d.getVar('%s_%s' % (var, pkg))" : "val = d.getVar('%s:%s' % (var, pkg))", "f.write('%s_%s: %s\\n' % (var, pkg, encode(val)))" : "f.write('%s:%s: %s\\n' % (var, pkg, encode(val)))", "d.getVar('%s_%s' % (scriptlet_name, pkg))" : "d.getVar('%s:%s' % (scriptlet_name, pkg))", diff --git a/scripts/lib/checklayer/__init__.py b/scripts/lib/checklayer/__init__.py index 938805289e..53f99dce1e 100644 --- a/scripts/lib/checklayer/__init__.py +++ b/scripts/lib/checklayer/__init__.py @@ -324,8 +324,8 @@ def get_signatures(builddir, failsafe=False, machine=None, extravars=None): else: raise - sig_regex = re.compile("^(?P.*:.*):(?P.*) .$") - tune_regex = re.compile("(^|\s)SIGGEN_LOCKEDSIGS_t-(?P\S*)\s*=\s*") + sig_regex = re.compile(r"^(?P.*:.*):(?P.*) .$") + tune_regex = re.compile(r"(^|\s)SIGGEN_LOCKEDSIGS_t-(?P\S*)\s*=\s*") current_tune = None with open(sigs_file, 'r') as f: for line in f.readlines(): diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py index 67894fb4d0..7b4c501456 100644 --- a/scripts/lib/recipetool/create.py +++ b/scripts/lib/recipetool/create.py @@ -1073,12 +1073,12 @@ def crunch_license(licfile): # Note: these are carefully constructed! license_title_re = re.compile(r'^#*\(? *(This is )?([Tt]he )?.{0,15} ?[Ll]icen[sc]e( \(.{1,10}\))?\)?[:\.]? ?#*$') license_statement_re = re.compile(r'^((This (project|software)|.{1,10}) is( free software)? (released|licen[sc]ed)|(Released|Licen[cs]ed)) under the .{1,10} [Ll]icen[sc]e:?$') - copyright_re = re.compile('^ *[#\*]* *(Modified work |MIT LICENSED )?Copyright ?(\([cC]\))? .*$') - disclaimer_re = re.compile('^ *\*? ?All [Rr]ights [Rr]eserved\.$') - email_re = re.compile('^.*<[\w\.-]*@[\w\.\-]*>$') - header_re = re.compile('^(\/\**!?)? ?[\-=\*]* ?(\*\/)?$') - tag_re = re.compile('^ *@?\(?([Ll]icense|MIT)\)?$') - url_re = re.compile('^ *[#\*]* *https?:\/\/[\w\.\/\-]+$') + copyright_re = re.compile(r'^ *[#\*]* *(Modified work |MIT LICENSED )?Copyright ?(\([cC]\))? .*$') + disclaimer_re = re.compile(r'^ *\*? ?All [Rr]ights [Rr]eserved\.$') + email_re = re.compile(r'^.*<[\w\.-]*@[\w\.\-]*>$') + header_re = re.compile(r'^(\/\**!?)? ?[\-=\*]* ?(\*\/)?$') + tag_re = re.compile(r'^ *@?\(?([Ll]icense|MIT)\)?$') + url_re = re.compile(r'^ *[#\*]* *https?:\/\/[\w\.\/\-]+$') crunched_md5sums = {} diff --git a/scripts/lib/recipetool/create_buildsys.py b/scripts/lib/recipetool/create_buildsys.py index 5015634476..bc4fb14a20 100644 --- a/scripts/lib/recipetool/create_buildsys.py +++ b/scripts/lib/recipetool/create_buildsys.py @@ -137,15 +137,15 @@ class CmakeRecipeHandler(RecipeHandler): deps = [] unmappedpkgs = [] - proj_re = re.compile('project\s*\(([^)]*)\)', re.IGNORECASE) - pkgcm_re = re.compile('pkg_check_modules\s*\(\s*[a-zA-Z0-9-_]+\s*(REQUIRED)?\s+([^)\s]+)\s*\)', re.IGNORECASE) - pkgsm_re = re.compile('pkg_search_module\s*\(\s*[a-zA-Z0-9-_]+\s*(REQUIRED)?((\s+[^)\s]+)+)\s*\)', re.IGNORECASE) - findpackage_re = re.compile('find_package\s*\(\s*([a-zA-Z0-9-_]+)\s*.*', re.IGNORECASE) - findlibrary_re = re.compile('find_library\s*\(\s*[a-zA-Z0-9-_]+\s*(NAMES\s+)?([a-zA-Z0-9-_ ]+)\s*.*') - checklib_re = re.compile('check_library_exists\s*\(\s*([^\s)]+)\s*.*', re.IGNORECASE) - include_re = re.compile('include\s*\(\s*([^)\s]*)\s*\)', re.IGNORECASE) - subdir_re = re.compile('add_subdirectory\s*\(\s*([^)\s]*)\s*([^)\s]*)\s*\)', re.IGNORECASE) - dep_re = re.compile('([^ ><=]+)( *[<>=]+ *[^ ><=]+)?') + proj_re = re.compile(r'project\s*\(([^)]*)\)', re.IGNORECASE) + pkgcm_re = re.compile(r'pkg_check_modules\s*\(\s*[a-zA-Z0-9-_]+\s*(REQUIRED)?\s+([^)\s]+)\s*\)', re.IGNORECASE) + pkgsm_re = re.compile(r'pkg_search_module\s*\(\s*[a-zA-Z0-9-_]+\s*(REQUIRED)?((\s+[^)\s]+)+)\s*\)', re.IGNORECASE) + findpackage_re = re.compile(r'find_package\s*\(\s*([a-zA-Z0-9-_]+)\s*.*', re.IGNORECASE) + findlibrary_re = re.compile(r'find_library\s*\(\s*[a-zA-Z0-9-_]+\s*(NAMES\s+)?([a-zA-Z0-9-_ ]+)\s*.*') + checklib_re = re.compile(r'check_library_exists\s*\(\s*([^\s)]+)\s*.*', re.IGNORECASE) + include_re = re.compile(r'include\s*\(\s*([^)\s]*)\s*\)', re.IGNORECASE) + subdir_re = re.compile(r'add_subdirectory\s*\(\s*([^)\s]*)\s*([^)\s]*)\s*\)', re.IGNORECASE) + dep_re = re.compile(r'([^ ><=]+)( *[<>=]+ *[^ ><=]+)?') def find_cmake_package(pkg): RecipeHandler.load_devel_filemap(tinfoil.config_data) @@ -423,16 +423,16 @@ class AutotoolsRecipeHandler(RecipeHandler): 'makeinfo': 'texinfo', } - pkg_re = re.compile('PKG_CHECK_MODULES\(\s*\[?[a-zA-Z0-9_]*\]?,\s*\[?([^,\]]*)\]?[),].*') - pkgce_re = re.compile('PKG_CHECK_EXISTS\(\s*\[?([^,\]]*)\]?[),].*') - lib_re = re.compile('AC_CHECK_LIB\(\s*\[?([^,\]]*)\]?,.*') - libx_re = re.compile('AX_CHECK_LIBRARY\(\s*\[?[^,\]]*\]?,\s*\[?([^,\]]*)\]?,\s*\[?([a-zA-Z0-9-]*)\]?,.*') - progs_re = re.compile('_PROGS?\(\s*\[?[a-zA-Z0-9_]*\]?,\s*\[?([^,\]]*)\]?[),].*') - dep_re = re.compile('([^ ><=]+)( [<>=]+ [^ ><=]+)?') - ac_init_re = re.compile('AC_INIT\(\s*([^,]+),\s*([^,]+)[,)].*') - am_init_re = re.compile('AM_INIT_AUTOMAKE\(\s*([^,]+),\s*([^,]+)[,)].*') - define_re = re.compile('\s*(m4_)?define\(\s*([^,]+),\s*([^,]+)\)') - version_re = re.compile('([0-9.]+)') + pkg_re = re.compile(r'PKG_CHECK_MODULES\(\s*\[?[a-zA-Z0-9_]*\]?,\s*\[?([^,\]]*)\]?[),].*') + pkgce_re = re.compile(r'PKG_CHECK_EXISTS\(\s*\[?([^,\]]*)\]?[),].*') + lib_re = re.compile(r'AC_CHECK_LIB\(\s*\[?([^,\]]*)\]?,.*') + libx_re = re.compile(r'AX_CHECK_LIBRARY\(\s*\[?[^,\]]*\]?,\s*\[?([^,\]]*)\]?,\s*\[?([a-zA-Z0-9-]*)\]?,.*') + progs_re = re.compile(r'_PROGS?\(\s*\[?[a-zA-Z0-9_]*\]?,\s*\[?([^,\]]*)\]?[),].*') + dep_re = re.compile(r'([^ ><=]+)( [<>=]+ [^ ><=]+)?') + ac_init_re = re.compile(r'AC_INIT\(\s*([^,]+),\s*([^,]+)[,)].*') + am_init_re = re.compile(r'AM_INIT_AUTOMAKE\(\s*([^,]+),\s*([^,]+)[,)].*') + define_re = re.compile(r'\s*(m4_)?define\(\s*([^,]+),\s*([^,]+)\)') + version_re = re.compile(r'([0-9.]+)') defines = {} def subst_defines(value): diff --git a/scripts/oe-check-sstate b/scripts/oe-check-sstate index 4187e77458..0d171c4463 100755 --- a/scripts/oe-check-sstate +++ b/scripts/oe-check-sstate @@ -53,7 +53,7 @@ def check(args): cmd = ['bitbake', '--dry-run', '--runall=build'] + args.target output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, env=env) - task_re = re.compile('NOTE: Running setscene task [0-9]+ of [0-9]+ \(([^)]+)\)') + task_re = re.compile(r'NOTE: Running setscene task [0-9]+ of [0-9]+ \(([^)]+)\)') tasks = [] for line in output.decode('utf-8').splitlines(): res = task_re.match(line) diff --git a/scripts/oe-pkgdata-util b/scripts/oe-pkgdata-util index 7412cc1f47..44ae40549a 100755 --- a/scripts/oe-pkgdata-util +++ b/scripts/oe-pkgdata-util @@ -296,7 +296,7 @@ def package_info(args): extra = '' for line in f: for var in vars: - m = re.match(var + '(?::\S+)?:\s*(.+?)\s*$', line) + m = re.match(var + r'(?::\S+)?:\s*(.+?)\s*$', line) if m: vals[var] = m.group(1) pkg_version = vals['PKGV'] or '' diff --git a/scripts/opkg-query-helper.py b/scripts/opkg-query-helper.py index bc3ab43823..084d9ef684 100755 --- a/scripts/opkg-query-helper.py +++ b/scripts/opkg-query-helper.py @@ -29,7 +29,7 @@ for arg in sys.argv[1:]: args.append(arg) # Regex for removing version specs after dependency items -verregex = re.compile(' \([=<>]* [^ )]*\)') +verregex = re.compile(r' \([=<>]* [^ )]*\)') pkg = "" ver = "" From patchwork Tue Feb 27 21:57:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 40186 X-Patchwork-Delegate: steve@sakoman.com 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 60E75C54E55 for ; Tue, 27 Feb 2024 21:57:41 +0000 (UTC) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by mx.groups.io with SMTP id smtpd.web10.1953.1709071055953878057 for ; Tue, 27 Feb 2024 13:57:36 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20230601.gappssmtp.com header.s=20230601 header.b=YEQpsMQj; spf=softfail (domain: sakoman.com, ip: 209.85.210.177, mailfrom: steve@sakoman.com) Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-6e508725b64so1295959b3a.3 for ; Tue, 27 Feb 2024 13:57:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20230601.gappssmtp.com; s=20230601; t=1709071055; x=1709675855; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=FNN12jvAcFfDMzoNGst+Y8uXL0RjDhvEmDBwVoP2XWo=; b=YEQpsMQjndcSbjY0Hv5k7TTe79gT7WKf+DuBcuZ7ym5oKHB9vR1nH0HuXpVs0zDKHP JgTPCvPzqUYDWPhchjwm9eWaD+qjjSjiA8cabyWlwiPmJe4FxpmU3h/MwY5UTAx3yLqf mpWD4kJccihCjq/AyAAuDSjoEj5WECsRzFiHKPrVTswpxHjD+f/Q+SKIdVNrhZc5VvdP Wr1CPpx3qn4t1uxRUFtoEZfWlNvhzRfpKctr5laaW4Erc3EYiMalRsMJnnB01p5q4VTQ G/RHYT6/tbuCjJ3gZiOVvo9HbJDLX4PDy33bIyvlBsV82iTKG+cxn7wKjCrxZrRgllq+ RYDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709071055; x=1709675855; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FNN12jvAcFfDMzoNGst+Y8uXL0RjDhvEmDBwVoP2XWo=; b=cZRcav8XesgBqHmcoL/5zBoIIYSaLLXA2zpKaG3a1KKXiYeuCOsoFdO1jZQm0aKoLI nwWMv2mmUCkeZGucYaBbgmq7HbNJ/Yw0pp3V2o26FffGFqvXcTEdjig0jfDOO73coW90 exRJHoeHvYTLCw6UECNg8TqVl5IvAID/z/ySqjeSZBeNQw5Hzj87Ow+sGBN4zlVlGzHw 3POIfJcVpBN69fqnYwboRvc03IStJahmtC+BYzutmg/4gDCgnLwZja8K4pbzVaYu8WD7 w/mmNGKgvPG137bySk69aOQSLc6kre6uZtEzT/ZUu2mR4upcRbpBQt67CgsyHrzY2/7n nggA== X-Gm-Message-State: AOJu0Yw1EQxL5NA6yMOFXxf9W5WKmN6fvVfHdl1x3A7JHLWlntKEnfnQ dHTamcfwYmbbbq4gJtKc6B5zun9yjY1E4QeQEfQ2ZhgfRLLX8dl3zkXGWeUJlcxPqDky1kF+fB2 NdUk= X-Google-Smtp-Source: AGHT+IGy4r41wnOD226M23U408JFSRyixV8GuiUjh7pyEKJwiXfRt79+MtfxBi64Eb2HQz6knyHRsA== X-Received: by 2002:a05:6a00:23d2:b0:6e4:f753:1e12 with SMTP id g18-20020a056a0023d200b006e4f7531e12mr11210787pfc.28.1709071055225; Tue, 27 Feb 2024 13:57:35 -0800 (PST) Received: from hexa.router0800d9.com (dhcp-72-234-108-41.hawaiiantel.net. [72.234.108.41]) by smtp.gmail.com with ESMTPSA id n7-20020aa78a47000000b006e50bbf4e71sm4936428pfa.9.2024.02.27.13.57.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 13:57:34 -0800 (PST) From: Steve Sakoman To: openembedded-core@lists.openembedded.org Subject: [OE-core][kirkstone 14/16] kernel.bbclass: introduce KERNEL_LOCALVERSION Date: Tue, 27 Feb 2024 11:57:01 -1000 Message-Id: <29a0d2a49df8e24f3948a2ddf03743f0cb5d09dd.1709070850.git.steve@sakoman.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 27 Feb 2024 21:57:41 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/196313 From: Ming Liu Just like UBOOT_LOCALVERSION, an end user can set KERNEL_LOCALVERSION to append a string to the name of the local version of the kernel image. Signed-off-by: Ming Liu Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie cherry-picked from master 229435a52f36ddec5f85fb6d5ccd42044b688397 Signed-off-by: Andreas Helbech Kleist Signed-off-by: Steve Sakoman --- meta/classes/kernel.bbclass | 6 +++++- meta/conf/documentation.conf | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 5951347361..80fb1879b0 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass @@ -614,6 +614,7 @@ do_shared_workdir () { # We don't need to stage anything, not the modules/firmware since those would clash with linux-firmware SYSROOT_DIRS = "" +KERNEL_LOCALVERSION ??= "" KERNEL_CONFIG_COMMAND ?= "oe_runmake_call -C ${S} O=${B} olddefconfig || oe_runmake -C ${S} O=${B} oldnoconfig" python check_oldest_kernel() { @@ -635,7 +636,10 @@ kernel_do_configure() { # $ scripts/setlocalversion . => + # $ make kernelversion => 2.6.37 # $ make kernelrelease => 2.6.37+ - touch ${B}/.scmversion ${S}/.scmversion + if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ]; then + echo ${KERNEL_LOCALVERSION} > ${B}/.scmversion + echo ${KERNEL_LOCALVERSION} > ${S}/.scmversion + fi if [ "${S}" != "${B}" ] && [ -f "${S}/.config" ] && [ ! -f "${B}/.config" ]; then mv "${S}/.config" "${B}/.config" diff --git a/meta/conf/documentation.conf b/meta/conf/documentation.conf index ab2addb321..e55bfa288d 100644 --- a/meta/conf/documentation.conf +++ b/meta/conf/documentation.conf @@ -253,6 +253,7 @@ KERNEL_MODULE_PROBECONF[doc] = "Lists kernel modules for which the build system KERNEL_PACKAGE_NAME[doc] = "Name prefix for kernel packages. Defaults to 'kernel'." KERNEL_PATH[doc] = "The location of the kernel sources. This variable is set to the value of the STAGING_KERNEL_DIR within the module class (module.bbclass)." KERNEL_SRC[doc] = "The location of the kernel sources. This variable is set to the value of the STAGING_KERNEL_DIR within the module class (module.bbclass)." +KERNEL_LOCALVERSION[doc] = "Appends a string to the name of the local version of the kernel image." KFEATURE_DESCRIPTION[doc] = "Provides a short description of a configuration fragment. You use this variable in the .scc file that describes a configuration fragment file." KMACHINE[doc] = "The machine as known by the kernel." KTYPE[doc] = "Defines the kernel type to be used in assembling the configuration." From patchwork Tue Feb 27 21:57:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 40183 X-Patchwork-Delegate: steve@sakoman.com 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 39546C5478C for ; Tue, 27 Feb 2024 21:57:41 +0000 (UTC) Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by mx.groups.io with SMTP id smtpd.web10.1955.1709071057878959428 for ; Tue, 27 Feb 2024 13:57:37 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20230601.gappssmtp.com header.s=20230601 header.b=xuAARsKr; spf=softfail (domain: sakoman.com, ip: 209.85.210.181, mailfrom: steve@sakoman.com) Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-6e332bc65b3so2668479b3a.3 for ; Tue, 27 Feb 2024 13:57:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20230601.gappssmtp.com; s=20230601; t=1709071057; x=1709675857; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=AzouUONTKufLkrRwrpl9g3fKktS+YH077e8814+wt0w=; b=xuAARsKrkh08SVbkEXq0ygY7Jh99WG4k3uO7QU+m+cXzOWgcAAJlkJc0gNX9qMP7e4 nOqSodZqw/8VGACSdeq7aSuGmMbZZH/ESvvTg8JpDox1co55+DQBwgwPk0eH6SETX4MG P6uxVNGTGBw4SRnMGzgdMbAc6X46QRSVC5STQtxZgAWXe1Ag9MGw8x+QZtrCwBjxUnxu 2sYMgze2e1hddZghFno8tbS0y6WzTDhEIeXgKQpr6N5DHHuvLevveHilJLU6WdLc8fQr BpKCNFAm2RG+z1n89CT6cnKUhMOjCItCMRYKAar2KdEQGxC6o9OiBjYFJgShm0dY6m+Q UvDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709071057; x=1709675857; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AzouUONTKufLkrRwrpl9g3fKktS+YH077e8814+wt0w=; b=WBUVJ1KuTfIM5qVXMCCbTx1E6JPCDBFUY1VyDwUjziCIQ8ehz+S/GTPUp2NhOam206 ATUy1Xncmnj+dB9+8Lv4zOX2bt5nUWERsyWvnMUh7MRxqy5G9FUecQ/HmPJZRl/JEndB /NMz7zihTpoKbxuMKcEHarzepUf3EalU/kfmWUet1KhiffSgHHwfodlY+TwdH0itT+Ch FZEhPw5igsAcLRgIaOd3vjF8EerEaZd6KgCF1tdoFHbX6/GjKk+PZB75z8ZD8rM7CFhD JhCrlEp3i9SmxEjy8mWwf+Vd1cV1K30FiDGko7Eu2T7MvcRhnUaamnUBXqGLLb58J0AE /RYA== X-Gm-Message-State: AOJu0YyTSxSIvJvNSJkQj9k9v8Y4JM3yqaaqPzX0/LRmOFTTyrLemW2a gtjcvWIwhtJT9FjUcY6Wdihr4oek9gC075T2T839UCKlp2wrYVKJiZ9Qxw3M1A4rDwz79kYJ+vO 0k/w= X-Google-Smtp-Source: AGHT+IEwQmpRf9IExYpilGWESBC4YppeDL3I7JGOjY154BvOYWf+soF1Lz4ewzC2awTqxNU3z7rfqw== X-Received: by 2002:aa7:9194:0:b0:6e2:de02:598e with SMTP id x20-20020aa79194000000b006e2de02598emr10037820pfa.33.1709071056977; Tue, 27 Feb 2024 13:57:36 -0800 (PST) Received: from hexa.router0800d9.com (dhcp-72-234-108-41.hawaiiantel.net. [72.234.108.41]) by smtp.gmail.com with ESMTPSA id n7-20020aa78a47000000b006e50bbf4e71sm4936428pfa.9.2024.02.27.13.57.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 13:57:36 -0800 (PST) From: Steve Sakoman To: openembedded-core@lists.openembedded.org Subject: [OE-core][kirkstone 15/16] kernel: fix localversion in v6.3+ Date: Tue, 27 Feb 2024 11:57:02 -1000 Message-Id: <74897e505db19a23a5b864a48a4fa97d657605c8.1709070850.git.steve@sakoman.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 27 Feb 2024 21:57:41 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/196314 From: Bruce Ashfield During testing of the v6.4 reference kernel, it was noticed that on-target modules no longer matched the magic value of the running kernel. This was due to a different localversion in the cross built kernel and the scripts / resources created on target. This was due to changes in the setlocalversion script introduced in the v6.3 series. The .scmversion file is no longer used (or packaged) to inhibit the addition of a "+" (through querying of the git status of the kernel) or the setting of a local version. We recently introduced the KERNEL_LOCALVERSION variable to allow recipes to place a value in .scmversion, so we extend the use of that variable to kernel-arch.bbclass and use it to set the exported variable LOCALVERSION. We must do it at the kernel-arch level, as the variable must be exported in any kernel build to ensure that setlocalversion always correctly sets the localversion. Signed-off-by: Bruce Ashfield Signed-off-by: Richard Purdie cherry-picked from master 765b13b7305c8d2f222cfc66d77c02e6a088c691 Signed-off-by: Andreas Helbech Kleist Signed-off-by: Steve Sakoman --- meta/classes/kernel-arch.bbclass | 7 +++++++ meta/classes/kernel.bbclass | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/meta/classes/kernel-arch.bbclass b/meta/classes/kernel-arch.bbclass index 4cd08b96fb..0a79dea0af 100644 --- a/meta/classes/kernel-arch.bbclass +++ b/meta/classes/kernel-arch.bbclass @@ -66,3 +66,10 @@ KERNEL_LD = "${CCACHE}${HOST_PREFIX}ld.bfd ${HOST_LD_KERNEL_ARCH}" KERNEL_AR = "${CCACHE}${HOST_PREFIX}ar ${HOST_AR_KERNEL_ARCH}" TOOLCHAIN ?= "gcc" +# 6.3+ requires the variable LOCALVERSION to be set to not get a "+" in +# the local version. Having it empty means nothing will be added, and any +# value will be appended to the local kernel version. This replaces the +# use of .scmversion file for setting a localversion without using +# the CONFIG_LOCALVERSION option. +KERNEL_LOCALVERSION ??= "" +export LOCALVERSION ?= "${KERNEL_LOCALVERSION}" diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 80fb1879b0..940f1a3cf4 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass @@ -418,7 +418,7 @@ do_compile_kernelmodules() { if (grep -q -i -e '^CONFIG_MODULES=y$' ${B}/.config); then oe_runmake -C ${B} ${PARALLEL_MAKE} modules ${KERNEL_EXTRA_ARGS} - # Module.symvers gets updated during the + # Module.symvers gets updated during the # building of the kernel modules. We need to # update this in the shared workdir since some # external kernel modules has a dependency on @@ -614,7 +614,6 @@ do_shared_workdir () { # We don't need to stage anything, not the modules/firmware since those would clash with linux-firmware SYSROOT_DIRS = "" -KERNEL_LOCALVERSION ??= "" KERNEL_CONFIG_COMMAND ?= "oe_runmake_call -C ${S} O=${B} olddefconfig || oe_runmake -C ${S} O=${B} oldnoconfig" python check_oldest_kernel() { @@ -636,6 +635,9 @@ kernel_do_configure() { # $ scripts/setlocalversion . => + # $ make kernelversion => 2.6.37 # $ make kernelrelease => 2.6.37+ + # See kernel-arch.bbclass for post v6.3 removal of the extra + # + in localversion. .scmversion is no longer used, and the + # variable LOCALVERSION must be used if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ]; then echo ${KERNEL_LOCALVERSION} > ${B}/.scmversion echo ${KERNEL_LOCALVERSION} > ${S}/.scmversion From patchwork Tue Feb 27 21:57:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 40185 X-Patchwork-Delegate: steve@sakoman.com 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 49E15C54E51 for ; Tue, 27 Feb 2024 21:57:41 +0000 (UTC) Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by mx.groups.io with SMTP id smtpd.web11.2018.1709071059355202192 for ; Tue, 27 Feb 2024 13:57:39 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20230601.gappssmtp.com header.s=20230601 header.b=imAKZsIr; spf=softfail (domain: sakoman.com, ip: 209.85.210.176, mailfrom: steve@sakoman.com) Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-6da202aa138so3279517b3a.2 for ; Tue, 27 Feb 2024 13:57:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20230601.gappssmtp.com; s=20230601; t=1709071059; x=1709675859; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=fEN34Aq4/RmjvB5BgI4SL3eS0vyDmOwBzDCzXRGjNng=; b=imAKZsIr1cHHx38/jt3GJLHjLhN46KNsPydpKGeaSU1aWDWwKjXVdc36duNloMddXE eNarsMqKnpzltTtRf7HSPevNGBAicBL/o+mr7x1KeVSQe9S4IV8bpWz++kRZpJl6hf1o WuLMISW1QW/rs/72r0nU3/bLrV4j8m2yrwHiQ+l29Gua477cvV4FqyMttnGbxO6Zw/KN 6TBvv7h/1Syc1mBVoohaTqEn9HbDecW845oynUFAwzFoBa/hkB9F0zsaVxRVgsXuqrCi YxZuhDqL2NUMMJmLg8tA4NMGuXIuULa/kLgu7gr1NdQdPdI0bM85KY8pz7Heb0q76slh I8QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709071059; x=1709675859; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fEN34Aq4/RmjvB5BgI4SL3eS0vyDmOwBzDCzXRGjNng=; b=XwrBa4c8unupuzXrCnnL69OjQ7DHg+Mmt3Dh4qZM+xHIOuarLv1RB/lPr3FP/gnjBS Jm4B8geUl9EDyhc0DyYTA6dl1svuu4KeYSeIruHJaGzgcZmEj2foaQMcOJI7fV6TC5Ib UQvWBaZg46HcvaxPLq1GZD9SIpBO4fkYN+BpktQoZq1789L1IrRZi6nqtnY6y8HVsG6e j1W+0PNG4jyo3JZV+kxyYZysGXzxvLvP8YOuJTmGlmmH5Osm3+2bPx+8R9Ny4zizhPkO c0JI6eFqmYllRasZpe3QWOk9VPRtIYRgw0StDvgxIm0Gz9Ztghuzva7BUUxkq5QepYJQ fADg== X-Gm-Message-State: AOJu0YwUSKzFCf5jtDbbsTCOfYL3RCGYbSsHUchwmwjKeIOa853TQSHb 4fZrE7PLMp2gK3tCGK2IeNvxoCFHKf56JAfoCzNMmksvahuemfTwqRuKQo1n9HN8TwnAF1cLnW5 6HiA= X-Google-Smtp-Source: AGHT+IHRcPC5yTL424JuN6fE6oN9dNdxAt7jMbQhZwKvkHWZdxQ1+5HCXY2GCpmsY5LUjLhdmPffsg== X-Received: by 2002:a05:6a00:9083:b0:6e5:3b95:de38 with SMTP id jo3-20020a056a00908300b006e53b95de38mr7594472pfb.12.1709071058575; Tue, 27 Feb 2024 13:57:38 -0800 (PST) Received: from hexa.router0800d9.com (dhcp-72-234-108-41.hawaiiantel.net. [72.234.108.41]) by smtp.gmail.com with ESMTPSA id n7-20020aa78a47000000b006e50bbf4e71sm4936428pfa.9.2024.02.27.13.57.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 13:57:38 -0800 (PST) From: Steve Sakoman To: openembedded-core@lists.openembedded.org Subject: [OE-core][kirkstone 16/16] kernel: make LOCALVERSION consistent between recipes Date: Tue, 27 Feb 2024 11:57:03 -1000 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 27 Feb 2024 21:57:41 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/196315 From: Bruce Ashfield The initial fix for localversion setting in 6.3+ broke older recipes and also broke recipes setting localversion in a kernel recipe, as make-mod-scripts (and other locations) can trigger a regeneration of files and don't have access to the variable. Moving the setting of this variable to the global namespace doesn't make sense, so we follow the example of the kernel-abiversion and save a kernel-localversion to the build artifacts. Recipes that may regenerate scripts/dynamic files, must depend on the do_shared_workedir of the kernel and use the helper function to read the file storing the localversion. Signed-off-by: Bruce Ashfield Signed-off-by: Alexandre Belloni cherry-picked from master b378eec156998eea55ba61e59103cb34fab0d07c Signed-off-by: Andreas Helbech Kleist Acked-by: Ryan Eatmon Signed-off-by: Steve Sakoman --- meta/classes/kernel-arch.bbclass | 8 -------- meta/classes/kernel.bbclass | 14 ++++++++++++++ meta/classes/kernelsrc.bbclass | 1 + meta/classes/linux-kernel-base.bbclass | 11 +++++++++++ meta/classes/module-base.bbclass | 1 + .../make-mod-scripts/make-mod-scripts_1.0.bb | 3 +++ 6 files changed, 30 insertions(+), 8 deletions(-) diff --git a/meta/classes/kernel-arch.bbclass b/meta/classes/kernel-arch.bbclass index 0a79dea0af..62c8211621 100644 --- a/meta/classes/kernel-arch.bbclass +++ b/meta/classes/kernel-arch.bbclass @@ -65,11 +65,3 @@ KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_KERNEL_ARCH} -fuse-ld=bfd ${DE KERNEL_LD = "${CCACHE}${HOST_PREFIX}ld.bfd ${HOST_LD_KERNEL_ARCH}" KERNEL_AR = "${CCACHE}${HOST_PREFIX}ar ${HOST_AR_KERNEL_ARCH}" TOOLCHAIN ?= "gcc" - -# 6.3+ requires the variable LOCALVERSION to be set to not get a "+" in -# the local version. Having it empty means nothing will be added, and any -# value will be appended to the local kernel version. This replaces the -# use of .scmversion file for setting a localversion without using -# the CONFIG_LOCALVERSION option. -KERNEL_LOCALVERSION ??= "" -export LOCALVERSION ?= "${KERNEL_LOCALVERSION}" diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 940f1a3cf4..96e41b5192 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass @@ -541,6 +541,7 @@ do_shared_workdir () { # echo "${KERNEL_VERSION}" > $kerneldir/${KERNEL_PACKAGE_NAME}-abiversion + echo "${KERNEL_LOCALVERSION}" > $kerneldir/${KERNEL_PACKAGE_NAME}-localversion # Copy files required for module builds cp System.map $kerneldir/System.map-${KERNEL_VERSION} @@ -630,6 +631,19 @@ python check_oldest_kernel() { check_oldest_kernel[vardepsexclude] += "OLDEST_KERNEL KERNEL_VERSION" do_configure[prefuncs] += "check_oldest_kernel" +KERNEL_LOCALVERSION ??= "" + +# 6.3+ requires the variable LOCALVERSION to be set to not get a "+" in +# the local version. Having it empty means nothing will be added, and any +# value will be appended to the local kernel version. This replaces the +# use of .scmversion file for setting a localversion without using +# the CONFIG_LOCALVERSION option. +# +# Note: This class saves the value of localversion to a file +# so other recipes like make-mod-scripts can restore it via the +# helper function get_kernellocalversion_file +export LOCALVERSION="${KERNEL_LOCALVERSION}" + kernel_do_configure() { # fixes extra + in /lib/modules/2.6.37+ # $ scripts/setlocalversion . => + diff --git a/meta/classes/kernelsrc.bbclass b/meta/classes/kernelsrc.bbclass index a951ba3325..a79bf18b09 100644 --- a/meta/classes/kernelsrc.bbclass +++ b/meta/classes/kernelsrc.bbclass @@ -5,6 +5,7 @@ do_patch[depends] += "virtual/kernel:do_shared_workdir" do_patch[noexec] = "1" do_package[depends] += "virtual/kernel:do_populate_sysroot" KERNEL_VERSION = "${@get_kernelversion_file("${STAGING_KERNEL_BUILDDIR}")}" +LOCAL_VERSION = "${@get_kernellocalversion_file("${STAGING_KERNEL_BUILDDIR}")}" inherit linux-kernel-base diff --git a/meta/classes/linux-kernel-base.bbclass b/meta/classes/linux-kernel-base.bbclass index 73a6fe36d9..0e2a4a4abe 100644 --- a/meta/classes/linux-kernel-base.bbclass +++ b/meta/classes/linux-kernel-base.bbclass @@ -33,6 +33,17 @@ def get_kernelversion_file(p): except IOError: return None +def get_kernellocalversion_file(p): + fn = p + '/kernel-localversion' + + try: + with open(fn, 'r') as f: + return f.readlines()[0].strip() + except IOError: + return "" + + return "" + def linux_module_packages(s, d): suffix = "" return " ".join(map(lambda s: "kernel-module-%s%s" % (s.lower().replace('_', '-').replace('@', '+'), suffix), s.split())) diff --git a/meta/classes/module-base.bbclass b/meta/classes/module-base.bbclass index 27bd69ff33..5b2fde8144 100644 --- a/meta/classes/module-base.bbclass +++ b/meta/classes/module-base.bbclass @@ -14,6 +14,7 @@ export CROSS_COMPILE = "${TARGET_PREFIX}" export KBUILD_OUTPUT = "${STAGING_KERNEL_BUILDDIR}" export KERNEL_VERSION = "${@oe.utils.read_file('${STAGING_KERNEL_BUILDDIR}/kernel-abiversion')}" +export LOCALVERSION = "${@oe.utils.read_file('${STAGING_KERNEL_BUILDDIR}/kernel-localversion')}" KERNEL_OBJECT_SUFFIX = ".ko" # kernel modules are generally machine specific diff --git a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb index f6f47cfff5..8727d003f9 100644 --- a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb +++ b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb @@ -21,6 +21,9 @@ DEPENDS += "gmp-native" EXTRA_OEMAKE = " HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}"" EXTRA_OEMAKE += " HOSTCXX="${BUILD_CXX} ${BUILD_CXXFLAGS} ${BUILD_LDFLAGS}" CROSS_COMPILE=${TARGET_PREFIX}" +KERNEL_LOCALVERSION = "${@get_kernellocalversion_file("${STAGING_KERNEL_BUILDDIR}")}" +export LOCALVERSION="${KERNEL_LOCALVERSION}" + # Build some host tools under work-shared. CC, LD, and AR are probably # not used, but this is the historical way of invoking "make scripts". #