From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 18C893858D39 for ; Sat, 2 Mar 2024 06:03:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 18C893858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 18C893858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:ea4a:1:5054:ff:fec7:86e4 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709359397; cv=none; b=WXTrTT/zHEEuFo7JiAE1ltcCd4hWoQyLs0dWr5WIgD+KbIQ8syAHhjFBvctMCmWoozPoOgWSxdDBJpopO8lhr9mZzDGyWCKJjqbmj8RowhuebY9IGGQWJxspG9mzB/C0Ups/szrClh0nriGYp8J3EIWT1c3UgunvKbbRsP6/lq4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709359397; c=relaxed/simple; bh=CSoTx5GFt65kzKBp0LP18ILARaMERRVq8tQXS+giujc=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=GyTUivwiioUfOFcqow6ibNjyfids4nMT9GeM0HBXjZ0jsvuaPiRmtao+kGeyPg4OzThepAhlueYLHm0Cuy/fUpGzZnzlnMYaWlXnZROIotId5hRH84NPorO+JFKn0rlbEoKNLNrpnBnRBTXlzzVIXgNs+ACdKXmzJfBTvI6tpRY= ARC-Authentication-Results: i=1; server2.sourceware.org From: Sam James To: buildbot@sourceware.org Cc: arsen@gentoo.org, Sam James Subject: [PATCH v2 1/2] autoregen.py: adapt to Gentoo Date: Sat, 2 Mar 2024 06:02:19 +0000 Message-ID: <20240302060309.1002512-1-sam@gentoo.org> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,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: In Gentoo, we have autoconf-vanilla and automake-vanilla packaged for toolchain development with no patches applied. The binaries are named differently. Adapt the script to check a list of binaries for each tool, and check the vanilla names first as we want to prefer those if they exist. This makes the script work out-of-the-box on Gentoo. Signed-off-by: Sam James --- mjw, could you double check this does the right thing for you on your systems? It should be OK as I've checked with a few combinations. v2: - Set WANT_{AUTOCONF,AUTOMAKE} environment variables for Gentoo's wrappers. - Add some style tweaks in patch 2. builder/containers/autoregen.py | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/builder/containers/autoregen.py b/builder/containers/autoregen.py index bfb8f3d..f33fb78 100755 --- a/builder/containers/autoregen.py +++ b/builder/containers/autoregen.py @@ -1,15 +1,32 @@ #!/usr/bin/env python3 import os +import shutil 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' +# On Gentoo, vanilla unpatched autotools are packaged separately. +# We place the vanilla names first as we want to prefer those if both exist. +autoconf_names = ['autoconf-vanilla-2.69', 'autoconf-2.69'] +automake_names = ['automake-vanilla-1.15', 'automake-1.15.1'] +aclocal_names = ['aclocal-vanilla-1.15', 'aclocal-1.15.1'] +autoheader_names = ['autoheader-vanilla-2.69', 'autoheader-2.69'] + +# 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)) + +# autoconf-wrapper and automake-wrapper from Gentoo look at this environment variable. +# It's harmless to set it on other systems though. +ENV = f'WANT_AUTOCONF={AUTOCONF_BIN.split("-", 1)[1]} ' +ENV += f'WANT_AUTOMAKE={AUTOMAKE_BIN.split("-", 1)[1]} ' + +ENV += f' AUTOCONF={AUTOCONF_BIN} ' +ENV += f' ACLOCAL={ACLOCAL_BIN} ' +ENV += f' AUTOMAKE={AUTOMAKE_BIN}' -ENV = f'AUTOCONF={AUTOCONF_BIN} ACLOCAL={ACLOCAL_BIN} AUTOMAKE={AUTOMAKE_BIN}' config_folders = [] -- 2.44.0