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 D489EC001DF for ; Sun, 16 Jul 2023 00:48:42 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9652286705; Sun, 16 Jul 2023 02:40: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="e1HST5Wp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4F96F86652; Sun, 16 Jul 2023 02:38:33 +0200 (CEST) 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 0595B863C1 for ; Sun, 16 Jul 2023 02:38:11 +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-7878e573827so57763539f.1 for ; Sat, 15 Jul 2023 17:38:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689467889; x=1692059889; 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=mvi9cF5UOHmV4oc3PT8VCRDsmU2EMKhiSU96fjt6sq0=; b=e1HST5Wp2ORa5+Sc4YvPYofQqLzF+C8hY1M50/In5oIaGs/lVhfHHEqq4b3I09C2O3 PHPaa1IbBvVqK7kEFrkEVpH0XokTVL/0YeFAUryyf9LfuZu2sQwA3FOlBOfjUiXG1H8l sIIANnr3HOPP/2XEleYdIDyrxTB6n4/v70V64= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689467889; x=1692059889; 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=mvi9cF5UOHmV4oc3PT8VCRDsmU2EMKhiSU96fjt6sq0=; b=B37x05L91jfT3WofS7+u5Pt7hB2IgUDIy6WvEO3TZ6KXBK0vwg5tIrHeUVK7z3X3Bi i2I6aDX95Ii84f55Jg6z1VcreNXKc9lubfQuY9wrdfey4Is6e5F6IoT9sUOAfINMQ4Hx U6CMB+fbnEZeQI2q2NCLlTp2cTUpC3UVwrxmQ7VcBfdBCVvUEDGH9r0P+r4jhNvBcpH7 Vdq+pdJ+jj7kL647ge+JNVY9Gk6Pug+2sEt9a456E4q8kRGoXVKCkjvDtOSh/O6bLYdN fn1LJjlKqXQZBd5Ik1jvjDWcC67NzvYqlYDmZgtVXJiltirPiDZN03qRM9v+9TpVZS7b Dk/g== X-Gm-Message-State: ABy/qLa+C/7cw25Yq5QgLof+yYw/U6SnFILF8pDO3lskosd14gM4V3xp kPW1ZliCE2FODiyslvaMyiqIfHgOzOxJErsyoP4= X-Google-Smtp-Source: APBJJlGaNLY+EVLV75MHtsR5q3uJy5p/Wdox76+6+382jl0m5Cf/eQxkilQ7/mdGabkjW+1xOvcgqg== X-Received: by 2002:a92:280c:0:b0:346:7038:8506 with SMTP id l12-20020a92280c000000b0034670388506mr8280364ilf.2.1689467889629; Sat, 15 Jul 2023 17:38:09 -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.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jul 2023 17:38:09 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Mike Frysinger , Simon Glass Subject: [PATCH v3 66/81] buildman: Convert config_out to string IO Date: Sat, 15 Jul 2023 18:36:34 -0600 Message-ID: <20230716003718.231903-67-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 This is probably a little more efficient and it allows passing the object to another function to write data. Convert config_out to use a string I/O device. Signed-off-by: Simon Glass --- (no changes since v1) tools/buildman/builderthread.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index 42af5197dace..9c2938d1b071 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -10,6 +10,7 @@ based on the jobs provided. import errno import glob +import io import os import shutil import sys @@ -292,7 +293,7 @@ class BuilderThread(threading.Thread): args, cwd, src_dir = self._build_args(brd, out_dir, out_rel_dir, work_dir, commit_upto) config_args = [f'{brd.target}_defconfig'] - config_out = '' + 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 @@ -311,14 +312,14 @@ class BuilderThread(threading.Thread): if self.mrproper: result = self.make(commit, brd, 'mrproper', cwd, 'mrproper', *args, env=env) - config_out += result.combined + config_out.write(result.combined) cmd_list.append([self.builder.gnu_make, 'mrproper', *args]) result = self.make(commit, brd, 'config', cwd, *(args + config_args), env=env) cmd_list.append([self.builder.gnu_make] + args + config_args) - config_out += result.combined + config_out.write(result.combined) do_config = False # No need to configure next time if adjust_cfg: cfgutil.adjust_cfg_file(cfg_file, adjust_cfg) @@ -340,7 +341,7 @@ class BuilderThread(threading.Thread): result.return_code = 1 result.stderr = result.stderr.replace(src_dir + '/', '') if self.builder.verbose_build: - result.stdout = config_out + result.stdout + result.stdout = config_out.getvalue() + result.stdout result.cmd_list = cmd_list else: result.return_code = 1 -- 2.41.0.455.g037347b96a-goog