From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id EE28C3858C66 for ; Sun, 12 Nov 2023 12:10:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EE28C3858C66 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EE28C3858C66 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=45.83.234.184 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699791060; cv=none; b=jaYpqzmfiTP/ksmvySdX+hv8iFKEEpxQGwVld11cFiEr3P+mrVtpeomRiSKwWOW6jvWB5gznfXVHctba86Y8HIa67aY0sVSski2zxmDvTwakrVY9AM2bHiRuc4ReCmlpG17ecFa+Asx5bFcDhrEYX9K2u58PVr7+aKAmXKelVbc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699791060; c=relaxed/simple; bh=ldQCmafx2itDP4pvXtk9KQL5hSQqw7L3Tb6oWjSgEm0=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=BoUfwld1FL38MCEydoXNbfPc7KktO2TZi2BDJpq7c6cQvkjxE8totyZXer39Z1plGuN7Z6cg4TKhDELLZZEDz8YzOBVv2SauenjpAu+r+VILchrRRhtIXN1zjP47HCBgS8kJaxaRPoeAIhhJbBDjEd0FY5hu0NydUxDRf9t2b28= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from csb.redhat.com (deer0x03.wildebeest.org [172.31.17.133]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 630B2302FDD8; Sun, 12 Nov 2023 13:10:56 +0100 (CET) Received: by csb.redhat.com (Postfix, from userid 10916) id C9B8ACB959; Sun, 12 Nov 2023 13:10:55 +0100 (CET) From: Mark Wielaard To: buildbot@sourceware.org Cc: Mark Wielaard Subject: [PATCH] Add gcc autotools checker Date: Sun, 12 Nov 2023 13:10:51 +0100 Message-Id: <20231112121051.1490556-1-mark@klomp.org> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3034.3 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,KAM_SHORT,SPF_HELO_NONE,SPF_PASS,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 introduces the autoregen.py by Martin Liska as posted by Martin Jambor. A new Containerfile autotools is added that has builds for autoconf 2.69 and automake 1.15.1 and the new autoregen.py script. This new Containerfile is then used to check that regenerating the auto* files doesn't introduce any diffs. --- builder/containers/Containerfile-autotools | 50 ++++++++++++++++++++++ builder/containers/autoregen.py | 33 ++++++++++++++ builder/master.cfg | 26 +++++++++++ 3 files changed, 109 insertions(+) create mode 100644 builder/containers/Containerfile-autotools create mode 100755 builder/containers/autoregen.py diff --git a/builder/containers/Containerfile-autotools b/builder/containers/Containerfile-autotools new file mode 100644 index 0000000..ed40f6b --- /dev/null +++ b/builder/containers/Containerfile-autotools @@ -0,0 +1,50 @@ +# Container file for setting up autotools versions as used by gcc + +# Setup the (minimal) image, upgrade and install all devel packages +FROM debian:stable +RUN apt-get update && \ + apt-get upgrade -y && \ + apt-get install -y \ + build-essential libtool ccache perl python3 bash \ + patch util-linux diffutils cpio procps \ + coreutils make git \ + gettext bison flex \ + gawk m4 pkg-config \ + bzip2 xz-utils gzip zstd \ + findutils file tar wget \ + buildbot-worker && \ + apt-get clean + +# Get, build and install autoconf 2.69 and automake 1.15.1 +RUN wget https://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz && \ + wget https://ftp.gnu.org/gnu/automake/automake-1.15.1.tar.gz && \ + tar zxf autoconf-2.69.tar.gz && \ + tar zxf automake-1.15.1.tar.gz && \ + cd autoconf-2.69 && \ + ./configure --program-suffix=-2.69 && \ + make && make install && cd .. && \ + cd automake-1.15.1 && \ + ./configure --program-suffix=-1.15.1 \ + && make && make install && cd .. + +# Get and install the autoregen.py script +RUN wget -O /usr/local/bin/autoregen.py \ + 'https://sourceware.org/cgit/builder/plain/builder/containers/autoregen.py' \ + && chmod 755 /usr/local/bin/autoregen.py + +# Setup user with same id as host user id. +RUN adduser --home /home/builder --uid 1001 builder + +# Set image specific environment variables used by bb-start.sh +ENV IMAGE_NAME=autotools +ENV CCACHE_LIBDIR=/usr/lib/ccache + +# Put bb-start.sh script in homedir and make it executable +RUN wget -O /home/builder/bb-start.sh \ + 'https://sourceware.org/cgit/builder/plain/builder/containers/bb-start.sh' \ + && chmod 755 /home/builder/bb-start.sh + +# And now run the script +USER builder +WORKDIR /home/builder +ENTRYPOINT /home/builder/bb-start.sh diff --git a/builder/containers/autoregen.py b/builder/containers/autoregen.py new file mode 100755 index 0000000..4ebf445 --- /dev/null +++ b/builder/containers/autoregen.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 + +import os +import subprocess +from pathlib import Path + +AUTOCONF_BIN = 'autoconf-2.69' +AUTOMAKE_BIN = 'automake-1.15.1' +ACLOCAL_BIN = 'aclocal-1.15.1' +AUTOHEADER_BIN = 'autoheader-2.69' + +ENV = f'AUTOCONF={AUTOCONF_BIN} ACLOCAL={ACLOCAL_BIN} AUTOMAKE={AUTOMAKE_BIN}' + +config_folders = [] + +for root, _, files in os.walk('.'): + for file in files: + if file == 'configure': + config_folders.append(Path(root).resolve()) + +for folder in sorted(config_folders): + print(folder, flush=True) + os.chdir(folder) + configure_lines = open('configure.ac').read().splitlines() + if 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') + # 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') + subprocess.check_output(f'{ENV} {AUTOCONF_BIN} -f', shell=True, encoding='utf8') + diff --git a/builder/master.cfg b/builder/master.cfg index 32a3653..d92fcfe 100644 --- a/builder/master.cfg +++ b/builder/master.cfg @@ -942,6 +942,7 @@ gcc_build_scheduler = schedulers.SingleBranchScheduler( reason="gcc project master branch update", builderNames=["gcc-fedora-x86_64", "gcc-fedora-mingw", + "gcc-autoregen", "gcc-debian-arm64", "gcc-gentoo-sparc", "gcc-rawhide-x86_64", @@ -3383,6 +3384,16 @@ gcc_build_make_clean_step = steps.ShellCommand( command=["make", "clean"], name="make clean") +gcc_autoregen_step = steps.ShellCommand( + command="autoregen.py", + name="autoregen.py", + haltOnFailure=True) + +gcc_git_diff_step = steps.ShellCommand( + command=['git', 'diff', '--exit-code'], + name="git diff", + haltOnFailure=True) + gcc_factory = util.BuildFactory() gcc_factory.addStep(gcc_git_step) gcc_factory.addStep(steps.Configure( @@ -3428,6 +3439,21 @@ gcc_build_factory.addStep(steps.Compile( haltOnFailure=True)) gcc_build_factory.addStep(gcc_rm_build_step) +gcc_autoregen_factory = util.BuildFactory() +gcc_autoregen_factory.addStep(gcc_git_step) +gcc_autoregen_factory.addStep(gcc_autoregen_step) +gcc_autoregen_factory.addStep(gcc_git_diff_step) + +gcc_autoregen_builder = util.BuilderConfig( + name="gcc-autoregen", + collapseRequests=True, + properties={'container-file': + readContainerFile('autotools')}, + workernames=vm_workers, + tags=["gcc-autotools", "debian"], + factory=gcc_autoregen_factory) +c['builders'].append(gcc_autoregen_builder) + gcc_mingw_factory = util.BuildFactory() gcc_mingw_factory.addStep(gcc_build_git_step) gcc_mingw_factory.addStep(gcc_rm_build_step) -- 2.39.3