From patchwork Fri Nov 8 15:23:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2008534 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ZJqsY+NY; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XlN5R42jkz1xyS for ; Sat, 9 Nov 2024 02:24:11 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7B6BA890CE; Fri, 8 Nov 2024 16:24:01 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ZJqsY+NY"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B46A4890D5; Fri, 8 Nov 2024 16:23:59 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8EC2C8904E for ; Fri, 8 Nov 2024 16:23:57 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd34.google.com with SMTP id ca18e2360f4ac-83ac05206c9so87738839f.3 for ; Fri, 08 Nov 2024 07:23:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1731079436; x=1731684236; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YJcig0K404Sqah6fdr9/ntO4m1BCi3SwrbsmFwcuwac=; b=ZJqsY+NYXdq+sCnTy88XwiU6W7pPRgIEfSnsZpzn/V5tR2cCyfawmrhqyYKsZLvU66 CqwQN9oqfDo8lH4mPDIIxmIqwe9/3X3vv1/oBVzwnhq8Db3HDqsUgPX6A9Wu8H6F6k6I YWIHsupegmEaIosvVJGeueGq1Hzach1Txt4CM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731079436; x=1731684236; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YJcig0K404Sqah6fdr9/ntO4m1BCi3SwrbsmFwcuwac=; b=ZaOnjbojNv+SjZxXSiuh7cbuGML0UpBI1Ug9ka4rFYw2LIYsETWRx0rJKnmc2uHRWS viCEH1fUmEpUzsEnPik6Dum+4DfaJq5Zv6xNCT96OipnUb6QznHQ5ZfLTL0EbCcVLtaU AlAphBuq+e8oIhgOMLAkfjm9gWKaON9ka0Cn9ERQEMclka5zS/m9d+c2siZoXxz4vcUB JxlgzZLWvdEbqC1m5s7sU75KUUfgudv0xv/ck7yGENZTDh/6ynp30EgZ/TIDNhFbD68H h2S5l83OB/wKLhU82tLEpuL2HTjJHovRXxgPPidW5dvI+6UMe7g49aSOnyz2yYgbYlku ZSVg== X-Gm-Message-State: AOJu0YxD6163Gmp+m3iROGB45rPU7ICOSTxotFZSnZcutGbumQ+y+wcE 1rXavYMXcrpn7QymJvXuPWHe07iRJy62zEGBnzEwOD0nCe2PD0X1MnEQwYSss0b7eiOh/WUiiOQ = X-Google-Smtp-Source: AGHT+IGg4x0L/9MoEJYHl/RZpKVIitQG0i2SBCsqbNChrKjROLaeh6AWWzBpAZWlRPae+zy51xYMag== X-Received: by 2002:a05:6602:6406:b0:83b:47:8d5 with SMTP id ca18e2360f4ac-83e0329122fmr317629639f.3.1731079435652; Fri, 08 Nov 2024 07:23:55 -0800 (PST) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4de5f7e3283sm864420173.6.2024.11.08.07.23.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2024 07:23:54 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Brandon Maier Subject: [PATCH 1/9] buildman: Add a lower-level test for KconfigScanner Date: Fri, 8 Nov 2024 08:23:42 -0700 Message-Id: <20241108152350.3686274-2-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241108152350.3686274-1-sjg@chromium.org> References: <20241108152350.3686274-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean This code is tested by test_scan_defconfigs() but it is useful to have some specific tests for the KconfigScanner's operation in U-Boot. Add a test which checks that the values are obtained correctly. Signed-off-by: Simon Glass --- tools/buildman/func_test.py | 51 +++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py index 0ac9fc7e44f..db3c9d63ec4 100644 --- a/tools/buildman/func_test.py +++ b/tools/buildman/func_test.py @@ -1067,3 +1067,54 @@ endif result = self._RunControl('--print-arch', 'board0') self.assertEqual('arm\n', stdout.getvalue()) self.assertEqual('', stderr.getvalue()) + + def test_kconfig_scanner(self): + """Test using the kconfig scanner to determine important values + + Note that there is already a test_scan_defconfigs() which checks the + higher-level scan_defconfigs() function. This test checks just the + scanner itself + """ + src = self._git_dir + scanner = boards.KconfigScanner(src) + + # First do a simple sanity check + norm = os.path.join(src, 'board0_defconfig') + tools.write_file(norm, 'CONFIG_TARGET_BOARD0=y', False) + res = scanner.scan(norm, True) + self.assertEqual(({ + 'arch': 'arm', + 'cpu': 'armv7', + 'soc': '-', + 'vendor': 'Tester', + 'board': 'ARM Board 0', + 'config': 'config0', + 'target': 'board0'}, []), res) + + # Check that the SoC cannot be changed and the filename does not affect + # the resulting board + tools.write_file(norm, '''CONFIG_TARGET_BOARD2=y +CONFIG_SOC="fred" +''', False) + res = scanner.scan(norm, True) + self.assertEqual(({ + 'arch': 'powerpc', + 'cpu': 'ppc', + 'soc': 'mpc85xx', + 'vendor': 'Tester', + 'board': 'PowerPC board 1', + 'config': 'config2', + 'target': 'board0'}, []), res) + + # Check handling of missing information + tools.write_file(norm, '', False) + res = scanner.scan(norm, True) + self.assertEqual(({ + 'arch': '-', + 'cpu': '-', + 'soc': '-', + 'vendor': '-', + 'board': '-', + 'config': '-', + 'target': 'board0'}, + ['WARNING: board0_defconfig: No TARGET_BOARD0 enabled']), res) From patchwork Fri Nov 8 15:23:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2008535 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=TXb9bWf9; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XlN5f43c5z1xyM for ; Sat, 9 Nov 2024 02:24:22 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2BC0D891E8; Fri, 8 Nov 2024 16:24:03 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="TXb9bWf9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A036F890FC; Fri, 8 Nov 2024 16:24:01 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 57E8B8909F for ; Fri, 8 Nov 2024 16:23:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd30.google.com with SMTP id ca18e2360f4ac-83abe4524ccso87299939f.1 for ; Fri, 08 Nov 2024 07:23:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1731079437; x=1731684237; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4d7BBxizEGLxn8KOLS/dcqFnR45+0OARlBIH6xLzQ4M=; b=TXb9bWf9XX+u03HBBuT2POiob74kfZz90ANbt5azzEWdX2Zm+RRfRkGnhyxeVK4ZrL YJQgwRgUZnxVXrm8WsFWcT+LgzdklfAAMH9IzTBxJHaivtEMEOGsFvK+nm29E2bvlKqE /g+EFkuJB9ZhViiVHv0n3C4B1cyoFrMjFAaTY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731079437; x=1731684237; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4d7BBxizEGLxn8KOLS/dcqFnR45+0OARlBIH6xLzQ4M=; b=A4iapCZqk43PGW+8UcU2ZKKfwgvIn/WemkrTNNqWp45I2rRE/t+AqqEc9ezqE9kui9 4YcnE0BjSwpILbYTpcayG9q7tvYlOx+vyHynpFw6zdRlluv7L45ESNvFd8W4iqrvhV1H ecDB6iIlz5E3qbRbCwiWa6Time84JPE990hurkzRpim5bmqZN3Nfba4AIbHwFLEMZE/Y NaEKAyN1UBE1QcOK3vkedlGlHCXpE6yNKXOQbMmM1dqF5vVLWXZNd2ewfKtp4q/Un7do jyjDe9OzKENgEAyFSoESjUVAqTpz9pxdoVF9wJuzAyzWgr3XtZz38SMcXZAZZhAQJGOz qxVw== X-Gm-Message-State: AOJu0YyW8GqfKy1jEAmxRXLLB5AeEe5k09kSb1mYZbtLTravBYpUh6HM cpgOjGeM94Wr3NMnZ28E0+KmHzw6aEkIBmaDP605x4O2nCaPe8pm+tjUGh55XmXHaNQ0OPviQiU = X-Google-Smtp-Source: AGHT+IFDyi3MYddCsXGu+J9C8F+yk6/UK5N0wJMMxwAeYRXvmCJFetif+h7bbw1EoXfrb192WxTYjA== X-Received: by 2002:a05:6602:148c:b0:83a:af81:f509 with SMTP id ca18e2360f4ac-83e032bab3fmr361158539f.4.1731079437455; Fri, 08 Nov 2024 07:23:57 -0800 (PST) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4de5f7e3283sm864420173.6.2024.11.08.07.23.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2024 07:23:56 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 2/9] buildman: Set up the tout library Date: Fri, 8 Nov 2024 08:23:43 -0700 Message-Id: <20241108152350.3686274-3-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241108152350.3686274-1-sjg@chromium.org> References: <20241108152350.3686274-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Use this to control info and debugging messages. Enable them if -v is given. Signed-off-by: Simon Glass --- tools/buildman/main.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/buildman/main.py b/tools/buildman/main.py index 3cf877e5e68..a948f36d9c0 100755 --- a/tools/buildman/main.py +++ b/tools/buildman/main.py @@ -25,6 +25,7 @@ from buildman import cmdline from buildman import control from u_boot_pylib import test_util from u_boot_pylib import tools +from u_boot_pylib import tout def run_tests(skip_net_tests, debug, verbose, args): """Run the buildman tests @@ -93,8 +94,12 @@ def run_buildman(): # Build selected commits for selected boards else: - bsettings.setup(args.config_file) - ret_code = control.do_buildman(args) + try: + tout.init(tout.INFO if args.verbose else tout.WARNING) + bsettings.setup(args.config_file) + ret_code = control.do_buildman(args) + finally: + tout.uninit() return ret_code From patchwork Fri Nov 8 15:23:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2008536 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=FuEobVuX; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XlN5q4y9mz1xyM for ; Sat, 9 Nov 2024 02:24:31 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8A6118922D; Fri, 8 Nov 2024 16:24:04 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="FuEobVuX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E6F7A8904E; Fri, 8 Nov 2024 16:24:03 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 565F288B1F for ; Fri, 8 Nov 2024 16:24:01 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2f.google.com with SMTP id ca18e2360f4ac-83aad8586d3so87896339f.1 for ; Fri, 08 Nov 2024 07:24:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1731079439; x=1731684239; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zEeNJbZDGa87fyaIERpCmjw7s+dAzEmcBw2rxxmhDIg=; b=FuEobVuXyhwUSaewlhIhOiGwUoza8SwYgf+LdxLFecOhfTlN0DTWnVVMIxdHdlt3Fn j9LyStzKNqpRJqxQyPigzaHxlzu29tZk8LYk6xAhPgudG7OOPwjQBANU2oOLZ1ZkkjhC g1cWnESGn7qosuxIZP6PPmyeswP0a6e48wVFE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731079439; x=1731684239; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zEeNJbZDGa87fyaIERpCmjw7s+dAzEmcBw2rxxmhDIg=; b=KGuTK/JvSeg7tiHdVhzSqkG+/tnEhw9PSKn5MjqcsHg1dtYQIZs+XWzuUJKGjbtNTd e0BG1uSsd+OD1xPxJdoaRO25/k2JGIwTtM5XskNiRfNeQbfegK5USlTT4HmWqLX0vQzM i89GZdfrNmjkOkMUZDK2MHMA5wHB5yQCCcctEqmvrgoN+NNsMp5cnTYRvwWMVyMe93X8 EA4zSkAQG2Xx7jaO67GQDnA7IaiMRuT2Xt/F6qyk6GHX4dIq0RNt6xRxhPpQO9HXG+Nx hXz+Ld1B9pr1b9hh7vrCen+bVL4k1Sqla1YuZD0vmRP36dNndh8tRTgVQRj6ZC4cZnGy PcCQ== X-Gm-Message-State: AOJu0YxoWIizYSp+2iByGf0iTIi2PBIaZbyneJAfQhQtzZ4a1IVw9P46 xCGEGkTDkP88W1cvzlfBCAAsYD9FGNoVcGS7wV3gNXSZSmzxW0n2+FIYV9LV/ChYNMfWG/myXng = X-Google-Smtp-Source: AGHT+IGh51ZmvtXFpJ03DisOJW1m2tBNN+B45pdVUtxvWGbUHdpl6rYGQ/DYumdJ5ZGYtzyMxufQBw== X-Received: by 2002:a05:6602:6402:b0:83a:a746:68a6 with SMTP id ca18e2360f4ac-83e032b3656mr366974239f.5.1731079439183; Fri, 08 Nov 2024 07:23:59 -0800 (PST) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4de5f7e3283sm864420173.6.2024.11.08.07.23.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2024 07:23:58 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Brandon Maier , Heinrich Schuchardt Subject: [PATCH 3/9] buildman: Support #include files in defconfigs Date: Fri, 8 Nov 2024 08:23:44 -0700 Message-Id: <20241108152350.3686274-4-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241108152350.3686274-1-sjg@chromium.org> References: <20241108152350.3686274-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean This is used by some boards in U-Boot and is a convenient way to deal with common settings where using a Kconfig files is not desirable. Detect #include files and process them as if they were part of the original file. Signed-off-by: Simon Glass Fixes: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/30 --- tools/buildman/boards.py | 25 ++++++++++++++++++++++++- tools/buildman/buildman.rst | 24 ++++++++++++++++++++++++ tools/buildman/func_test.py | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+), 1 deletion(-) diff --git a/tools/buildman/boards.py b/tools/buildman/boards.py index 3c2822715f3..9e7b486656b 100644 --- a/tools/buildman/boards.py +++ b/tools/buildman/boards.py @@ -19,7 +19,10 @@ import time from buildman import board from buildman import kconfiglib +from u_boot_pylib import command from u_boot_pylib.terminal import print_clear, tprint +from u_boot_pylib import tools +from u_boot_pylib import tout ### constant variables ### OUTPUT_FILE = 'boards.cfg' @@ -202,6 +205,7 @@ class KconfigScanner: os.environ['KCONFIG_OBJDIR'] = '' self._tmpfile = None self._conf = kconfiglib.Kconfig(warn=False) + self._srctree = srctree def __del__(self): """Delete a leftover temporary file before exit. @@ -239,7 +243,26 @@ class KconfigScanner: expect_target, match, rear = leaf.partition('_defconfig') assert match and not rear, f'{leaf} : invalid defconfig' - self._conf.load_config(defconfig) + temp = None + if b'#include' in tools.read_file(defconfig): + cmd = [ + os.getenv('CPP', 'cpp'), + '-nostdinc', '-P', + '-I', self._srctree, + '-undef', + '-x', 'assembler-with-cpp', + defconfig] + result = command.run_pipe([cmd], capture=True, capture_stderr=True) + temp = tempfile.NamedTemporaryFile(prefix='buildman-') + tools.write_file(temp.name, result.stdout, False) + fname = temp.name + tout.info(f'Processing #include to produce {defconfig}') + else: + fname = defconfig + + self._conf.load_config(fname) + if temp: + del temp self._tmpfile = None params = {} diff --git a/tools/buildman/buildman.rst b/tools/buildman/buildman.rst index e873611e596..8acf236f2b3 100644 --- a/tools/buildman/buildman.rst +++ b/tools/buildman/buildman.rst @@ -1112,6 +1112,30 @@ The -U option uses the u-boot.env files which are produced by a build. Internally, buildman writes out an out-env file into the build directory for later comparison. +defconfig fragments +------------------- + +Buildman provides some initial support for configuration fragments. It can scan +these when present in defconfig files and handle the resuiting Kconfig +correctly. Thus it is possible to build a board which has a ``#include`` in the +defconfig file. + +For now, Buildman simply includes the files to produce a single output file, +using the C preprocessor. It does not call the ``merge_config.sh`` script. The +redefined/redundant logic in that script could fairly easily be repeated in +Buildman, to detect potential problems. For now it is not clear that this is +useful. + +To specify the C preprocessor to use, set the ``CPP`` environment variable. The +default is ``cpp``. + +Note that Buildman does not support adding fragments to existing boards, e.g. +like:: + + make qemu_riscv64_defconfig acpi.config + +This is partly because there is no way for Buildman to know which fragments are +valid on which boards. Building with clang ------------------- diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py index db3c9d63ec4..4e12c671a3d 100644 --- a/tools/buildman/func_test.py +++ b/tools/buildman/func_test.py @@ -2,8 +2,10 @@ # Copyright (c) 2014 Google, Inc # +import io import os from pathlib import Path +import re import shutil import sys import tempfile @@ -373,6 +375,22 @@ class TestFunctional(unittest.TestCase): def _HandleCommandSize(self, args): return command.CommandResult(return_code=0) + def _HandleCommandCpp(self, args): + # args ['-nostdinc', '-P', '-I', '/tmp/tmp7f17xk_o/src', '-undef', + # '-x', 'assembler-with-cpp', fname] + fname = args[7] + buf = io.StringIO() + for line in tools.read_file(fname, False).splitlines(): + if line.startswith('#include'): + # Example: #include + m_incfname = re.match('#include <(.*)>', line) + data = tools.read_file(m_incfname.group(1), False) + for line in data.splitlines(): + print(line, file=buf) + else: + print(line, file=buf) + return command.CommandResult(stdout=buf.getvalue(), return_code=0) + def _HandleCommand(self, **kwargs): """Handle a command execution. @@ -406,6 +424,8 @@ class TestFunctional(unittest.TestCase): return self._HandleCommandObjcopy(args) elif cmd.endswith( 'size'): return self._HandleCommandSize(args) + elif cmd.endswith( 'cpp'): + return self._HandleCommandCpp(args) if not result: # Not handled, so abort @@ -1118,3 +1138,17 @@ CONFIG_SOC="fred" 'config': '-', 'target': 'board0'}, ['WARNING: board0_defconfig: No TARGET_BOARD0 enabled']), res) + + # check handling of #include files; see _HandleCommandCpp() + inc = os.path.join(src, 'common') + tools.write_file(inc, b'CONFIG_TARGET_BOARD0=y\n') + tools.write_file(norm, f'#include <{inc}>', False) + res = scanner.scan(norm, True) + self.assertEqual(({ + 'arch': 'arm', + 'cpu': 'armv7', + 'soc': '-', + 'vendor': 'Tester', + 'board': 'ARM Board 0', + 'config': 'config0', + 'target': 'board0'}, []), res) From patchwork Fri Nov 8 15:23:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2008537 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=hUfHepwb; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XlN611zTQz1xyM for ; Sat, 9 Nov 2024 02:24:41 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1EE5C890B9; Fri, 8 Nov 2024 16:24:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="hUfHepwb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1BA7588DF1; Fri, 8 Nov 2024 16:24:06 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 31E54891E9 for ; Fri, 8 Nov 2024 16:24:03 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2d.google.com with SMTP id ca18e2360f4ac-83ab5b4b048so84717039f.2 for ; Fri, 08 Nov 2024 07:24:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1731079441; x=1731684241; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mFxdZnMYbm1Ua/F7HlsWbcjLRimg5Mp7oi/AdNVGT4M=; b=hUfHepwboMmoIpchf3XdJFnCFCtNIDptuVtDzOu0Ssr+SkG9/gj1Ego4ahhGQxnq5E zlTxBAuhM/7Nvv6DSHu6O6q7/sPi2cSzRO2uI3sy6HCxQYh8c1snaybbs5OvzB2SLN2V aYJZr4cQKza/3192YA3l8qnS4qrj7NZlBT8XI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731079441; x=1731684241; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mFxdZnMYbm1Ua/F7HlsWbcjLRimg5Mp7oi/AdNVGT4M=; b=pDEOxuTLVmBO8fcNSI9q2jiQxm07pegBX1bPazNy2WkMYAguZVPGttR480ggHuxRK2 g/K8Pm70oaO3z5H0KLZOu+gFsgzM3FIF6G37mjcOWudf0KHtLNLmu23uGdpQLqfsRbtg 0Ki/zTeHN7vMNrSzXI4AtN7DZHklhc4/hHPplzOS0QJ/hsTw0UKIZwZOvrlaxwyIQgmj g2l/stWGRnDJ4jpvCU5yRrbP3JoPcWE/U5C5xNQMwY/XXc8wrehQ6nPhoa2JBsXHaHG/ To+RV3qjrEvlcbwVNn3n5ePXxYCcBhHo991xUi4AnlD49gKxtMkpm8TuYHfktPT1zK2y +T+g== X-Gm-Message-State: AOJu0YyqETKPsuZJ5wlsAl6eud/0txT0Kuwn9oXPE6Xbe9fV1cZL+Vf2 k6Q28LMDKOtiqWBwyhHZ4YwXmeQv211lz6R97+ahBOpUK64ageSlm4D+b8EicJp9PC0c2qDpMR8 = X-Google-Smtp-Source: AGHT+IEG+37wi5fpRLK2Of72+wdMS30g0711Y/jx7wXU/w9JRFqee8VPHoIbmWI5qx3nhbAr+SBHsQ== X-Received: by 2002:a05:6602:2c84:b0:837:7e21:1688 with SMTP id ca18e2360f4ac-83e033433d4mr335170539f.11.1731079440967; Fri, 08 Nov 2024 07:24:00 -0800 (PST) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4de5f7e3283sm864420173.6.2024.11.08.07.23.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2024 07:23:59 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 4/9] buildman: Correct the indentation in the setting-up section Date: Fri, 8 Nov 2024 08:23:45 -0700 Message-Id: <20241108152350.3686274-5-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241108152350.3686274-1-sjg@chromium.org> References: <20241108152350.3686274-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean The example settings file should be indented so that it shows correctly in the output. Fix it. Signed-off-by: Simon Glass --- tools/buildman/buildman.rst | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/tools/buildman/buildman.rst b/tools/buildman/buildman.rst index 8acf236f2b3..5eda01fd5e1 100644 --- a/tools/buildman/buildman.rst +++ b/tools/buildman/buildman.rst @@ -186,23 +186,22 @@ Setting up #. Create ~/.buildman to tell buildman where to find tool chains (see buildman_settings_ for details). As an example:: - # Buildman settings file + # Buildman settings file - [toolchain] - root: / - rest: /toolchains/* - eldk: /opt/eldk-4.2 - arm: /opt/linaro/gcc-linaro-arm-linux-gnueabihf-4.8-2013.08_linux - aarch64: /opt/linaro/gcc-linaro-aarch64-none-elf-4.8-2013.10_linux + [toolchain] + root: / + rest: /toolchains/* + eldk: /opt/eldk-4.2 + arm: /opt/linaro/gcc-linaro-arm-linux-gnueabihf-4.8-2013.08_linux + aarch64: /opt/linaro/gcc-linaro-aarch64-none-elf-4.8-2013.10_linux - [toolchain-prefix] - arc = /opt/arc/arc_gnu_2021.03_prebuilt_elf32_le_linux_install/bin/arc-elf32- - - [toolchain-alias] - riscv = riscv32 - sh = sh4 - x86: i386 + [toolchain-prefix] + arc = /opt/arc/arc_gnu_2021.03_prebuilt_elf32_le_linux_install/bin/arc-elf32- + [toolchain-alias] + riscv = riscv32 + sh = sh4 + x86: i386 This selects the available toolchain paths. Add the base directory for each of your toolchains here. Buildman will search inside these directories From patchwork Fri Nov 8 15:23:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2008538 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=fJIuhXEo; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XlN6K278Sz1xyM for ; Sat, 9 Nov 2024 02:24:57 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 56FFA8921A; Fri, 8 Nov 2024 16:24:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="fJIuhXEo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6B41E88DF1; Fri, 8 Nov 2024 16:24:07 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BA55289234 for ; Fri, 8 Nov 2024 16:24:04 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd32.google.com with SMTP id ca18e2360f4ac-83abf71f244so78517639f.1 for ; Fri, 08 Nov 2024 07:24:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1731079443; x=1731684243; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=baJgkOjM7jWVmh7ZPs6haPQCR7dBr99teF0s1K667VI=; b=fJIuhXEoeUDOwFrp3IwpvjmTZFsr3ISdFrup693xYL+YnijjAbhQQzC2U3piNFuw+L k1DSEZa2uckH42759XgpbYQC+3QFue/Au+M8gL7KHYx+FoWJWNnmqfT53r/HeLi9RBQV LP3CKS9sRU1P1hm094N+zUwPb1OpGz2dYsVbk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731079443; x=1731684243; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=baJgkOjM7jWVmh7ZPs6haPQCR7dBr99teF0s1K667VI=; b=qDp7Lh/QqkTH0lCx4oP5GwR5IhjyN4YjImw6+X6iy1XjFn56o6TQL8Te26n0RljQrs WCymhfEXoKl+337vxENascxzHmngVXKP1vjTh/HkhKab0iI1x1rmsbRLNmwnlsTlVA/8 DKyjYpLkXX3T71HwNnb+O5gwprR9HsuBCxeEetFMKGfLgQYiWtoRhQvmragCSUInQjaR xOapNRX4Zn/uYbZUS/32Du3D1ZkZvUfGnk0dfHQ3TKM/06WYbm9spdqAffJAkVGqjWsm iFbRBF7geFiH05VWV1frfnsnkGxPmnzk1O1D/tn7eKvWXbWwpUbhOyVDENDdS9UfgcBO YSfw== X-Gm-Message-State: AOJu0YxWu+xucSmjLATKXg4wFbGjBb9y/udpk2n+388I1CqJSni/VCFv 0yeQ5wDaILISI+ah0zco4xg/3mhU3ZI5N2Fqdp0eWE+avyyfQddND7OzIUEaWHZliSRBQVOrVT4 = X-Google-Smtp-Source: AGHT+IENMIjdgmxkBfKPsQOIlT8kKsc3XLhRmd+qI6pJ4PMSVtUjjd6Awci/BtfH92Qtr4MOgpnmNA== X-Received: by 2002:a05:6602:1481:b0:83b:470d:bcdf with SMTP id ca18e2360f4ac-83e03362140mr420112239f.13.1731079442884; Fri, 08 Nov 2024 07:24:02 -0800 (PST) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4de5f7e3283sm864420173.6.2024.11.08.07.24.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2024 07:24:01 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 5/9] buildman: Document the toolchain-prefix section Date: Fri, 8 Nov 2024 08:23:46 -0700 Message-Id: <20241108152350.3686274-6-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241108152350.3686274-1-sjg@chromium.org> References: <20241108152350.3686274-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean This is mentioned in examples but should have its own mention in the 'settings' documentation. Add it. Signed-off-by: Simon Glass --- tools/buildman/buildman.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/buildman/buildman.rst b/tools/buildman/buildman.rst index 5eda01fd5e1..73a13134a4d 100644 --- a/tools/buildman/buildman.rst +++ b/tools/buildman/buildman.rst @@ -933,6 +933,12 @@ a set of (tag, value) pairs. For example powerpc-linux-gcc will be noted as a toolchain for 'powerpc' and CROSS_COMPILE will be set to powerpc-linux- when using it. +'[toolchain-prefix]' section + This can be used to provide the full toolchain-prefix for one or more + architectures. The full CROSS_COMPILE prefix must be provided. These + typically have a higher priority than matches in the '[toolchain]', due to + this prefix. + '[toolchain-alias]' section This converts toolchain architecture names to U-Boot names. For example, if an x86 toolchains is called i386-linux-gcc it will not normally be From patchwork Fri Nov 8 15:23:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2008540 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=MUf14/Ec; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XlN6X0s94z1xyM for ; Sat, 9 Nov 2024 02:25:08 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A9CB489242; Fri, 8 Nov 2024 16:24:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="MUf14/Ec"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B14C8891E3; Fri, 8 Nov 2024 16:24:08 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9AABA88B1F for ; Fri, 8 Nov 2024 16:24:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd34.google.com with SMTP id ca18e2360f4ac-83a9be2c0e6so84867439f.2 for ; Fri, 08 Nov 2024 07:24:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1731079444; x=1731684244; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aAvNIhgOy0BkMGvGCO4KJbkM/7Ty9o0beYADpTaZC5c=; b=MUf14/Ec95fzI4lcSxeb4+rP3LRrjHQmbPAjzlJ83MLPLejDtfxGIEec0HJg8DjcI1 KSbUlQ1SrcpcaYyaFiiAmYiVXID6WvqtMpwzcG08RVeNjcvonfq8QACoOGwmvfGFSbry xOTuB58L25BDA7gah6bZrIgrSIbu/MCArQCUw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731079444; x=1731684244; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aAvNIhgOy0BkMGvGCO4KJbkM/7Ty9o0beYADpTaZC5c=; b=OaLs2hWkaeZmpMwrG5ozzRMDK0A53DNf5RIt2h+77r/bqGz9MzWcEKR6hyDO0/Rugm RSXRv0flvhaUBwXYsKxq0AXJaQUhrmNihgYdartdDClk4qw/JC524sIlFUu5afua9a8c dnqOyPrARjFdC+m2wvFiddwUqckijc8rI1IrL/7deZZPOvNVTShA3ZupuEgxVeb9SGPd H50skey9HHjZv6LAiZ9JaA+bzwN9ngd9fwFZyKX2I9Wy4+aVU6Os06Jr4L0hCyMzWrD5 G9gU3aSFZIC+lFlMlaUZZ+HEbX7GFIiY1TPN3N7sWPF0VNQY30JU7gedHrdj1Qr5wsnP Jt+Q== X-Gm-Message-State: AOJu0Yyk9IiJi0F/aD9FVz2QSd1At7aISWeAtbHJAcZNGrwSOg7rS8tS b1L2CQwasFM6y3SEBHgJa3uarmTwYv59XfubnYWBha7txy1yYheyxSfQaGbW5qmxEDr6250iqLs = X-Google-Smtp-Source: AGHT+IE7iuMabzCtFHaHeQ9WnnlpX8dRdXvUGTADoL6vJdmEkvgaBLXI6xtX0WIh4T+jvtAMXVJvXw== X-Received: by 2002:a05:6602:2d91:b0:82a:a76a:1779 with SMTP id ca18e2360f4ac-83e032e69f0mr395293739f.8.1731079444560; Fri, 08 Nov 2024 07:24:04 -0800 (PST) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4de5f7e3283sm864420173.6.2024.11.08.07.24.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2024 07:24:03 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Andrejs Cainikovs , Jerome Forissier Subject: [PATCH 6/9] buildman: Correct logic for adding a toolchain Date: Fri, 8 Nov 2024 08:23:47 -0700 Message-Id: <20241108152350.3686274-7-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241108152350.3686274-1-sjg@chromium.org> References: <20241108152350.3686274-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean If the toolchain is bad, it should not be added. Correct the logic for this. Signed-off-by: Simon Glass --- tools/buildman/toolchain.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py index 0c8a4fa16eb..dab350fec31 100644 --- a/tools/buildman/toolchain.py +++ b/tools/buildman/toolchain.py @@ -327,16 +327,17 @@ class Toolchains: toolchain = Toolchain(fname, test, verbose, priority, arch, self.override_toolchain) add_it = toolchain.ok - if toolchain.arch in self.toolchains: - add_it = (toolchain.priority < - self.toolchains[toolchain.arch].priority) if add_it: - self.toolchains[toolchain.arch] = toolchain - elif verbose: - print(("Toolchain '%s' at priority %d will be ignored because " - "another toolchain for arch '%s' has priority %d" % - (toolchain.gcc, toolchain.priority, toolchain.arch, - self.toolchains[toolchain.arch].priority))) + if toolchain.arch in self.toolchains: + add_it = (toolchain.priority < + self.toolchains[toolchain.arch].priority) + if add_it: + self.toolchains[toolchain.arch] = toolchain + elif verbose: + print(("Toolchain '%s' at priority %d will be ignored because " + "another toolchain for arch '%s' has priority %d" % + (toolchain.gcc, toolchain.priority, toolchain.arch, + self.toolchains[toolchain.arch].priority))) def ScanPath(self, path, verbose): """Scan a path for a valid toolchain From patchwork Fri Nov 8 15:23:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2008541 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=B0cf/+g7; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XlN6j1zkyz1xxq for ; Sat, 9 Nov 2024 02:25:17 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 087B289102; Fri, 8 Nov 2024 16:24:11 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="B0cf/+g7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 447C589251; Fri, 8 Nov 2024 16:24:10 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EC8AE88DF1 for ; Fri, 8 Nov 2024 16:24:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd33.google.com with SMTP id ca18e2360f4ac-83abcfb9f39so75192339f.1 for ; Fri, 08 Nov 2024 07:24:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1731079446; x=1731684246; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yvU4vNiBSIfgpbFXVL/C4OyDBi4H8giThtdtgQ7sy/o=; b=B0cf/+g7IxqwZzXcqkR6zXOyTt1u4kd4Sqk/KBL0MP/8U8SkxqzO/Y8JEXkQd3/9b8 Vf4yHsBa/YfoU9uDLfL395mTO70YsoOJlAWX/jQJBdcyA1N1TcDKQnWNuJDO0H1hVxO4 CBKxJ3BeHzlMj00c/KWdmBQjgS1c6htZRLqJY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731079446; x=1731684246; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yvU4vNiBSIfgpbFXVL/C4OyDBi4H8giThtdtgQ7sy/o=; b=i2tKkHXu7ptLe03XISlfJi7f+gIrfHP8xm1KHjOH/x0bpjmn5l+Gky3bgGmbOt9sO9 8/yB3cD9d6bglmbwj7CLGDhV7gH5Z3abCtnbVG2b3d6b3Qz5m+j5qsvs6jGjAV39z+Ia a9tRQtbZjqyJoM+HW0HxSJxnuu241QzMwmTKaMqrhflZ50zj/AIT0c5WbTF0OQqSvK8C seBN68ocL77cRHONn+D7tcvOTOEDOEtrVwo8vlKYJdXayW6g7FbtOJff1IQQGx3SVR7L /L1LiGqU3Sg0Qsi6xulRmFgA4r4Jf7ZrtfL7zT8uXd2nK8xIagU3cDRYT2OfnXffcsbL uE5g== X-Gm-Message-State: AOJu0YwH2mUGdzDATH5ajKo5+vpu8Ep4+baupPruFS9R3S6PTE3JuGli j7VVyKcienuA7jPd0YwrdQTN0hoGizZSHo/mDz7NO8zQbkdU1va7YDBO6LnUyUj7syRPVFtUIK8 = X-Google-Smtp-Source: AGHT+IG87lbkGL8+oTYgBG4lpv89cGaxb2CWVvnaz1O4THmHZvuRn1USVDDNB/PfhNWAITX9z0UMNA== X-Received: by 2002:a05:6602:4f54:b0:82c:ec0f:a081 with SMTP id ca18e2360f4ac-83e00ab9631mr319168939f.4.1731079446011; Fri, 08 Nov 2024 07:24:06 -0800 (PST) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4de5f7e3283sm864420173.6.2024.11.08.07.24.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2024 07:24:05 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Andrejs Cainikovs , Brandon Maier , Heinrich Schuchardt , Jerome Forissier Subject: [PATCH 7/9] buildman: Support a tilde to represent the home directory Date: Fri, 8 Nov 2024 08:23:48 -0700 Message-Id: <20241108152350.3686274-8-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241108152350.3686274-1-sjg@chromium.org> References: <20241108152350.3686274-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean It is convenient to use ~ to represent the home directory in the settings file. Add support for this. Signed-off-by: Simon Glass --- tools/buildman/buildman.rst | 6 +++++ tools/buildman/test.py | 50 +++++++++++++++++++++++++++++++++++++ tools/buildman/toolchain.py | 28 +++++++++++++-------- 3 files changed, 73 insertions(+), 11 deletions(-) diff --git a/tools/buildman/buildman.rst b/tools/buildman/buildman.rst index 73a13134a4d..924564b5700 100644 --- a/tools/buildman/buildman.rst +++ b/tools/buildman/buildman.rst @@ -933,12 +933,18 @@ a set of (tag, value) pairs. For example powerpc-linux-gcc will be noted as a toolchain for 'powerpc' and CROSS_COMPILE will be set to powerpc-linux- when using it. + The tilde character ``~`` is supported in paths, to represent the home + directory. + '[toolchain-prefix]' section This can be used to provide the full toolchain-prefix for one or more architectures. The full CROSS_COMPILE prefix must be provided. These typically have a higher priority than matches in the '[toolchain]', due to this prefix. + The tilde character ``~`` is supported in paths, to represent the home + directory. + '[toolchain-alias]' section This converts toolchain architecture names to U-Boot names. For example, if an x86 toolchains is called i386-linux-gcc it will not normally be diff --git a/tools/buildman/test.py b/tools/buildman/test.py index 15801f6097f..385a34e5254 100644 --- a/tools/buildman/test.py +++ b/tools/buildman/test.py @@ -46,6 +46,16 @@ main: /usr/sbin wrapper = ccache ''' +settings_data_homedir = ''' +# Buildman settings file + +[toolchain] +main = ~/mypath + +[toolchain-prefix] +x86 = ~/mypath-x86- +''' + migration = '''===================== WARNING ====================== This board does not use CONFIG_DM. CONFIG_DM will be compulsory starting with the v2020.01 release. @@ -1030,6 +1040,46 @@ class TestBuild(unittest.TestCase): finally: os.environ['PATH'] = old_path + def testHomedir(self): + """Test using ~ in a toolchain or toolchain-prefix section""" + # Add some test settings + bsettings.setup(None) + bsettings.add_file(settings_data_homedir) + + # Set up the toolchains + home = os.path.expanduser('~') + toolchains = toolchain.Toolchains() + toolchains.GetSettings() + self.assertEqual([f'{home}/mypath'], toolchains.paths) + + # Check scanning + with test_util.capture_sys_output() as (stdout, _): + toolchains.Scan(verbose=True, raise_on_error=False) + lines = iter(stdout.getvalue().splitlines() + ['##done']) + self.assertEqual('Scanning for tool chains', next(lines)) + self.assertEqual(f" - scanning prefix '{home}/mypath-x86-'", + next(lines)) + self.assertEqual( + f"Error: No tool chain found for prefix '{home}/mypath-x86-gcc'", + next(lines)) + self.assertEqual(f" - scanning path '{home}/mypath'", next(lines)) + self.assertEqual(f" - looking in '{home}/mypath/.'", next(lines)) + self.assertEqual(f" - looking in '{home}/mypath/bin'", next(lines)) + self.assertEqual(f" - looking in '{home}/mypath/usr/bin'", + next(lines)) + self.assertEqual('##done', next(lines)) + + # Check adding a toolchain + with test_util.capture_sys_output() as (stdout, _): + toolchains.Add('~/aarch64-linux-gcc', test=True, verbose=True) + lines = iter(stdout.getvalue().splitlines() + ['##done']) + self.assertEqual('Tool chain test: BAD', next(lines)) + self.assertEqual(f'Command: {home}/aarch64-linux-gcc --version', + next(lines)) + self.assertEqual('', next(lines)) + self.assertEqual('', next(lines)) + self.assertEqual('##done', next(lines)) + if __name__ == "__main__": unittest.main() diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py index dab350fec31..958f36f9f61 100644 --- a/tools/buildman/toolchain.py +++ b/tools/buildman/toolchain.py @@ -65,12 +65,13 @@ class Toolchain: """Create a new toolchain object. Args: - fname: Filename of the gcc component + fname: Filename of the gcc component, possibly with ~ or $HOME in it test: True to run the toolchain to test it verbose: True to print out the information priority: Priority to use for this toolchain, or PRIORITY_CALC to calculate it """ + fname = os.path.expanduser(fname) self.gcc = fname self.path = os.path.dirname(fname) self.override_toolchain = override_toolchain @@ -109,7 +110,7 @@ class Toolchain: self.priority)) else: print('BAD') - print('Command: ', cmd) + print(f"Command: {' '.join(cmd)}") print(result.stdout) print(result.stderr) else: @@ -296,10 +297,11 @@ class Toolchains: paths = [] for name, value in toolchains: + fname = os.path.expanduser(value) if '*' in value: - paths += glob.glob(value) + paths += glob.glob(fname) else: - paths.append(value) + paths.append(fname) return paths def GetSettings(self, show_warning=True): @@ -373,7 +375,7 @@ class Toolchains: pathname_list.append(pathname) return pathname_list - def Scan(self, verbose): + def Scan(self, verbose, raise_on_error=True): """Scan for available toolchains and select the best for each arch. We look for all the toolchains we can file, figure out the @@ -385,11 +387,12 @@ class Toolchains: """ if verbose: print('Scanning for tool chains') for name, value in self.prefixes: - if verbose: print(" - scanning prefix '%s'" % value) - if os.path.exists(value): - self.Add(value, True, verbose, PRIORITY_FULL_PREFIX, name) + fname = os.path.expanduser(value) + if verbose: print(" - scanning prefix '%s'" % fname) + if os.path.exists(fname): + self.Add(fname, True, verbose, PRIORITY_FULL_PREFIX, name) continue - fname = value + 'gcc' + fname += 'gcc' if os.path.exists(fname): self.Add(fname, True, verbose, PRIORITY_PREFIX_GCC, name) continue @@ -397,8 +400,11 @@ class Toolchains: for f in fname_list: self.Add(f, True, verbose, PRIORITY_PREFIX_GCC_PATH, name) if not fname_list: - raise ValueError("No tool chain found for prefix '%s'" % - value) + msg = f"No tool chain found for prefix '{fname}'" + if raise_on_error: + raise ValueError(msg) + else: + print(f'Error: {msg}') for path in self.paths: if verbose: print(" - scanning path '%s'" % path) fnames = self.ScanPath(path, verbose) From patchwork Fri Nov 8 15:23:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2008542 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Gf/56Qkt; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XlN6t6gfjz1xxq for ; Sat, 9 Nov 2024 02:25:26 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 61BB889287; Fri, 8 Nov 2024 16:24:13 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Gf/56Qkt"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1F26C8926A; Fri, 8 Nov 2024 16:24:12 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F409D8923D for ; Fri, 8 Nov 2024 16:24:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd30.google.com with SMTP id ca18e2360f4ac-83ab21c26f1so82743639f.2 for ; Fri, 08 Nov 2024 07:24:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1731079448; x=1731684248; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uwwrQMSsLncuz30s5NrxhDvJwySfk4Vx1Zo2WkZ6J5Y=; b=Gf/56QktMJif6LGlRC280AN71qBd+ScyzjhXvYGFBqpMAuKGIQ0vGGfOLrLVTX342Q 0dN7SEZA2j8IEgpws158fULZp7HNPgvVv6q8EvLV7WSzxmz9lO3Q11yGEfXofPpuDXWA MEUpcHKuhD+zyxlNZghce8cJ/6eLEARF2/p84= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731079448; x=1731684248; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uwwrQMSsLncuz30s5NrxhDvJwySfk4Vx1Zo2WkZ6J5Y=; b=gann9rrBzfIPJnd4MTj64BF1vZ8feJfA6SL9mnm/i+1ayR9qF3sQXZOHJErk3D5hR1 nwvmEgZIeBZ5wMDELGSzawQOGi8p0jvjWe0QoikettDHpyh4ukpk9oU3s6jrWalFqxo8 jDW4AcdvanFFIkRJSU/J0ZGSOOpIaV3AOfMIe05cGqiaieytzruYMMgRNSobabb/nPyp Hp5awTRgmAmTtWqBvOpjJ9H58sY1g57oGorluxD9g1MVon4gJzNn7CEjawHFCPcIdgZl XS5gmBH7h6gsgBb1jrtrdH6kuM9oLE71IHIE7f8N6ZyocxvDVtviSoro8dPc+4cnCkG0 QANw== X-Gm-Message-State: AOJu0YwYY51PtxVND8BT6LlefJq7teNunTI/WsOUi/IXO4QNB+tDMB1A bCRH+SSsYhXFgXUCit1wjEUy3nP6Vyci0hzVzMcPxbdW2RPdZ/LV+ZKX3dATy5JPPq4hmzdXSCU = X-Google-Smtp-Source: AGHT+IHfanO+YlOB7MsO8F2Ja3WfeYbCGCCsEYRWS/Gss627C5FZz11WO1eqoNE/3u21TV7J/Cy4xw== X-Received: by 2002:a05:6602:6b08:b0:83a:a25a:cfaf with SMTP id ca18e2360f4ac-83e032a16d9mr306577239f.3.1731079448059; Fri, 08 Nov 2024 07:24:08 -0800 (PST) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4de5f7e3283sm864420173.6.2024.11.08.07.24.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2024 07:24:07 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 8/9] buildman: Propose a format for extra boards Date: Fri, 8 Nov 2024 08:23:49 -0700 Message-Id: <20241108152350.3686274-9-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241108152350.3686274-1-sjg@chromium.org> References: <20241108152350.3686274-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean It has become more common to use config fragments to extend or adjust the functionality of boards in U-Boot. Propose a format for how to deal with this. It is not implemented as yet. Signed-off-by: Simon Glass --- tools/buildman/buildman.rst | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/tools/buildman/buildman.rst b/tools/buildman/buildman.rst index 924564b5700..48705d0e49e 100644 --- a/tools/buildman/buildman.rst +++ b/tools/buildman/buildman.rst @@ -1148,6 +1148,45 @@ like:: This is partly because there is no way for Buildman to know which fragments are valid on which boards. +Specifying the build matrix with fragments +------------------------------------------ + +In order to build boards which can use fragments, Buildman needs to know which +fragments are valid with which boards. The following scheme is proposed, but not +currently implemented. + +In ``defconfig/``, files with a '.buildman' suffix are used to effectively +create new boards for Buildman to build. All such files are processed, but it +might be best to put all the information in a single file for now, e.g. +``extended.buildman``. + +The syntax consists of a number of sections, each introduced by a name. For each +section the fragment file is named (without the implied ``.config`` suffix), +then the targets which can accept that fragment are specified, either by their +board name, with wildcards, or a set of ``CONFIG`` options to check. All +``CONFIG`` options must match for a board to be included in the set. To specify +multiple fragments to be included, add them in the order which they should be +applied, one per line. + +For example:: + + # Build RISC-V QEMU builds with ACPI + name: ACPI with supporting boards + fragment: acpi + targets: + qemu_riscv* + + # Build Android variant of 'k3' boards, with DFU + name USB DFU for am62x boards + fragment: am62x_r5_usbdfu + fragment: am62x_a53_android + targets: + CONFIG_SYS_SOC="k3" + +Buildman normally ignores these files. To request that Buildman process these +extended new 'boards', use the ``-X / --extend`` option. Note that this may +significantly increase the number of boards which Buildman builds. + Building with clang ------------------- From patchwork Fri Nov 8 15:23:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2008543 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=A+s7+IZo; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XlN7964fjz1xxq for ; Sat, 9 Nov 2024 02:25:40 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B89AB89234; Fri, 8 Nov 2024 16:24:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="A+s7+IZo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E067A892A4; Fri, 8 Nov 2024 16:24:13 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C97638925A for ; Fri, 8 Nov 2024 16:24:11 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd35.google.com with SMTP id ca18e2360f4ac-83abf71f244so78521639f.1 for ; Fri, 08 Nov 2024 07:24:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1731079450; x=1731684250; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xmk0xfEoYZWCbe8+sYaXOIVrthbpvM++URfwvKwsR9M=; b=A+s7+IZox9xP1mgzd09inWRf7BzuLaZKeyww81xgs3GDGBvIkd1VIk2QON264hcNhY vayve+0ROdrt/+Z5sI/RWRucor3vDCKj3o8eMPB9IFad+ziekGpn9cuEalxdEtxy3R+m SVWuQ0nakn9WBnqU7KDxQSjYvf2HfK6+04YbA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731079450; x=1731684250; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xmk0xfEoYZWCbe8+sYaXOIVrthbpvM++URfwvKwsR9M=; b=DGIsur1fqUVQTD+zttsvWHhvOKe+Q6SLTOV2JI0GZGq944uLaCVI/eTjUvdkpqT0v2 q5YCHAxxfLBnbkvwYCRYef4bRmmZKy632GTcqdUeQbLjpfTqGi1nyar9ct4NCUAn5M4k 3fJ/+XgOYMSOfPKKI0+TiIvV/fPLD7bjgUFndHr2357i17DOkvKWZc/RuKvngtXPxccF i94SHVrcnZp5HR56ZspgLzUjTwJU5SAg7bZ+ylhq/J8MX77RGBtSKvkd9MNsBqAC/kdv C9Q5HWI+QnhwBzs2jjEwuG4RZ2EtEPCpJ7fggIVxrHcze5BhFjINivLdHpVIVevp1hLZ rIpg== X-Gm-Message-State: AOJu0YzchtY81FlXDbBdAk6zlOWTnItwOCBm4F+XVxAFnlJgFPLTjTS5 JJUTY2p50hKDHcHL1yID7WX2OM6Zde7RsTZ/eS2VxC54zUSJsZbDDD/JplThinSJRU6MYLN12uA = X-Google-Smtp-Source: AGHT+IGFOVctW6d+MSzBreNFOsWSHKFzjsMeHLBxCO4igmYlVVg8ZZTive6Ll7WAJROYSmd3jzxDLw== X-Received: by 2002:a05:6602:160e:b0:832:40d0:902a with SMTP id ca18e2360f4ac-83e032a1a31mr316009239f.6.1731079449848; Fri, 08 Nov 2024 07:24:09 -0800 (PST) Received: from chromium.org (c-107-2-138-191.hsd1.co.comcast.net. [107.2.138.191]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4de5f7e3283sm864420173.6.2024.11.08.07.24.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2024 07:24:08 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Neha Malcom Francis , Sumit Garg Subject: [PATCH 9/9] RFC: Show building with #include in defconfig Date: Fri, 8 Nov 2024 08:23:50 -0700 Message-Id: <20241108152350.3686274-10-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241108152350.3686274-1-sjg@chromium.org> References: <20241108152350.3686274-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Do not apply. Update one board to drop the now-unnecessary settings. Signed-off-by: Simon Glass --- configs/j721e_sk_a72_defconfig | 5 ----- 1 file changed, 5 deletions(-) diff --git a/configs/j721e_sk_a72_defconfig b/configs/j721e_sk_a72_defconfig index 80e3e90cafd..f7ddb405ee1 100644 --- a/configs/j721e_sk_a72_defconfig +++ b/configs/j721e_sk_a72_defconfig @@ -1,9 +1,4 @@ #include -CONFIG_ARM=y -CONFIG_ARCH_K3=y -CONFIG_SOC_K3_J721E=y -CONFIG_TARGET_J721E_A72_EVM=y - CONFIG_DEFAULT_DEVICE_TREE="ti/k3-j721e-sk" CONFIG_OF_LIST="ti/k3-j721e-sk"