From patchwork Fri Jun 21 13:14:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1950797 X-Patchwork-Delegate: trini@ti.com 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=n7AvEJCd; 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 4W5HrX0cYDz20Wb for ; Fri, 21 Jun 2024 23:14:36 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 82CAD88528; Fri, 21 Jun 2024 15:14:32 +0200 (CEST) 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="n7AvEJCd"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 88C1E8853B; Fri, 21 Jun 2024 15:14:30 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 74A0E8834D for ; Fri, 21 Jun 2024 15:14:28 +0200 (CEST) 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-7ea0b5e0977so81116739f.2 for ; Fri, 21 Jun 2024 06:14:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718975667; x=1719580467; 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=8Mv2z8VdDkE/D666PtSVwNsBKvgq2g5YlfbxzU0Pdis=; b=n7AvEJCdIgpUjOT9NLus7toTZ7umC6L7s6L9UjtCCjAHsGbLAMdt1MU5ZjZXJJwTgU i3WTVjphzvj6llHnjeDsfxRIiJSd3uQ61kgAxCa2ozdMBa2qnvE+yArkAJ53p4VOEDZI g6PQxqWy8+8UXARfycde5bKbjEWXoQvXTK6YU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718975667; x=1719580467; 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=8Mv2z8VdDkE/D666PtSVwNsBKvgq2g5YlfbxzU0Pdis=; b=gKdr/WroaB4s0gnTqzWaqPPdhPcMYpHjn73AMLapYJoWKUwr4HolMYhTz/zxOL8WlT NlAEkJ7Lk5Ee9fso3dkesWpOp7QINQdGMzXO0yhKHqabdLfuBhoFw4qM52k8gFF3Ddyv Uacqyl7ufLEkRHf3LZKK5lhJN7FvN3Lg9kB835HR5Wi9QhGAMOlp6mqU0uxdobEckHb4 YuWXXIZpCJDZ2F6Qwop617g4jCMkG08FJhp1yKTQxXL07AnfE2NF/Thj2sQYqgMpSSh1 7DNVc7jI5HK/ThwR5FSlvve4Wl1Wa4kpfKJ49yLYTY2jjnJ4AoZJVI9IDR6t5ikGlBRM GI6g== X-Gm-Message-State: AOJu0YxoIpgwnIKogrEZH/NFzGZNq4Cd9z/JN6SuJMySkKhfww6RVPE+ xPNOlah+7pYbve6u77oFJWSPhyOTA9DaAItl5SBFZEGbRECa9BOA4PLLD5wTjEx+gJ3e5BY5i7C VCg== X-Google-Smtp-Source: AGHT+IEixZ/sNzGx6+MxVuNhNasFgXB6vaKkQGgmnJeavRLTNav5lsxFjeRqujcZU9uHD47TWN/YMw== X-Received: by 2002:a05:6602:6c15:b0:7eb:6cbc:8856 with SMTP id ca18e2360f4ac-7f13edb1690mr943909839f.2.1718975667135; Fri, 21 Jun 2024 06:14:27 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b9d12496fdsm346881173.163.2024.06.21.06.14.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 06:14:26 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Neha Malcom Francis Subject: [PATCH v2 1/6] buildman: Add python3-coverage Date: Fri, 21 Jun 2024 07:14:17 -0600 Message-Id: <20240621131423.2363294-2-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240621131423.2363294-1-sjg@chromium.org> References: <20240621131423.2363294-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 Add this package so we can run code-coverage tests for Binman. Signed-off-by: Simon Glass Reviewed-by: Tom Rini --- Changes in v2: - Add to buildman requirements instead tools/buildman/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/buildman/requirements.txt b/tools/buildman/requirements.txt index 4a31e69e4cb..564e54898a4 100644 --- a/tools/buildman/requirements.txt +++ b/tools/buildman/requirements.txt @@ -1,3 +1,4 @@ +coverage==6.2 jsonschema==4.17.3 pyyaml==6.0 yamllint==1.26.3 From patchwork Fri Jun 21 13:14:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1950799 X-Patchwork-Delegate: trini@ti.com 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=faF/jZQB; 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)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W5Hrx4s8bz20Wb for ; Fri, 21 Jun 2024 23:14:57 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6447188555; Fri, 21 Jun 2024 15:14:34 +0200 (CEST) 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="faF/jZQB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 672868853F; Fri, 21 Jun 2024 15:14:32 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (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 12F30884FF for ; Fri, 21 Jun 2024 15:14:29 +0200 (CEST) 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-xd31.google.com with SMTP id ca18e2360f4ac-7ec07f4170bso77334139f.0 for ; Fri, 21 Jun 2024 06:14:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718975667; x=1719580467; 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=cFSaA6VXEcrgTv0f2bUiVlpqYrjIjc98DeuzLh+0B54=; b=faF/jZQBjaD0Ei3cnlT84qxayClfx/tAR8UI1ecvX6YJZUG553it96ZJtWNXpogNUw Bwl2xy+w3EGuSyLVU0RkdjQxdd3JQl/biuFpJkGzV0hgX9SOYP/yT2zPmQS16BUIo/+J yzO5c5M6YU5JFGF4H0/KHFCovo+LDXRHBwLyQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718975667; x=1719580467; 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=cFSaA6VXEcrgTv0f2bUiVlpqYrjIjc98DeuzLh+0B54=; b=gVbRjtw0MK7RBso84j5EJnAivN+229uvbCRyaQonp1VdbVUNFBULRrc9YbURWC9S/B D3Wsqq8p6SBQbrdmNSCBRNRsgS0PDp5XM9DE757VnjQ+g77HDlVxhLIEnZRcLw+N1FjQ FojSLl7v2rXceX9YmO8P3pP8mB9IA9EaEtt2nSdOUwrHb9qmsrrJs2jqbV14cZWVXg3o eJzBTwGL0v8N5D3/9CrduIM7wYEW/MGNL4wOym3WANZUBXQ5+fInbGPEhRQgcwMKUrfa Bo3YinDxvS+pCNMblUzHM+Z+cbgdPqXwneE6tJVBD5F8en3WDs9jkYccDigl98meIo0u tFvg== X-Gm-Message-State: AOJu0YynsJ/thwfUuo4ts4Qp0v8xC4DFn7+wD4ZpyF9ubvSvA3PEFXYv wgznp3+TsHXqOq4jO7CWQo3P7IvD41ClUt9A+SEVjJqLM0Nt7d1vNdPejQLfSKg1wAqrwW9GbN/ MVQ== X-Google-Smtp-Source: AGHT+IFHnKNHLuD5+sL4i/1CylgLWjbptKLkEPzoZK36hNL/ZvfgLqYunIc/vVSoORGn9A6EvsxJZA== X-Received: by 2002:a05:6602:1687:b0:7ec:1cf:6fc2 with SMTP id ca18e2360f4ac-7f13ee8bb5dmr878504839f.17.1718975667730; Fri, 21 Jun 2024 06:14:27 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b9d12496fdsm346881173.163.2024.06.21.06.14.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 06:14:27 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Neha Malcom Francis Subject: [PATCH v2 2/6] buildman: Add python3-pycryptodome Date: Fri, 21 Jun 2024 07:14:18 -0600 Message-Id: <20240621131423.2363294-3-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240621131423.2363294-1-sjg@chromium.org> References: <20240621131423.2363294-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 Binman entry types, so add it to allow more tests to pass. Signed-off-by: Simon Glass Reviewed-by: Tom Rini --- Changes in v2: - Add to buildman requirements instead tools/buildman/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/buildman/requirements.txt b/tools/buildman/requirements.txt index 564e54898a4..052d0ed5c6f 100644 --- a/tools/buildman/requirements.txt +++ b/tools/buildman/requirements.txt @@ -1,4 +1,5 @@ coverage==6.2 jsonschema==4.17.3 +pycryptodome==3.20 pyyaml==6.0 yamllint==1.26.3 From patchwork Fri Jun 21 13:14:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1950800 X-Patchwork-Delegate: trini@ti.com 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=m+MAxTUr; 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 4W5Hs86Mpcz1ydW for ; Fri, 21 Jun 2024 23:15:08 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C48CB8855C; Fri, 21 Jun 2024 15:14:34 +0200 (CEST) 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="m+MAxTUr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7694E884FF; Fri, 21 Jun 2024 15:14:32 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) (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 ED8BD88528 for ; Fri, 21 Jun 2024 15:14:29 +0200 (CEST) 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-xd2b.google.com with SMTP id ca18e2360f4ac-7eb6ca2cd09so61250639f.2 for ; Fri, 21 Jun 2024 06:14:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718975668; x=1719580468; 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=pztTEcQpgLbhvqiwb+N4h+BLnTNxkbZUaSNiUYTND/0=; b=m+MAxTUre38U37T8u4KYT2By0wyxf/f9GEfAB9mFDvBnwIX1vvmEhUY3eM1h9/oV0x AnJ7OLmpTRE49v742YyEf/ei+Qt0/a8u3svAIwcgMcSS1rl37y0wPIZB5f4sWmCxwOem yz+0Lwe7do1z/77glcOqEAbzv352/iWcloSHE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718975668; x=1719580468; 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=pztTEcQpgLbhvqiwb+N4h+BLnTNxkbZUaSNiUYTND/0=; b=HwxbkK7d3jGyGLquKVrqcL2bL2VNoIt0/8TpWwk0tHtFyMu/BghjstMVHOo7EW1p9V BCovsM7cWoUQecLolyejebyCY3+ydj7sc6Zf4BfBBa679rBwIWUN1WJFD5rFS747zdPj Y9z9NH3omlBdWzMgG911MSCZaCN7yQcvksHfmB+sfKx5s729C/yU13WcSFc5uH6GXWTW b8ZEYdUY2mAYFhdn24/51CyMHai5zKaEkC3n/YY9ebzWeih5+l0U/rDp3f1mO4xoaxqB dTUm8rFHjppJqUSJSiejS7jAnby0ukPNanUDR2/aKNDmTLHRIS6M8A1xYG2JA/KafPPA lg6A== X-Gm-Message-State: AOJu0Yxyfnt0PaGDcn1S1SRuE7bDjxh2MUCqR1BBDnSeVQoZNncn98dP QAuGOKjcnnVlG48x3kbco45nZAYhxKnQbRHmZXvbBpZ7as00N8QdcEsW3C1J5AkGDeuhfj8exrv UDw== X-Google-Smtp-Source: AGHT+IFc1uamojiRlq49om0mb1n6eVrjXf4pcudAwh3GupYlfK5pBMaO/P1B8OUNYRf02sIV7XGyxA== X-Received: by 2002:a05:6602:1614:b0:7eb:75e9:8f2e with SMTP id ca18e2360f4ac-7f13ee7b6b9mr901179639f.16.1718975668464; Fri, 21 Jun 2024 06:14:28 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b9d12496fdsm346881173.163.2024.06.21.06.14.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 06:14:28 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Heinrich Schuchardt , Alexey Brodkin Subject: [PATCH v2 3/6] buildman: Fix a few typos in toolchain code Date: Fri, 21 Jun 2024 07:14:19 -0600 Message-Id: <20240621131423.2363294-4-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240621131423.2363294-1-sjg@chromium.org> References: <20240621131423.2363294-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 Fix 'Thie' and capitalise 'unicode'. Signed-off-by: Simon Glass Suggested-by: Heinrich Schuchardt --- Changes in v2: - Add new patch to fix a few typos in toolchain code tools/buildman/toolchain.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py index 79c7c11a110..324ad0e0821 100644 --- a/tools/buildman/toolchain.py +++ b/tools/buildman/toolchain.py @@ -175,9 +175,9 @@ class Toolchain: def MakeEnvironment(self, full_path): """Returns an environment for using the toolchain. - Thie takes the current environment and adds CROSS_COMPILE so that + This takes the current environment and adds CROSS_COMPILE so that the tool chain will operate correctly. This also disables localized - output and possibly unicode encoded output of all build tools by + output and possibly Unicode encoded output of all build tools by adding LC_ALL=C. Note that os.environb is used to obtain the environment, since in some From patchwork Fri Jun 21 13:14:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1950801 X-Patchwork-Delegate: trini@ti.com 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=BI3HiWQ6; 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)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W5HsN3qc3z20X4 for ; Fri, 21 Jun 2024 23:15:20 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2FFAF8855F; Fri, 21 Jun 2024 15:14:35 +0200 (CEST) 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="BI3HiWQ6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 292A888550; Fri, 21 Jun 2024 15:14:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) (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 C7F0987073 for ; Fri, 21 Jun 2024 15:14:30 +0200 (CEST) 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-xd44.google.com with SMTP id ca18e2360f4ac-7eb7c8f114eso76174439f.1 for ; Fri, 21 Jun 2024 06:14:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718975669; x=1719580469; 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=2ATYadbv6Gh3psnUgQ3QOxAk0OgM02LjLYkK7bGyciI=; b=BI3HiWQ6mvUi4Tmb2wH+6R93X7M7knqZb2o/7yg9K/Hjd9/5HXAKssWL+dkWsBUByV IDnj7kHfS7qvSSw8jHmaeK9wZglEz9h+E9JQojoCBx1nhfZvv9CsKhrjJ4lcQnnyKxJs m6ag4fiiXyXsSzCPwmsmD3eBhp3+m8Tkni5uk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718975669; x=1719580469; 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=2ATYadbv6Gh3psnUgQ3QOxAk0OgM02LjLYkK7bGyciI=; b=kCUOQrX/bROpDE2VGffvi8rO8MdtFlvleONHydX0nng+CtNtumW31L8UkSEETOhm9s 7Nq+41K4Af+LYk+jeK9fXo4LiELfXEYJxa4dx1BSrm2veKT2R7N0Ar5tH1/TvtjHqc29 A1EUzkWwkpoL20vgVNcq+9BmFIW4jrII0KFCR27fJn86IHW5DVNBph3TVBq81IYrBLbB JwcqNO3mt9Qar0FsIKPKZN0heKnUCbt8czW1WSft+iKWfeslc72IOpy+kw+5wTghaJfY WVcq1SQ347FCjwHLFnc5jtkWpOQqK+vN1ngOXnTjN/Xmrkiv2vMH5eLgH/aaKkUqaIVF ri5Q== X-Gm-Message-State: AOJu0YzRLQS66cTr3vDghCRrKrlvWTSqw4RgJsovU47VC4qZNc61A5kO WosRoeXtx0fLbILZtJwx1paBxAQB1PTL4bGXXSYNpn2q5sQv4+kHOSkeTD7N+FVp/3s87Jiii38 UcCvl X-Google-Smtp-Source: AGHT+IGB8tc1wNzCfVc7f8+kQxcyKLB6YaSGjkSg8FtRqjX8gbCNLBxN5AYXI+xLCq41iBYhiWo/Og== X-Received: by 2002:a05:6602:2c8a:b0:7eb:b025:648d with SMTP id ca18e2360f4ac-7f13ee469eamr1044227839f.10.1718975669373; Fri, 21 Jun 2024 06:14:29 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b9d12496fdsm346881173.163.2024.06.21.06.14.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 06:14:28 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Alexey Brodkin , Heinrich Schuchardt , Quentin Schulz Subject: [PATCH v2 4/6] buildman: Support building within a Python venv Date: Fri, 21 Jun 2024 07:14:20 -0600 Message-Id: <20240621131423.2363294-5-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240621131423.2363294-1-sjg@chromium.org> References: <20240621131423.2363294-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 Python virtualenv tool sets up a few things in the environment, putting its path first in the PATH environment variable and setting up a sys.prefix different from the sys.base_prefix value. At present buildman puts the toolchain path first in PATH so that it can be found easily during the build. For sandbox this causes problems since /usr/bin/gcc (for example) results in '/usr/bin' being prepended to the PATH variable. As a result, the venv is partially disabled. The result is that sandbox builds within a venv ignore the venv, e.g. when looking for packages. Correct this by detecting the venv and adding the toolchain path after the venv path. Signed-off-by: Simon Glass --- Changes in v2: - Fix 'envronment' typo tools/buildman/bsettings.py | 3 ++ tools/buildman/test.py | 83 +++++++++++++++++++++++++++++++++++++ tools/buildman/toolchain.py | 31 ++++++++++++-- 3 files changed, 113 insertions(+), 4 deletions(-) diff --git a/tools/buildman/bsettings.py b/tools/buildman/bsettings.py index e225ac2ca0f..1be1d45e0fa 100644 --- a/tools/buildman/bsettings.py +++ b/tools/buildman/bsettings.py @@ -31,6 +31,9 @@ def setup(fname=''): def add_file(data): settings.readfp(io.StringIO(data)) +def add_section(name): + settings.add_section(name) + def get_items(section): """Get the items from a section of the config. diff --git a/tools/buildman/test.py b/tools/buildman/test.py index f92add7a7c5..83219182fe0 100644 --- a/tools/buildman/test.py +++ b/tools/buildman/test.py @@ -146,6 +146,7 @@ class TestBuild(unittest.TestCase): self.toolchains.Add('arm-linux-gcc', test=False) self.toolchains.Add('sparc-linux-gcc', test=False) self.toolchains.Add('powerpc-linux-gcc', test=False) + self.toolchains.Add('/path/to/aarch64-linux-gcc', test=False) self.toolchains.Add('gcc', test=False) # Avoid sending any output @@ -747,6 +748,88 @@ class TestBuild(unittest.TestCase): self.assertEqual([ ['MARY="mary"', 'Missing expected line: CONFIG_MARY="mary"']], result) + def call_make_environment(self, tchn, full_path, in_env=None): + """Call Toolchain.MakeEnvironment() and process the result + + Args: + tchn (Toolchain): Toolchain to use + full_path (bool): True to return the full path in CROSS_COMPILE + rather than adding it to the PATH variable + in_env (dict): Input environment to use, None to use current env + + Returns: + tuple: + dict: Changes that MakeEnvironment has made to the environment + key: Environment variable that was changed + value: New value (for PATH this only includes components + which were added) + str: Full value of the new PATH variable + """ + env = tchn.MakeEnvironment(full_path, env=in_env) + + # Get the original environment + orig_env = dict(os.environb if in_env is None else in_env) + orig_path = orig_env[b'PATH'].split(b':') + + # Find new variables + diff = dict((k, env[k]) for k in env if orig_env.get(k) != env[k]) + + # Find new / different path components + diff_path = None + new_path = None + if b'PATH' in diff: + new_path = diff[b'PATH'].split(b':') + diff_paths = [p for p in new_path if p not in orig_path] + diff_path = b':'.join(p for p in new_path if p not in orig_path) + if diff_path: + diff[b'PATH'] = diff_path + else: + del diff[b'PATH'] + return diff, new_path + + def test_toolchain_env(self): + """Test PATH and other environment settings for toolchains""" + # Use a toolchain which has a path, so that full_path makes a difference + tchn = self.toolchains.Select('aarch64') + + # Normal cases + diff = self.call_make_environment(tchn, full_path=False)[0] + self.assertEqual( + {b'CROSS_COMPILE': b'aarch64-linux-', b'LC_ALL': b'C', + b'PATH': b'/path/to'}, diff) + + diff = self.call_make_environment(tchn, full_path=True)[0] + self.assertEqual( + {b'CROSS_COMPILE': b'/path/to/aarch64-linux-', b'LC_ALL': b'C'}, + diff) + + # When overriding the toolchain, only LC_ALL should be set + tchn.override_toolchain = True + diff = self.call_make_environment(tchn, full_path=True)[0] + self.assertEqual({b'LC_ALL': b'C'}, diff) + + # Test that virtualenv is handled correctly + tchn.override_toolchain = False + sys.prefix = '/some/venv' + env = dict(os.environb) + env[b'PATH'] = b'/some/venv/bin:other/things' + tchn.path = '/my/path' + diff, diff_path = self.call_make_environment(tchn, False, env) + + self.assertIn(b'PATH', diff) + self.assertEqual([b'/some/venv/bin', b'/my/path', b'other/things'], + diff_path) + self.assertEqual( + {b'CROSS_COMPILE': b'aarch64-linux-', b'LC_ALL': b'C', + b'PATH': b'/my/path'}, diff) + + # Handle a toolchain wrapper + tchn.path = '' + bsettings.add_section('toolchain-wrapper') + bsettings.set_item('toolchain-wrapper', 'my-wrapper', 'fred') + diff = self.call_make_environment(tchn, full_path=True)[0] + self.assertEqual( + {b'CROSS_COMPILE': b'fred aarch64-linux-', b'LC_ALL': b'C'}, diff) if __name__ == "__main__": unittest.main() diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py index 324ad0e0821..6ca79c2c0f9 100644 --- a/tools/buildman/toolchain.py +++ b/tools/buildman/toolchain.py @@ -172,13 +172,14 @@ class Toolchain: else: raise ValueError('Unknown arg to GetEnvArgs (%d)' % which) - def MakeEnvironment(self, full_path): + def MakeEnvironment(self, full_path, env=None): """Returns an environment for using the toolchain. This takes the current environment and adds CROSS_COMPILE so that the tool chain will operate correctly. This also disables localized output and possibly Unicode encoded output of all build tools by - adding LC_ALL=C. + adding LC_ALL=C. For the case where full_path is False, it prepends + the toolchain to PATH Note that os.environb is used to obtain the environment, since in some cases the environment many contain non-ASCII characters and we see @@ -187,15 +188,21 @@ class Toolchain: UnicodeEncodeError: 'utf-8' codec can't encode characters in position 569-570: surrogates not allowed + When running inside a Python venv, care is taken not to put the + toolchain path before the venv path, so that builds initiated by + buildman will still respect the venv. + Args: full_path: Return the full path in CROSS_COMPILE and don't set PATH + env (dict of bytes): Original environment, used for testing Returns: Dict containing the (bytes) environment to use. This is based on the current environment, with changes as needed to CROSS_COMPILE, PATH and LC_ALL. """ - env = dict(os.environb) + env = dict(env or os.environb) + wrapper = self.GetWrapper() if self.override_toolchain: @@ -206,7 +213,23 @@ class Toolchain: wrapper + os.path.join(self.path, self.cross)) else: env[b'CROSS_COMPILE'] = tools.to_bytes(wrapper + self.cross) - env[b'PATH'] = tools.to_bytes(self.path) + b':' + env[b'PATH'] + + # Detect a Python virtualenv and avoid defeating it + if sys.prefix != sys.base_prefix: + paths = env[b'PATH'].split(b':') + new_paths = [] + to_insert = tools.to_bytes(self.path) + insert_after = tools.to_bytes(sys.prefix) + for path in paths: + new_paths.append(path) + if to_insert and path.startswith(insert_after): + new_paths.append(to_insert) + to_insert = None + if to_insert: + new_paths.append(to_insert) + env[b'PATH'] = b':'.join(new_paths) + else: + env[b'PATH'] = tools.to_bytes(self.path) + b':' + env[b'PATH'] env[b'LC_ALL'] = b'C' From patchwork Fri Jun 21 13:14:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1950802 X-Patchwork-Delegate: trini@ti.com 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=eRGFOvDy; 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)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W5Hsc4RSZz20X4 for ; Fri, 21 Jun 2024 23:15:32 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 946FD88577; Fri, 21 Jun 2024 15:14:38 +0200 (CEST) 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="eRGFOvDy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8495288405; Fri, 21 Jun 2024 15:14:34 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) (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 8543288405 for ; Fri, 21 Jun 2024 15:14:31 +0200 (CEST) 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-xd36.google.com with SMTP id ca18e2360f4ac-7eec09cc7f6so75759939f.0 for ; Fri, 21 Jun 2024 06:14:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718975670; x=1719580470; 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=eIaUHtmxOCoDPB8Dr2EtcMBBfsP4hsti4aYZcgI3OQk=; b=eRGFOvDy9pUDaigk/VJdiAKS6OMYJRqrXI6QEvFulRR3ZEkM/6pQtCVP66zP3GWW/W YCGrVmt/oid7/B15fenyz3HkEZQIihNWM157rMKqhXet2lSuqHxxeYzEcsbRQrZwWuLQ fgjD2HPt70msnKHoDdlxN+AHePXycn/dkTFnY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718975670; x=1719580470; 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=eIaUHtmxOCoDPB8Dr2EtcMBBfsP4hsti4aYZcgI3OQk=; b=vk3p9AJCiu5yB/rWWGJjE41gKlXpRzcfuO6WkvFtVbnJtmfZtuMwBe7ezxpSo08t7c ABYBg2wmHL2ec5MVX6ZPZvoRQMX+B+5nmORK9tKbYnLxkj/aemrGNpJVYet4AW7zA9Et Hw0NvqOsv9sftu/3ggFQj2I1qmIDNzPqLFfTSxQJlDIJ4MrxVAtcS8mBi45L/p6OwXuA +zxBY+C13/8SaRAs5JzG2HZoS+c6u9DineKJxkIOOJuCSC0GIvG2MhVpPdqCpDDIifoV OSLOTOgf0qWD7q8dNDRSoW8Iekj09Tm/sk3bgTCaZsgEKCKUU3hCqGqhXxMbtP9mJY47 GE+A== X-Gm-Message-State: AOJu0YxeHDyNNS7TEYySf2P3VbPoyH47ax1dbPXzLzOzASMKahp1FHFG cvGr5kXHtrA64ED0k1unKhFrVmMmAvnrN+FVBXfXfVCJe+3qGI7z72qxtEoreKv1s/EXjI9Zgog RBQ== X-Google-Smtp-Source: AGHT+IEZ9zSvxf1XnGz2Wu8RCS3RNJMRkS/RInzvWk3Ou8A/LwA6KiRn+TH1tpqSvgOaykusM7Dz3A== X-Received: by 2002:a05:6602:15c9:b0:7eb:906e:e3ee with SMTP id ca18e2360f4ac-7f13ee5c07dmr971246439f.12.1718975670204; Fri, 21 Jun 2024 06:14:30 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b9d12496fdsm346881173.163.2024.06.21.06.14.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 06:14:29 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v2 5/6] u_boot_pylib: Use correct coverage tool within venv Date: Fri, 21 Jun 2024 07:14:21 -0600 Message-Id: <20240621131423.2363294-6-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240621131423.2363294-1-sjg@chromium.org> References: <20240621131423.2363294-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 When running within a Python venv we must use the 'coverage' tool (which is within the venv) so that the venv packages are used in preference to system packages. Otherwise the coverage tests run in a different environment from the normal tests and may fail due to missing packages. Handle this by detecting the venv and changing the tool name. Signed-off-by: Simon Glass --- (no changes since v1) tools/u_boot_pylib/test_util.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/u_boot_pylib/test_util.py b/tools/u_boot_pylib/test_util.py index f18d385d995..857ce58c98c 100644 --- a/tools/u_boot_pylib/test_util.py +++ b/tools/u_boot_pylib/test_util.py @@ -60,12 +60,17 @@ def run_test_coverage(prog, filter_fname, exclude_list, build_dir, required=None prefix = '' if build_dir: prefix = 'PYTHONPATH=$PYTHONPATH:%s/sandbox_spl/tools ' % build_dir - cmd = ('%spython3-coverage run ' - '--omit "%s" %s %s %s %s' % (prefix, ','.join(glob_list), + + # Detect a Python virtualenv and use 'coverage' instead + covtool = ('python3-coverage' if sys.prefix == sys.base_prefix else + 'coverage') + + cmd = ('%s%s run ' + '--omit "%s" %s %s %s %s' % (prefix, covtool, ','.join(glob_list), prog, extra_args or '', test_cmd, single_thread or '-P1')) os.system(cmd) - stdout = command.output('python3-coverage', 'report') + stdout = command.output(covtool, 'report') lines = stdout.splitlines() if required: # Convert '/path/to/name.py' just the module name 'name' From patchwork Fri Jun 21 13:14:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1950803 X-Patchwork-Delegate: trini@ti.com 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=aN07L96y; 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 4W5Hsr3kzbz20X4 for ; Fri, 21 Jun 2024 23:15:44 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F26E08857B; Fri, 21 Jun 2024 15:14:38 +0200 (CEST) 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="aN07L96y"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4342A8856B; Fri, 21 Jun 2024 15:14:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) (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 4A51C88535 for ; Fri, 21 Jun 2024 15:14:32 +0200 (CEST) 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-il1-x130.google.com with SMTP id e9e14a558f8ab-375fb45f465so6900845ab.1 for ; Fri, 21 Jun 2024 06:14:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718975671; x=1719580471; 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=tEunDF9aQ7k+SO7gKtPR54y2aN4VmiNW5O87tayPoB4=; b=aN07L96yelP/9+edXHG3lJCqkxt7fmIoCMS0HN/33RVtk1ygdrZJoJnS8qWqNpQgue hD85AoOGSgONAWeyf8qBpvuHQM4mn++mcXWc9lQlYEg9OG5fCikUXePPX4i4RcyEsAPp 2klzga3hkfJMP1NN8QbCVxnrs1hrIeM8LpEDg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718975671; x=1719580471; 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=tEunDF9aQ7k+SO7gKtPR54y2aN4VmiNW5O87tayPoB4=; b=VEJn2VnNRa+8d8SK+9Xg2D2bYyX5tgxMt6iL1fNl711Ch2DdRiHUNcUVCqtLFv2Dvn Z1zGS99Wb3OGRZ3AqDVD1lwgqCzk6c/IzoP3p7qiIZAiekwWi7OpEECZNmv3y9/mofdx yI1uJDyivbRe4w+lBF+YmQTC4zhSkDuyOKfWs0uVhnM64oKYn6dkh6x4vktAnx2nAGJv u5NvYqOdgMuc6eTxTaQRhP4ZSJEC3M6mYd+bU4CU0LOc1oqFuouu7gJ9NStst+Hkw6NL vG4eodvd5Dt5QduNnoe/TUMA5L5etHNmOdCfT43d+4gOAwRfamyGv6M7xUTVZBgjePKj tXaw== X-Gm-Message-State: AOJu0YzihnCVdMzn2RrXZ/Kg8ydJHPj0VyQJRG+WCMKeviPnTYgOT1eB hJyfWPRZBrZcf4sSDRyGaKGZwXjBpWDSIwYZNrVWjla4+y+q30F4ASJtpeja9FucWIWkT/kzOEw 4kg== X-Google-Smtp-Source: AGHT+IH4297f/TRE4NeVTA1Fq8nUZYpl78Xpse//MhtHLyI/xGtBja/qbHP1rgb1OZefdDuaWW8L7A== X-Received: by 2002:a05:6602:1347:b0:7eb:8730:a305 with SMTP id ca18e2360f4ac-7f13edf0210mr984196039f.3.1718975670939; Fri, 21 Jun 2024 06:14:30 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b9d12496fdsm346881173.163.2024.06.21.06.14.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 06:14:30 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Andrejs Cainikovs , Leo Yu-Chi Liang , Marek Vasut , Sean Anderson Subject: [PATCH v2 6/6] CI: Run code-coverage test for Binman Date: Fri, 21 Jun 2024 07:14:22 -0600 Message-Id: <20240621131423.2363294-7-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240621131423.2363294-1-sjg@chromium.org> References: <20240621131423.2363294-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 Binman includes a good set of tests covering all of its functionality. This includes a code-coverage test. However to date the code-coverage test has not been checked automatically by CI, relying on people to run 'binman test -T' themselves. Plug the gap to avoid bugs creeping in future. Signed-off-by: Simon Glass --- Changes in v2: - Add to azure also (oops) .azure-pipelines.yml | 5 ++++- .gitlab-ci.yml | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 27f69583c65..65d1d639e49 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -128,7 +128,10 @@ stages: export PATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH} ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w --board tools-only set -ex - ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test + export TOOLPATH="--toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools --toolpath /opt/coreboot" + ./tools/binman/binman ${TOOLPATH} test + # Avoid "Permission denied: 'cov'" error by using a temporary file + COVERAGE_FILE=/tmp/.coverage ./tools/binman/binman ${TOOLPATH} test -T ./tools/buildman/buildman -t ./tools/dtoc/dtoc -t ./tools/patman/patman test diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 165f765a833..eb01fa4868d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -201,7 +201,9 @@ Run binman, buildman, dtoc, Kconfig and patman testsuites: ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w --board tools-only; set -e; - ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test; + export TOOLPATH="--toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools --toolpath /opt/coreboot"; + ./tools/binman/binman ${TOOLPATH} test; + ./tools/binman/binman ${TOOLPATH} test -T; ./tools/buildman/buildman -t; ./tools/dtoc/dtoc -t; ./tools/patman/patman test;