From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4DC16384AB56; Fri, 26 Apr 2024 08:44:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4DC16384AB56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1714121094; bh=nKQhz+h8Y8BnVcIx3S1agmjMO5VOHQe8s4EpL9UgSv0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HDDqhExGMAuIIQDAi2CZHzU9AgmST+m7i6NxGUE4aNJu1j+yJOgiY5Krf3d2t1PV0 nPIKN8PIaxAHcEhR10SBVRfC21wfEWnceykZ/tMZH5/PEVdhQzRvFxaIEsCPXgjkg8 9dpsHh0blwE1H/txnA5C1CkRv5TUrUJrGPIDhzEo= From: "dodji at seketeli dot org" To: libabigail@sourceware.org Subject: [Bug default/31672] abidb: make libarchive a soft dependency Date: Fri, 26 Apr 2024 08:44:53 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: libabigail X-Bugzilla-Component: default X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dodji at seketeli dot org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31672 --- Comment #2 from Dodji Seketeli --- Hello, "fche at redhat dot com" a =C3=A9crit: [...] > --- Comment #1 from Frank Ch. Eigler --- > Created attachment 15479 > --> https://sourceware.org/bugzilla/attachment.cgi?id=3D15479&action=3D= edit > proposed patch Thanks for the patch! I have massaged it to add some more logging and such. I came up with the potential commit below that is currently running through the build bots. OK to apply if it passes tests? >From 3810dbe6efd487c9712c87371265e41eacc6106e Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Fri, 26 Apr 2024 10:30:42 +0200 Subject: [PATCH] configure,abidb: Make the libarchive python module optional for abidb Some distributions don't have the libarchive python module packaged. This patch makes that module optional and enables abidb to function without it, as it's only necessary for the support of the '--archive' command line option of the abidb program. * configure.ac: Detect the libarchive python module as an optional dependency for the abidb program. So far, only the git python module remains a hard dependency. * tools/abidb (main): Do not support the '--archive' command line option if the libarchive python module is not present. Signed-off-by: Dodji Seketeli --- configure.ac | 15 +++++++++++++-- tools/abidb | 14 ++++++++++---- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index a86f81d0..c6e1ad64 100644 --- a/configure.ac +++ b/configure.ac @@ -824,16 +824,27 @@ fi dnl abidb checks if test x$PYTHON3_INTERPRETER !=3D xno -a x$ENABLE_ABIDB !=3D xno; then - AX_CHECK_PYTHON_MODULES([git libarchive], + AX_CHECK_PYTHON_MODULES([git], [$PYTHON], [FOUND_ALL_PYTHON_MODULES=3Dyes], [FOUND_ALL_PYTHON_MODULES=3Dno]) if test x$FOUND_ALL_PYTHON_MODULES =3D xno; then AC_MSG_NOTICE([missing python modules: $MISSING_PYTHON_MODULES]) - AC_MSG_NOTICE([disabling abidb as a result]) + AC_MSG_WARN([disabling abidb as a result]) + ENABLE_ABIDB=3Dno else ENABLE_ABIDB=3Dyes + dnl search for optional modules, just for autoconf reporting purposes + AX_CHECK_PYTHON_MODULES([libarchive], + [$PYTHON], + [FOUND_ALL_OPTIONAL_PYTHON_MODULES=3Dyes], + [FOUND_ALL_OPTIONAL_PYTHON_MODULES=3Dno]) + if test x$FOUND_ALL_OPTIONAL_PYTHON_MODULES =3D xno; then + AC_MSG_WARN([missing optional python modules for abidb: $MISSING_PYTHON_MODULES]) + else + AC_MSG_NOTICE([found all optional python modules for abidb]) + fi fi else AC_MSG_NOTICE([disabling abidb]) diff --git a/tools/abidb b/tools/abidb index a3f6850f..789b117f 100755 --- a/tools/abidb +++ b/tools/abidb @@ -23,7 +23,11 @@ import re import ast import os import glob -import libarchive +try: + import libarchive + enable_libarchive=3DTrue +except: + enable_libarchive=3DFalse # globals @@ -156,9 +160,10 @@ def main() -> list[str]: parser.add_argument('--timeout',type=3Dint,help=3D'limit abidw/abicomp= at runtime (seconds)',default=3D0) parser.add_argument('--submit',nargs=3D'*',type=3Dstr,default=3D[], help=3D'submit abidw of given binaries to abidb') - parser.add_argument('--archive','-Z',metavar=3D'EXT=3DCMD', - type=3Dstr,help=3D'submit binaries from archives w= ith given extension & decoder', - default=3D[],action=3D'append') # like debuginfod(= 8) + if enable_libarchive: + parser.add_argument('--archive','-Z',metavar=3D'EXT=3DCMD', + type=3Dstr,help=3D'submit binaries from archiv= es with given extension & decoder', + default=3D[],action=3D'append') # like debugin= fod(8) parser.add_argument('--sysroot',type=3Dstr,help=3D'remove given sysroo= t prefix from submitted file names',default=3DNone) parser.add_argument('--filter',type=3Dstr,help=3D'submit only binaries matching given wildcard',default=3Dr'/lib.*\.so') # sub-version suffixes wi= ll be flattened into SONAME # --sysroot=3DPATH subtract this from SUBMIT paths @@ -230,6 +235,7 @@ def main() -> list[str]: ln =3D submit yield (None, ln, pn) # must be a plain file # XXX or ldconfig-created symlink, ugh else: # an archive! + assert enable_libarchive cmd =3D ra[ext] if (cmd =3D=3D "cat"): # short-circuit this with libarchive.file_reader(submit) as archive: --=20 You are receiving this mail because: You are on the CC list for the bug.=