From patchwork Sat Dec 11 18:18:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 48832 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 636AD3857811 for ; Sat, 11 Dec 2021 18:19:20 +0000 (GMT) X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from smtprelay03.ispgateway.de (smtprelay03.ispgateway.de [80.67.18.15]) by sourceware.org (Postfix) with ESMTPS id 847BF3858D39 for ; Sat, 11 Dec 2021 18:19:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 847BF3858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=schwinge.name Received: from [192.94.31.2] (helo=dem-tschwing-1.ger.mentorg.com) by smtprelay03.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mw6xm-0000oc-Fl; Sat, 11 Dec 2021 19:19:14 +0100 Received: (nullmailer pid 959512 invoked by uid 1000); Sat, 11 Dec 2021 18:19:11 -0000 From: Thomas Schwinge To: libabigail@sourceware.org, Dodji Seketeli Subject: [PATCH] configure: Tune fedabipkgdiff dependencies detection Date: Sat, 11 Dec 2021 19:18:52 +0100 Message-Id: <20211211181852.959428-1-thomas@codesourcery.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Df-Sender: b3V0Z29pbmdAc2Nod2luZ2UubmFtZQ== X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , Cc: Thomas Schwinge Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" If 'configure' finds some Python koji module, but it's "insufficient" per the testing once added in commit 90d236a03343d75ea504d53c73270e50b9000e75 "Bug 22076 - Disable fedabipkgdiff for old koji clients", we currently get, for example: [...] checking python3 module: koji... yes [...] checking checking if koji client is recent enough ...... Traceback (most recent call last): File "", line 3, in File "[...]/koji/__init__.py", line 2016, in read_config raise ConfigurationError("no configuration for profile name: %s" koji.ConfigurationError: no configuration for profile name: koji no, disabling fedpkgdiff [...] Here is the configuration of the package: [...] Enable fedabipkgdiff : auto [...] Note repeated 'checking' and '...', intermixed error output, 'fedpkgdiff' typo, final 'auto' result. Changing that to: [...] checking if koji client is recent enough... no configure: WARNING: disabling fedabipkgdiff [...] Here is the configuration of the package: [...] Enable fedabipkgdiff : no [...] ... with 'config.log': [...] configure:13774: checking if koji client is recent enough configure:13784: result: no Traceback (most recent call last): File "", line 3, in File "[...]/koji/__init__.py", line 2016, in read_config raise ConfigurationError("no configuration for profile name: %s" koji.ConfigurationError: no configuration for profile name: koji configure:13792: WARNING: disabling fedabipkgdiff [...] Similarly, with explicit '--enable-fedabipkgdiff', we currently get: [...] checking checking if koji client is recent enough ...... Traceback (most recent call last): File "", line 3, in File "[...]/koji/__init__.py", line 2016, in read_config raise ConfigurationError("no configuration for profile name: %s" koji.ConfigurationError: no configuration for profile name: koji no, disabling fedpkgdiff [...] Here is the configuration of the package: [...] Enable fedabipkgdiff : yes [...] ... instead of a fatal error. Changing that to: [...] checking if koji client is recent enough... no configure: error: unsuitable koji client * configure.ac: Tune fedabipkgdiff dependencies detection. Signed-off-by: Thomas Schwinge --- configure.ac | 79 ++++++++++++++++++++++++++-------------------------- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git configure.ac configure.ac index a77ab4d8..40f57ed9 100644 --- configure.ac +++ configure.ac @@ -533,11 +533,10 @@ if test x$CHECK_DEPS_FOR_FEDABIPKGDIFF = xyes; then AC_PATH_PROG(WGET, wget, no) if test x$WGET = xno; then - ENABLE_FEDABIPKGDIFF=no + MISSING_FEDABIPKGDIFF_DEP=yes if test x$MISSING_FEDABIPKGDIFF_DEP_FATAL = xyes; then AC_MSG_ERROR(could not find the wget program) else - MISSING_FEDABIPKGDIFF_DEP=yes AC_MSG_NOTICE([could not find the wget program]) AC_MSG_NOTICE([disabling fedabipkgdiff as a result]) fi @@ -567,48 +566,50 @@ if test x$CHECK_DEPS_FOR_FEDABIPKGDIFF = xyes; then argparse logging os re subprocess sys $URLPARSE_MODULE \ xdg koji mock rpm imp tempfile mimetypes shutil six" - if test x$ENABLE_FEDABIPKGDIFF != xno; then - AX_CHECK_PYTHON_MODULES([$REQUIRED_PYTHON_MODULES_FOR_FEDABIPKGDIFF], - [$PYTHON], - [FOUND_ALL_PYTHON_MODULES=yes], - [FOUND_ALL_PYTHON_MODULES=no]) - - if test x$FOUND_ALL_PYTHON_MODULES = xno; then - MISSING_FEDABIPKGDIFF_DEP=yes - if test x$MISSING_FEDABIPKGDIFF_DEP_FATAL = xyes; then - AC_MSG_ERROR([missing python modules: $MISSING_PYTHON_MODULES]); - else - AC_MSG_NOTICE([missing python modules: $MISSING_PYTHON_MODULES]) - AC_MSG_NOTICE([disabling fedabipkgdiff as a result]) - fi - ENABLE_FEDABIPKGDIFF=no + AX_CHECK_PYTHON_MODULES([$REQUIRED_PYTHON_MODULES_FOR_FEDABIPKGDIFF], + [$PYTHON], + [FOUND_ALL_PYTHON_MODULES=yes], + [FOUND_ALL_PYTHON_MODULES=no]) + + if test x$FOUND_ALL_PYTHON_MODULES = xno; then + MISSING_FEDABIPKGDIFF_DEP=yes + if test x$MISSING_FEDABIPKGDIFF_DEP_FATAL = xyes; then + AC_MSG_ERROR([missing python modules: $MISSING_PYTHON_MODULES]); else - # On some old platforms, the koji client object doesn't have - # the required .read_config method. Alas, that module doesn't - # have any __version__ string either. So we do as well as we - # can to try and detect that case and disable fedabipkgdiff if - # necessary. - AC_MSG_CHECKING([checking if koji client is recent enough ...]) - $PYTHON -c " + AC_MSG_NOTICE([missing python modules: $MISSING_PYTHON_MODULES]) + AC_MSG_NOTICE([disabling fedabipkgdiff as a result]) + fi + else + # On some old platforms, the koji client object doesn't have + # the required .read_config method. Alas, that module doesn't + # have any __version__ string either. So we do as well as we + # can to try and detect that case and disable fedabipkgdiff if + # necessary. + AC_MSG_CHECKING([if koji client is recent enough]) + $PYTHON 2>&AS_MESSAGE_LOG_FD -c " import koji koji.read_config('koji')" - if test $? -eq 0; then - koji_version_check_ok=yes - else - koji_version_check_ok=no - fi - - if test x$koji_version_check_ok = xno; then - AC_MSG_RESULT([no, disabling fedpkgdiff]) - MISSING_FEDABIPKGDIFF_DEP=yes - else - AC_MSG_RESULT(yes) - fi - if test x$MISSING_FEDABIPKGDIFF_DEP = xno; then - ENABLE_FEDABIPKGDIFF=yes - fi + if test $? -eq 0; then + koji_version_check_ok=yes + else + koji_version_check_ok=no + fi + AC_MSG_RESULT([$koji_version_check_ok]) + if test x$koji_version_check_ok = xno; then + MISSING_FEDABIPKGDIFF_DEP=yes + if test x$MISSING_FEDABIPKGDIFF_DEP_FATAL = xyes; then + AC_MSG_ERROR([unsuitable koji client]) + else + AC_MSG_WARN([disabling fedabipkgdiff]) + fi fi fi + + if test x$MISSING_FEDABIPKGDIFF_DEP = xno; then + ENABLE_FEDABIPKGDIFF=yes + else + ENABLE_FEDABIPKGDIFF=no + fi fi AM_CONDITIONAL(ENABLE_FEDABIPKGDIFF, test x$ENABLE_FEDABIPKGDIFF = xyes)