public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: libabigail@sourceware.org, Dodji Seketeli <dodji@redhat.com>
Cc: Thomas Schwinge <thomas@codesourcery.com>
Subject: [PATCH] configure: Tune fedabipkgdiff dependencies detection
Date: Sat, 11 Dec 2021 19:18:52 +0100	[thread overview]
Message-ID: <20211211181852.959428-1-thomas@codesourcery.com> (raw)

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 "<string>", line 3, in <module>
      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 "<string>", line 3, in <module>
      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 "<string>", line 3, in <module>
      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 <thomas@codesourcery.com>
---
 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)
-- 
2.25.1


             reply	other threads:[~2021-12-11 18:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-11 18:18 Thomas Schwinge [this message]
2021-12-17 19:10 ` Dodji Seketeli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211211181852.959428-1-thomas@codesourcery.com \
    --to=thomas@codesourcery.com \
    --cc=dodji@redhat.com \
    --cc=libabigail@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).