From patchwork Thu Dec 17 00:24:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1417432 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: 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=N07cQkq4; dkim-atps=neutral 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CxCRx1zFYz9sTX for ; Thu, 17 Dec 2020 11:24:39 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 35C7A827D1; Thu, 17 Dec 2020 01:24:29 +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="N07cQkq4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E5F32827E1; Thu, 17 Dec 2020 01:24:26 +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.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) (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 B3050826D4 for ; Thu, 17 Dec 2020 01:24:23 +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-il1-x129.google.com with SMTP id k8so24318866ilr.4 for ; Wed, 16 Dec 2020 16:24:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=k71ptrYYWOXalPnRhFSSVwdPs0pvuiwMqsv6tMXBw2k=; b=N07cQkq4qFL6nZVyvYibVd2Yk7q5M46r3zy9nKmhc56fmLv+aL+syeSqL85yjiMRZg butFrQEz+ikUTLRsxCezyakK1+gdpie/bwIxLk4FCu+gGHFxiJRG6lA30xAT2iOuW5AV Xd/TV56OOSjOW+Ks+ZBBqLtSTYqthrUBKjPYg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=k71ptrYYWOXalPnRhFSSVwdPs0pvuiwMqsv6tMXBw2k=; b=WHBerPuT/IbWu9njhfF2krwtlcGRkS2fv9tLUreX8jVu4UMovy8QtQvhkypZhLCCtP 8uIOAOONpvrL/fZFB8XRC/1rt0/U9rl7CarHTTuqGorL4hqly9sp+MF0KKoElItxmmJq S6HODJ/tI6HrlMg7hK8ah17rcEW1/tKGPWnA2e0dndyRlknl9+sZt8KeK8BgKvdwF7NL Ha03eeS8Og/vn1BfhNapJw4Mx9vNuxbdZegPAdjSGsM6qNDSQ1uxJxP7E+NuzCOltSur GC0Fz7rklwJA1onI0fri+XR3CEir4uTKp53+1KQmcR5PcZYt9XcQ2f2i5fMKyugws9+p xjhA== X-Gm-Message-State: AOAM530/xqaQ4Ekh35KV7vXhMd08QoWHz/dLjDxF92UuB8zsMNrm6lJz 3nGcz7caPq4lHDaLN9S/30d/3UDhl0jW1H/3 X-Google-Smtp-Source: ABdhPJx4+hKCfUF1gj6MKsrHo/SPgFcWVIN2EmBtsAn6tnXVhE6/OoUGGRQhlxscO0apX1I9tw54oA== X-Received: by 2002:a92:ba84:: with SMTP id t4mr44780367ill.260.1608164662017; Wed, 16 Dec 2020 16:24:22 -0800 (PST) Received: from localhost.localdomain (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id 1sm2206955ilv.37.2020.12.16.16.24.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Dec 2020 16:24:21 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH] buildman: Remove output binaries before building Date: Wed, 16 Dec 2020 17:24:17 -0700 Message-Id: <20201217002417.344390-1-sjg@chromium.org> X-Mailer: git-send-email 2.29.2.684.gfbc64c5ab5-goog MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean Buildman reuses build directories from previous builds to avoid the cost of 'make mrproper' for every build. If the previous build produced an SPL image but the current one does not, the SPL image will remain and buildman will think it is a result of building the current board. Remove these files before building, to avoid this problem. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/buildman/builderthread.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index c5bf31e9e11..d6648685823 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -13,6 +13,7 @@ from patman import command from patman import gitutil RETURN_CODE_RETRY = -1 +BASE_ELF_FILENAMES = ['u-boot', 'spl/u-boot-spl', 'tpl/u-boot-tpl'] def Mkdir(dirname, parents = False): """Make a directory if it doesn't already exist. @@ -240,6 +241,17 @@ class BuilderThread(threading.Thread): args.extend(self.builder.toolchains.GetMakeArguments(brd)) args.extend(self.toolchain.MakeArgs()) + # 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. + build_dir = self.builder.GetBuildDir(commit_upto, brd.target) + for elf in BASE_ELF_FILENAMES: + fname = os.path.join(out_dir, elf) + if os.path.exists(fname): + os.remove(fname) + # If we need to reconfigure, do that now if do_config: config_out = '' @@ -335,7 +347,7 @@ class BuilderThread(threading.Thread): for var in sorted(env.keys()): print('%s="%s"' % (var, env[var]), file=fd) lines = [] - for fname in ['u-boot', 'spl/u-boot-spl', 'tpl/u-boot-tpl']: + for fname in BASE_ELF_FILENAMES: cmd = ['%snm' % self.toolchain.cross, '--size-sort', fname] nm_result = command.RunPipe([cmd], capture=True, capture_stderr=True, cwd=result.out_dir,