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 97B39C0015E for ; Sun, 16 Jul 2023 00:49:52 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4567C86760; Sun, 16 Jul 2023 02:40:46 +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="f7vFbeUA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EC1D6862B9; Sun, 16 Jul 2023 02:38:42 +0200 (CEST) Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) (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 D82C4865DA for ; Sun, 16 Jul 2023 02:38:13 +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-x131.google.com with SMTP id e9e14a558f8ab-3457a3ada84so16172755ab.1 for ; Sat, 15 Jul 2023 17:38:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689467892; x=1692059892; 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=JTVRobA/jzUZX27DEsWyMpr4wCyzW83DoCxhsklLngE=; b=f7vFbeUAUmru07NWgSipGnx9/ADvF4U9tTIJ6GkFuE1yOHKszkLM/jkhZJYVJsYNfc t+GLnrUU+49RluVbDbyVVK+VuidAS8XLhJrR87uwDuEao0uG2rOgFTb3bWqul8If9/uN tJNhMWlSVRfCP3U29utbXlugpEu9BOCQbo+xo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689467892; x=1692059892; 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=JTVRobA/jzUZX27DEsWyMpr4wCyzW83DoCxhsklLngE=; b=QMUgTBjakeVgU29aicZ4yNsf6r8hnsRpa+b1cC6yuG8Ukj+16GYOPggPAy8xDP5jDC RTEMk1XrcpRy1gwN4ZmJYw9NjpIYqLiLI5yPg/s0B7QcQfSd2vsHKV5ISGwvOF124cK3 CeagUDsaAKkYDzP18/m6b47NaJz7pd8ZnajpBx2Elv4HlF8nt7pE8Mhy8nmDY1M9dzp0 S4f+JLOrr9rEUPj8BgvYxkDQDwi9tRsrnkH0HjVcDdw3YrYtsV8BqZ6odj7bx57Z5hEr mtBNbYHPN5js2Qok+sVO8A0WZne5FNUzx9ZekaIa8ZzNZbsnxeLooaTbmGWO7a9FMyiA 6szg== X-Gm-Message-State: ABy/qLasmk4Hd+PEbPM2+s4hL1BSzUBJ75ye2Z8bLtMrFUmg4Afuk0kf ttO1iOUVgYUQtG4ZzOX9SwVyEwszgrjQDRWMjnw= X-Google-Smtp-Source: APBJJlFQ6IWI10eTGBwitDA1xUjsKaEe7nVNW53sxL5wBqAW2dIpCeCzzQ+CSMivPH0NArjuYnnGtA== X-Received: by 2002:a92:c051:0:b0:347:5bbe:fc9e with SMTP id o17-20020a92c051000000b003475bbefc9emr8100133ilf.8.1689467892462; Sat, 15 Jul 2023 17:38:12 -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 t3-20020a05663801e300b0042b52dc77e3sm3510512jaq.158.2023.07.15.17.38.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jul 2023 17:38:12 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Mike Frysinger , Simon Glass Subject: [PATCH v3 70/81] buildman: Move code to remove old outputs Date: Sat, 15 Jul 2023 18:36:38 -0600 Message-ID: <20230716003718.231903-71-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.455.g037347b96a-goog In-Reply-To: <20230716003718.231903-1-sjg@chromium.org> References: <20230716003718.231903-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.455.g037347b96a-goog