From patchwork Wed Oct 23 13:13:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Wielaard X-Patchwork-Id: 99435 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 C899E385841E for ; Wed, 23 Oct 2024 13:13:32 +0000 (GMT) X-Original-To: elfutils-devel@sourceware.org Delivered-To: elfutils-devel@sourceware.org Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 9029A385840E for ; Wed, 23 Oct 2024 13:13:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9029A385840E 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 9029A385840E 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=1729689200; cv=none; b=cC6ao/tKxCn+8EjFpbR7RrD4mZVf4d1ekqRxYogEMttXMstw8zx5/B7BQ7q4adDXsl5B0fDwECV+N4Ki69PrPIN0g/PIO5Yut5PX71Ae/JCZjGcZL77wl1GyuCtCxz8enQ0V+EZXGT1PHiH1I65wWGD/+HdWS/1g/9jynLTjrp0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729689200; c=relaxed/simple; bh=q3t9T7vucqDYj2B9bdwuWvNmoXNDRUo2JZ18UE5Ro4o=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=SY7tN4KYsScQLyRq71yt2FhvyLwlge192xYWH2wnWvBCl3EByTEOK1etW4OUtw6YuxdTP89i3CHzxfi0y1y0xq0BGJdFSoUtdI2MHX0lOrD2+axikoPMjy4nHdS0NuKHQRB6V5sXG+7lcFAjWbcSJhR5lB981WimkCHceK4jk1w= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from r6.localdomain (82-217-174-174.cable.dynamic.v4.ziggo.nl [82.217.174.174]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 19C353032F85; Wed, 23 Oct 2024 15:13:14 +0200 (CEST) Received: by r6.localdomain (Postfix, from userid 1000) id AA56A3406B9; Wed, 23 Oct 2024 15:13:13 +0200 (CEST) From: Mark Wielaard To: elfutils-devel@sourceware.org Cc: Mark Wielaard Subject: [PATCH v2] configure: better error message for [lib]debuginfod missing dependencies Date: Wed, 23 Oct 2024 15:13:06 +0200 Message-ID: <20241023131306.1926797-1-mark@klomp.org> X-Mailer: git-send-email 2.47.0 MIME-Version: 1.0 X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: elfutils-devel-bounces~patchwork=sourceware.org@sourceware.org When dependencies for libdebuginfod, debuginfod or ima verification are missing and these features are explicitly enabled the user might not immediately know which of the dependicies are missing. Move the checks around a little so checks for dependencies are done immediately before the enable error message. And add the possible reason to the error to make things more clear. * configure.ac: Move libcurl and json-c tests before libdebuginfod check, move libmicrohttpd, sqlite3 and libarchive tests before debuginfod check and move librpm, libcrypto and imaevm.h tests before ima verification check. https://sourceware.org/bugzilla/show_bug.cgi?id=32294 Signed-off-by: Mark Wielaard --- configure.ac | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/configure.ac b/configure.ac index f191488f9402..072bd4e226d1 100644 --- a/configure.ac +++ b/configure.ac @@ -837,16 +837,7 @@ AC_ARG_ENABLE([debuginfod-ima-verification],[AS_HELP_STRING([--enable-debuginfod # Look for various packages, minimum versions as per rhel7. PKG_PROG_PKG_CONFIG PKG_CHECK_MODULES([libcurl],[libcurl >= 7.29.0],[have_libcurl=yes],[have_libcurl=no]) -AC_CHECK_LIB(pthread, pthread_setname_np, [AC_DEFINE([HAVE_PTHREAD_SETNAME_NP],[1],[Enable pthread_setname_np])]) PKG_CHECK_MODULES([jsonc],[json-c >= 0.11],[have_jsonc=yes],[have_jsonc=no]) -PKG_CHECK_MODULES([libmicrohttpd],[libmicrohttpd >= 0.9.33],[],[enable_debuginfod=no]) -PKG_CHECK_MODULES([oldlibmicrohttpd],[libmicrohttpd < 0.9.51],[old_libmicrohttpd=yes],[old_libmicrohttpd=no]) -PKG_CHECK_MODULES([sqlite3],[sqlite3 >= 3.7.17],[have_sqlite3=yes],[have_sqlite3=no]) -PKG_CHECK_MODULES([libarchive],[libarchive >= 3.1.2],[have_libarchive=yes],[have_libarchive=no]) -AC_CHECK_LIB(rpm, headerGet, [AC_CHECK_DECL(RPMSIGTAG_FILESIGNATURES, - [AC_SUBST(rpm_LIBS, '-lrpm -lrpmio')],[], [#include ])]) -AC_CHECK_LIB(crypto, EVP_MD_CTX_new, [AC_SUBST(crypto_LIBS, '-lcrypto')]) -AC_CHECK_HEADER(imaevm.h) # # pronounce judgement on ability to build client, overridden by =yes/=no if test "x$enable_libdebuginfod" = "xno"; then @@ -855,11 +846,15 @@ elif test "x$enable_libdebuginfod" = "xdummy"; then true elif test "x$have_jsonc$have_libcurl" = "xyesyes"; then enable_libdebuginfod=yes -elif test "x$enable_libdebuginfod" = "xyes" -o "x$enable_libdebuginfod" = "xdummy"; then - AC_MSG_ERROR([unable to build libdebuginfod]) +elif test "x$enable_libdebuginfod" = "xyes"; then + AC_MSG_ERROR([unable to build libdebuginfod, missing libjson-c or libcurl]) else enable_libdebuginfod=no fi +PKG_CHECK_MODULES([libmicrohttpd],[libmicrohttpd >= 0.9.33],[],[enable_debuginfod=no]) +PKG_CHECK_MODULES([oldlibmicrohttpd],[libmicrohttpd < 0.9.51],[old_libmicrohttpd=yes],[old_libmicrohttpd=no]) +PKG_CHECK_MODULES([sqlite3],[sqlite3 >= 3.7.17],[have_sqlite3=yes],[have_sqlite3=no]) +PKG_CHECK_MODULES([libarchive],[libarchive >= 3.1.2],[have_libarchive=yes],[have_libarchive=no]) # # pronounce judgement on ability to build server, overridden by =yes/=no if test "x$enable_debuginfod" = "xno"; then @@ -867,18 +862,22 @@ if test "x$enable_debuginfod" = "xno"; then elif test "x$have_jsonc$HAVE_CXX11$have_libarchive$have_sqlite3" = "xyesyesyesyes"; then enable_debuginfod=yes elif test "x$enable_debuginfod" = "xyes"; then - AC_MSG_ERROR([unable to build debuginfod]) + AC_MSG_ERROR([unable to build debuginfod, missing libmicrohttpd, sqlite3 or libarchive]) else enable_debuginfod=no fi # +AC_CHECK_LIB(rpm, headerGet, [AC_CHECK_DECL(RPMSIGTAG_FILESIGNATURES, + [AC_SUBST(rpm_LIBS, '-lrpm -lrpmio')],[], [#include ])]) +AC_CHECK_LIB(crypto, EVP_MD_CTX_new, [AC_SUBST(crypto_LIBS, '-lcrypto')]) +AC_CHECK_HEADER(imaevm.h) # pronounce judgment on ima signature support if test "x$enable_debuginfod_ima_verification" = "xno"; then true elif test "x$ac_cv_lib_rpm_headerGet$ac_cv_have_decl_RPMSIGTAG_FILESIGNATURES$ac_cv_lib_crypto_EVP_MD_CTX_new$ac_cv_header_imaevm_h" = "xyesyesyesyes"; then enable_debuginfod_ima_verification=yes elif test "x$enable_debuginfod_ima_verification" = "xyes"; then - AC_MSG_ERROR([unable to enable debuginfod ima verification]) + AC_MSG_ERROR([unable to enable ima verification, missing librpm, libcrypto or imaevm.h]) else enable_debuginfod_ima_verification=no fi @@ -895,6 +894,8 @@ AS_IF([test "x$have_libarchive" = "xyes"],AC_DEFINE([HAVE_LIBARCHIVE],[1],[Defin AM_CONDITIONAL([ENABLE_IMA_VERIFICATION],[test "$enable_debuginfod_ima_verification" = "xyes"]) AM_CONDITIONAL([OLD_LIBMICROHTTPD],[test "x$old_libmicrohttpd" = "xyes"]) +AC_CHECK_LIB(pthread, pthread_setname_np, [AC_DEFINE([HAVE_PTHREAD_SETNAME_NP],[1],[Enable pthread_setname_np])]) + dnl for /etc/profile.d/elfutils.{csh,sh} default_debuginfod_urls="" AC_ARG_ENABLE(debuginfod-urls,