Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 74E09C0015E for ; Thu, 20 Jul 2023 00:02:46 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1E832868E8; Thu, 20 Jul 2023 01:52:58 +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="jUHuRd9w"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CA9F8867CC; Thu, 20 Jul 2023 01:51:00 +0200 (CEST) Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (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 697BB867CC for ; Thu, 20 Jul 2023 01:50:54 +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-xd29.google.com with SMTP id ca18e2360f4ac-77a62a84855so8820139f.1 for ; Wed, 19 Jul 2023 16:50:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689810653; x=1690415453; 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=3yB5R5snRgIajsO09y4ATtiMibs3mBijHriziOl+Vq4=; b=jUHuRd9wQLmup6VD/oWAKVypd86KcimUHfIrZUiBOsZNR68UKIqJ9/yekvmfkVVtP/ fPgdbPjifY3ewRzBtmKY+Q+bTEahziZQJgNMvKbHr9lL3zDFS2tSdT2U/XbMOA8qR+7V k/njSd/DSwVlMDXBE5SmZeMtfVLk9kmTUyLy4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689810653; x=1690415453; 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=3yB5R5snRgIajsO09y4ATtiMibs3mBijHriziOl+Vq4=; b=B1eUg9SXCzIY+y7iR1dakxYE+xjwuRiLdSmoZMxzChjM7BPiOHJJfKHCVEZO6iRnN3 FlKd9XbHZLa0fDjz3rUripsup3RsECCtjUFDvXUl6xV01PyKuVLPWwcGqHY7E1RKS9ic UhCyLxCKTyGsm88eB0unZU4M1rtNy/4GNdMCgbccKsm/mY4L2DxG1iDQWdI1rh70M6wu +lg970GPF1e6vIejMaX0hnmOMXxUDo+EQSNe2ROdWFCQSw0Uzm++inQ/ZtzbRoGK8/Sy rd36ruD7fHBWCrmVCR/VXAl9HTZPsP6f3JxqI0DFQPqe+MKZnM5x2JXbOgwUVLk0nA7u vmVQ== X-Gm-Message-State: ABy/qLaJqWcfPjpqPzk9r0dFg8CtNnS8y0v1yZccftROrOTXX6AnndMh EjuL5xXsxE0Is8NBSU3jOr1QJ2lLn5YFhu3gMSI= X-Google-Smtp-Source: APBJJlH0+E9mBil6wtW11BZ3W6hjL9eJsxb+CEDTM3tM8f/zCqNkm6tesdXdF+gg+TjC8NJ9aPqH+Q== X-Received: by 2002:a5d:8596:0:b0:786:cd9c:cfa2 with SMTP id f22-20020a5d8596000000b00786cd9ccfa2mr3877365ioj.0.1689810652987; Wed, 19 Jul 2023 16:50:52 -0700 (PDT) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id ed16-20020a056638291000b0042bb1779c18sm1551779jab.151.2023.07.19.16.50.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 16:50:52 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Mike Frysinger , Simon Glass Subject: [PATCH v4 72/83] buildman: Move code to remove old outputs Date: Wed, 19 Jul 2023 17:49:20 -0600 Message-ID: <20230719234953.796101-73-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230719234953.796101-1-sjg@chromium.org> References: <20230719234953.796101-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Put this in its own function to reduce the size of the run_commit() function. Signed-off-by: Simon Glass --- (no changes since v1) tools/buildman/builderthread.py | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index b4891059b6db..4abad86ebc7b 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -42,6 +42,24 @@ def mkdir(dirname, parents = False): else: raise + +def _remove_old_outputs(out_dir): + """Remove any old output-target files + + Args: + out_dir (str): Output directory for the build + + Since we use a build directory that was previously used by another + board, it may have produced an SPL image. If we don't remove it (i.e. + see do_config and self.mrproper below) then it will appear to be the + output of this build, even if it does not produce SPL images. + """ + for elf in BASE_ELF_FILENAMES: + fname = os.path.join(out_dir, elf) + if os.path.exists(fname): + os.remove(fname) + + # pylint: disable=R0903 class BuilderJob: """Holds information about a job to be performed by a thread @@ -366,15 +384,7 @@ class BuilderThread(threading.Thread): config_args = [f'{brd.target}_defconfig'] config_out = io.StringIO() - # Remove any output targets. Since we use a build directory that - # was previously used by another board, it may have produced an - # SPL image. If we don't remove it (i.e. see do_config and - # self.mrproper below) then it will appear to be the output of - # this build, even if it does not produce SPL images. - for elf in BASE_ELF_FILENAMES: - fname = os.path.join(out_dir, elf) - if os.path.exists(fname): - os.remove(fname) + _remove_old_outputs(out_dir) # If we need to reconfigure, do that now cfg_file = os.path.join(out_dir, '.config') -- 2.41.0.487.g6d72f3e995-goog