From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 1A0BD3858297 for ; Mon, 11 Mar 2024 19:03:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1A0BD3858297 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1A0BD3858297 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710183829; cv=none; b=MZPXyK4YSX7SKkA2H6AR/4hYreUcK/vHwe4lWzt5oOOZI2eM9lzINkf94y7m8fff7xtzzMiFbqUCIozTAqmH6LT1dCj4f1QdwMcbtAMlU4jqo5yB8PPJT52fXfaEUJDVOkukQtd4foOOOeQsk0tcCN5v1DztLHjy1EqWjsuuEBc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710183829; c=relaxed/simple; bh=xyCkoqcSGKveVC6+o9xBecChC+IVaA/pts87sjqiYgc=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=utywm6NLuL7q4O+Ep6uaq0/LmUzTjJXgOgX2TnSxKh5yddK+/r6nFCiNYMKV59KihPm5xgNrGyhFL5LFAwvD9dy4uC1qyNOzgFfG8bNsYw6V1EkAWB/IXqnMvxWhtLah7SRS1V8Ia6Y6/eouP8T7UtRE5AtOCj15aslBL0NZof4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from smarchi-efficios.internal.efficios.com (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 61F4D1E0FD; Mon, 11 Mar 2024 15:03:44 -0400 (EDT) From: Simon Marchi To: buildbot@sourceware.org Cc: Simon Marchi Subject: [PATCH 6/8] autoregen.py: print executed commands on stdout Date: Mon, 11 Mar 2024 15:01:18 -0400 Message-ID: <20240311190341.235331-7-simon.marchi@efficios.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240311190341.235331-1-simon.marchi@efficios.com> References: <20240311190341.235331-1-simon.marchi@efficios.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3496.4 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_NONE,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_SOFTFAIL,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This allows seeing what commands the buildbot executes exactly. It will help whenever there is a difference in the generated files between what a developer gets locally and what the buildbot gets. --- builder/containers/autoregen.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/builder/containers/autoregen.py b/builder/containers/autoregen.py index 6560077a406b..ff6939b66105 100755 --- a/builder/containers/autoregen.py +++ b/builder/containers/autoregen.py @@ -41,6 +41,15 @@ SKIP_DIRS = [ ] +# Run the shell command CMD. +# +# Print the command on stdout prior to running it. +def run_shell(cmd: str): + cmd = f"{ENV} {cmd}" + print(f"+ {cmd}") + subprocess.check_output(f"{ENV} {cmd}", shell=True, encoding="utf8") + + config_folders: list[Path] = [] for root, _, files in os.walk("."): @@ -70,23 +79,17 @@ for folder in sorted(config_folders): include_arg = "-I../.." include_arg2 = "-I../../config" - subprocess.check_output( - f"{ENV} {ACLOCAL_BIN} --force {include_arg} {include_arg2}", - shell=True, - encoding="utf8", - ) + run_shell(f"{ACLOCAL_BIN} --force {include_arg} {include_arg2}") if (folder / "config.in").is_file() or any( True for line in configure_lines if line.startswith("AC_CONFIG_HEADERS") ): - subprocess.check_output( - f"{ENV} {AUTOHEADER_BIN} -f", shell=True, encoding="utf8" - ) + run_shell(f"{AUTOHEADER_BIN} -f") # apparently automake is somehow unstable -> skip it for gotools if any( True for line in configure_lines if line.startswith("AM_INIT_AUTOMAKE") ) and not str(folder).endswith("gotools"): - subprocess.check_output(f"{ENV} {AUTOMAKE_BIN} -f", shell=True, encoding="utf8") + run_shell(f"{AUTOMAKE_BIN} -f") - subprocess.check_output(f"{ENV} {AUTOCONF_BIN} -f", shell=True, encoding="utf8") + run_shell(f"{AUTOCONF_BIN} -f") -- 2.44.0