From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id BDD2A385841E for ; Tue, 12 Mar 2024 17:53:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BDD2A385841E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BDD2A385841E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=132.207.4.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710266032; cv=none; b=LLjiw9pOYOB4V9RwCEns2nP8ZdI0SlpF5Mpw1cYhnRUYUIdT0YEf+FwElYCq7rpzX4Dw6+IgdxS+ShJVdYUQiY6HsseuRJiI5qFlhPbIt6osarjJpwmkxo8iTs0UUfBkERCcNG3TeMdBKioegqhcFtZ5SERO1+p2vTbBf2G1nv8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710266032; c=relaxed/simple; bh=JprNlYNlnoZl05jHYRgXxy+yT2NRdlEAR8sTdM+XzGo=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=szEtemiD1uanRSGq2lpHNOrerngnJtlFCbWE6AsZnDi3xEreWDZCsYqtuONcSez9aPn+O5xe1kypXB4Ot2+127DlTeEWA6/GEoe21/QVW5F3+EDkGv7FT+ypyUOjl0Sd/g2ut+yoq+Im+t9CkVFX3fcDV2Le/05sNJV7q3tmOgY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 42CHrixi016690 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Mar 2024 13:53:49 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 42CHrixi016690 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1710266029; bh=C645KlSzhZA2CQlnAVRs0nfjIOSt1nVn1M1grkbCYBk=; h=From:To:Cc:Subject:Date:From; b=IdmYEeeG/uQzCQfoJy7J3ttW2bpXLbpWhHU8QKoRK5MJnMVJnfMCcQumhGiNpY25V re0S4f3IqJrCKwRIxVOIr+CB2gXew7kQyRMZipm+ONSPkktYbbcoWv35JVbE0AEjP0 2oPWoVwEt415sG4lEb3LKut8WrSmaoghUk97EBns= Received: from simark.localdomain (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (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 82C6A1E0AC; Tue, 12 Mar 2024 13:53:44 -0400 (EDT) From: Simon Marchi To: buildbot@sourceware.org Cc: Simon Marchi Subject: [PATCH] autoregen.py: use autoreconf in some directories Date: Tue, 12 Mar 2024 13:53:37 -0400 Message-ID: <20240312175341.239513-1-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Tue, 12 Mar 2024 17:53:44 +0000 X-Spam-Status: No, score=-3188.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE,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: The builder currently mis-generates the config files for the gdb and gnulib directories. It passes `-I ../config` to aclocal, causing the include path order to be different to what it would be without that -I argument, causing the generated aclocal.m4 to be different (same entries but different order). For the gdb, gdbserver, gdbsupport and gnulib directories, the config files are usually re-generated without any -I argument. In fact, for gnulib, it is baked in gnulib/update-gnulib.sh that aclocal should be called without -I arguments: aclocal && autoconf && autoheader && automake Moreover, they can be re-generated using autoreconf, removing the need to guess which speicific tools need to be invoked. autoreconf takes a bit more time to run than the individual tools, but it's worth it for the simplicity. So, add a list of directories for which it is known that they can be re-generated using a simple autoreconf without special flags. For these directories, call `autoreconf -f`. --- builder/containers/autoregen.py | 63 ++++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 20 deletions(-) diff --git a/builder/containers/autoregen.py b/builder/containers/autoregen.py index ac16f54f6caa..138b9af2590f 100755 --- a/builder/containers/autoregen.py +++ b/builder/containers/autoregen.py @@ -13,12 +13,14 @@ AUTOCONF_NAMES = ["autoconf-vanilla-2.69", "autoconf-2.69", "autoconf"] AUTOMAKE_NAMES = ["automake-vanilla-1.15", "automake-1.15.1", "automake"] ACLOCAL_NAMES = ["aclocal-vanilla-1.15", "aclocal-1.15.1", "aclocal"] AUTOHEADER_NAMES = ["autoheader-vanilla-2.69", "autoheader-2.69", "autoheader"] +AUTORECONF_NAMES = ["autoreconf-vanilla-2.69", "autoreconf-2.69", "autoreconf"] # Pick the first for each list that exists on this system. AUTOCONF_BIN = next(name for name in AUTOCONF_NAMES if shutil.which(name)) AUTOMAKE_BIN = next(name for name in AUTOMAKE_NAMES if shutil.which(name)) ACLOCAL_BIN = next(name for name in ACLOCAL_NAMES if shutil.which(name)) AUTOHEADER_BIN = next(name for name in AUTOHEADER_NAMES if shutil.which(name)) +AUTORECONF_BIN = next(name for name in AUTORECONF_NAMES if shutil.which(name)) # autoconf-wrapper and automake-wrapper from Gentoo look at this environment variable. # It's harmless to set it on other systems though. @@ -41,6 +43,15 @@ SKIP_DIRS = [ "minizip", ] +# these directories are known to can be re-generatable with a simple autoreconf +# without special -I flags +AUTORECONF_DIRS = [ + "gdb", + "gdbserver", + "gdbsupport", + "gnulib", +] + # Run the shell command CMD. # @@ -57,28 +68,11 @@ def run_shell(cmd: str): res.check_returncode() -run_shell(f"{AUTOCONF_BIN} --version") -run_shell(f"{AUTOMAKE_BIN} --version") -run_shell(f"{ACLOCAL_BIN} --version") -run_shell(f"{AUTOHEADER_BIN} --version") - -print(f"Environment: {ENV}") +def regenerate_with_autoreconf(): + run_shell(f"{AUTORECONF_BIN} -f") -config_folders: list[Path] = [] - -for root, _, files in os.walk("."): - for file in files: - if file == "configure.ac": - config_folders.append(Path(root).resolve()) - -for folder in sorted(config_folders): - if folder.stem in SKIP_DIRS: - print(f"Skipping directory {folder}", flush=True) - continue - - print(f"Entering directory {folder}", flush=True) - os.chdir(folder) +def regenerate_manually(): configure_lines = open("configure.ac").read().splitlines() if any(True for line in configure_lines if line.startswith("AC_CONFIG_MACRO_DIRS")): # aclocal does not support the -f short option for force @@ -107,3 +101,32 @@ for folder in sorted(config_folders): run_shell(f"{AUTOMAKE_BIN} -f") run_shell(f"{AUTOCONF_BIN} -f") + + +run_shell(f"{AUTOCONF_BIN} --version") +run_shell(f"{AUTOMAKE_BIN} --version") +run_shell(f"{ACLOCAL_BIN} --version") +run_shell(f"{AUTOHEADER_BIN} --version") + +print(f"Environment: {ENV}") + +config_folders: list[Path] = [] +repo_root = Path.cwd() + +for root, _, files in os.walk("."): + for file in files: + if file == "configure.ac": + config_folders.append(Path(root).resolve()) + +for folder in sorted(config_folders): + if folder.stem in SKIP_DIRS: + print(f"Skipping directory {folder}", flush=True) + continue + + print(f"Entering directory {folder}", flush=True) + os.chdir(folder) + + if str(folder.relative_to(repo_root)) in AUTORECONF_DIRS: + regenerate_with_autoreconf() + else: + regenerate_manually() base-commit: 3e013842366735c373ef19ec6dfc4a33d6f9c473 -- 2.44.0