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 61B95C0015E for ; Thu, 20 Jul 2023 00:02:04 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 511E5868E9; Thu, 20 Jul 2023 01:52:53 +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="ft2ltZ80"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F0D3686808; Thu, 20 Jul 2023 01:50:58 +0200 (CEST) Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) (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 976AE8606E for ; Thu, 20 Jul 2023 01:50:51 +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-x132.google.com with SMTP id e9e14a558f8ab-3486eeb5c43so1678065ab.1 for ; Wed, 19 Jul 2023 16:50:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689810650; x=1690415450; 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=hH2WQnKY0e5uO4dbyNUjHHRaWkA7pTA+AYBDE0sPhS8=; b=ft2ltZ80E/8D+uibrcur4KnwCl3H7k4fgZqojQAIMyF47h709pS7jOO2ZeAoIgl3BU OCP6VxYxTjefKlOMI7uBUBUBB3rcMrsvsU2kJ3+51GPws7kUF71dN7CbHGb87BkkOYiC Bk35m9sTyNqS2Jgucz1tLkZ4qObA0bNJUj36k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689810650; x=1690415450; 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=hH2WQnKY0e5uO4dbyNUjHHRaWkA7pTA+AYBDE0sPhS8=; b=AKCNZ4MN07BNzO4ms671ZslCp8WUpB/aqOptPF7DPSVeuzXHBgGbwAp2Kq36h+jC4L HUCUlaYaiQ4/UDMTqo7jcqP9QHvDYgo/tGsKtdhDICvNENZ1UW3dplJJddDOd2MuUv50 5tVOPfNRbhLoI4HyYbayUVrT+BqrdDd+8cNT9AAwK2SgWyZ7zvNgfM4DUvb493MTuzwu wk3QBorAUVWhSOPM3zEXSNq67Q7fzbOTx3wFE2xHkcrC7cjM9+QjmqbRowF/k06jlTSO qGwrjNFk8AOPI7JS7/t2L2BI+fdgD0Jqscku32VDY9Xcg7cdc4pR/svBFDHE69OqZedi lW6A== X-Gm-Message-State: ABy/qLbtju2Xzt/TlvZoj49J9IRQCVrRGWMkInAuQZzbaRdNledzRCbl l8kEn3lZlbjvQwd+8C2s/tw5qLt3TT3dZYF7S18= X-Google-Smtp-Source: APBJJlExcxvqu5z8v29nTiwKZOHrrSuXJuVgrpLjmcdjnpW1xzAn+KoNzpRtO4S02tZdr0ogwmS6CA== X-Received: by 2002:a05:6e02:152f:b0:348:8b32:976e with SMTP id i15-20020a056e02152f00b003488b32976emr4659839ilu.2.1689810650139; Wed, 19 Jul 2023 16:50:50 -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.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 16:50:49 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Mike Frysinger , Simon Glass Subject: [PATCH v4 68/83] buildman: Convert config_out to string IO Date: Wed, 19 Jul 2023 17:49:16 -0600 Message-ID: <20230719234953.796101-69-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 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.487.g6d72f3e995-goog