From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id B0DC83858D35 for ; Fri, 17 Dec 2021 09:28:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B0DC83858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: uBIHSABjTesLyj56bew+e/ZNSLYHuNJvAP+wQnYSGXCboqXGR+FVZrDZvaxuRxfaLumWRhNHIM eHHbgc9UuvlD0eZYOe4g9j4bAz5YZydg2m+gUfi+7Zr4/vYQ+Mzculc1pyI9NdVVprteqKnpA7 NT7nAsul7Op/GcBg/pYrVsuKiZUXzmrjZ8da3DT8gD4QCY8kiB6it1pKRsIL5+DwBes0oxqbyn aigoOz22A9JQQEW2VVxzQBiWE3/zzDfsjO9ASwSdFw5pRVDxBxwOv/cnYqp3ivp2b5aSGahfnQ t0JkXBJ/Jy/TYIXQt/h0dRox X-IronPort-AV: E=Sophos;i="5.88,213,1635235200"; d="scan'208";a="69829099" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 17 Dec 2021 01:28:22 -0800 IronPort-SDR: FYo66qapWr1Y34CtSR0Xkd89vapHiLGNuBCx9BedoyoWPWpsjjFJ5cOeSg77gcaiPBEXeZM+7n Af772tMBzmzuHGBT9OzGQVDTlKn7g4yyXSJ3W68/S+8BbwWVgeRZH0Z6l0+ZTjwdEObK52duSc bIYQad6CXC5jtaDVjaKmQiEtzyY+O+EFS+es9nA3obGox4MezlYwAMTZy6ftv8DzilXJ2XDKQ0 FAoXY0G7TI2cnendF1tJ43QlMguSIbu4oAchGU3m75DRE7aM+vxZp8SVGO8bNtVzOoiv/xK7sg 8UU= From: Thomas Schwinge To: , Dodji Seketeli Subject: Re: [PATCH] configure: Instead of for rpm 4.15+ version, test actual rpm/zstd support In-Reply-To: <20211210165246.3434933-1-thomas@codesourcery.com> References: <20211210165246.3434933-1-thomas@codesourcery.com> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/27.1 (x86_64-pc-linux-gnu) Date: Fri, 17 Dec 2021 10:28:15 +0100 Message-ID: <87ilvny40g.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-08.mgc.mentorg.com (139.181.222.8) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, 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: , X-List-Received-Date: Fri, 17 Dec 2021 09:28:29 -0000 Hi! Ping. Gr=C3=BC=C3=9Fe Thomas On 2021-12-10T17:52:46+0100, I wrote: > If no 'rpm' is available, we currently get: > > [...] > checking for rpm... no > ../git/configure: line 13119: rpm: command not found > configure: detected rpm version: > configure: rpm support in abipkgdiff is disabled > [...] > Here is the configuration of the package: > [...] > Enable rpm support in abipkgdiff : no > Enable rpm 4.15 support in abipkgdiff tests : no > [...] > > Notice intermixed error output: 'rpm: command not found'. > > If Ubuntu focal 'rpm' 4.14.2.1+dfsg1-1build2 is available, we currently g= et: > > [...] > checking for rpm... yes > configure: detected rpm version: 4.14.2.1 > configure: rpm support in abipkgdiff is enabled > configure: rpm 4.15 support in abipkgdiff tests is enabled > [...] > Here is the configuration of the package: > [...] > Enable rpm support in abipkgdiff : yes > Enable rpm 4.15 support in abipkgdiff tests : yes > [...] > > Notice wrong 4.15+ version detection (due to '[[ "$rpmversion" > "4.14.0"= ]]'), > which is satisfied by '4.14.2.1'. (Comparing versions with shell '[[' > generally is fragile; instead use 'autoconf-archive/ax_compare_version.m4= ' > or similar?) > > Also, 'configure'ing with '--disable-rpm415' doesn't work; same output as > before. That's due to commit 26c41c060bf30750fe2cded87edaf1ae47027523 > "Fix thinko in configure.ac", where either there was no thinko in fact (t= he > original idea, I suppose, was only if 'test x$ENABLE_RPM =3D xyes' to do = the > 4.15+ 'auto' checking?), and/or a typo: instead of 'test x$ENABLE_RPM =3D= xyes', > the first conditional should 'test x$ENABLE_RPM415 =3D xyes'? > > And, 'configure'ing with '--enable-rpm415' doesn't raise a hard error if = 'rpm' > actually isn't 4.15+. > > But all that said, we don't actually need to check for rpm 4.15+ version,= but > instead may simply check for the rpm/zstd support that we need: 'rpm2cpio= '. > > * configure.ac: Instead of for rpm 4.15+ version, test actual > rpm/zstd support. > * tests/test-diff-pkg.cc: Adjust. > > Signed-off-by: Thomas Schwinge > --- > configure.ac | 48 +++++++++++++++++++++++++++++------------- > tests/test-diff-pkg.cc | 5 ++--- > 2 files changed, 35 insertions(+), 18 deletions(-) > > diff --git configure.ac configure.ac > index 5342a269..a77ab4d8 100644 > --- configure.ac > +++ configure.ac > @@ -64,11 +64,12 @@ AC_ARG_ENABLE(rpm, > ENABLE_RPM=3D$enableval, > ENABLE_RPM=3Dauto) > > +# '--enable-rpm415' option name preserved for backwards compatibility. > AC_ARG_ENABLE(rpm415, > AS_HELP_STRING([--enable-rpm415=3Dyes|no|auto], > - [enable the support of rpm 4.15 or higher in a= bipkgdiff (default is auto)]), > - ENABLE_RPM415=3D$enableval, > - ENABLE_RPM415=3Dauto) > + [enable rpm/zstd in abipkgdiff testing (defaul= t is auto)]), > + ENABLE_RPM_ZSTD=3D$enableval, > + ENABLE_RPM_ZSTD=3Dauto) > > AC_ARG_ENABLE(debug-self-comparison, > AS_HELP_STRING([--enable-debug-self-comparison=3Dyes|no], > @@ -314,23 +315,40 @@ if test x$ENABLE_RPM =3D xyes -o x$ENABLE_RPM =3D x= auto; then > fi > fi > > -if test x$ENABLE_RPM =3D xyes -o x$ENABLE_RPM415 =3D xauto; then > - rpmversion=3D$(rpm --version | sed "s/RPM version //") > - AC_MSG_NOTICE([detected rpm version: $rpmversion]) > - if [[[ "$rpmversion" > "4.14.0" ]]]; then > - ENABLE_RPM415=3Dyes > - else > - ENABLE_RPM415=3Dno > - fi > +dnl Point to a rpm/zstd file, that is: > +dnl $ rpm -qp --qf '%{PAYLOADCOMPRESSOR}\n' [rpm_zstd_file] > +dnl zstd > +m4_define([rpm_zstd_file], [tests/data/test-diff-pkg/mesa-libGLU-9.0.1-3= .fc33.x86_64.rpm]) > +AC_CONFIG_SRCDIR([rpm_zstd_file]) > +if test x$ENABLE_RPM_ZSTD =3D xyes -o x$ENABLE_RPM_ZSTD =3D xauto; then > + if test x$ENABLE_RPM =3D xno; then > + if test x$ENABLE_RPM_ZSTD =3D xyes; then > + AC_MSG_ERROR([rpm/zstd support needs rpm support]) > + fi > + ENABLE_RPM_ZSTD=3Dn/a > + else > + AC_MSG_CHECKING([for rpm/zstd support]) > + rpm2cpio > /dev/null 2>&AS_MESSAGE_LOG_FD "$srcdir"/rpm_zstd_file > + if test $? -eq 0; then > + enable_rpm_zstd=3Dyes > + else > + enable_rpm_zstd=3Dno > + fi > + AC_MSG_RESULT([$enable_rpm_zstd]) > + if test x$ENABLE_RPM_ZSTD:$enable_rpm_zstd =3D xyes:no; then > + AC_MSG_ERROR([rpm/zstd support not available]) > + fi > + ENABLE_RPM_ZSTD=3D$enable_rpm_zstd > + fi > fi > > if test x$ENABLE_RPM =3D xyes; then > AC_DEFINE([WITH_RPM], 1, [compile the rpm package support in abipkgdi= ff]) > AC_MSG_NOTICE([rpm support in abipkgdiff is enabled]); > > - if test x$ENABLE_RPM415 =3D xyes; then > - AC_DEFINE([WITH_RPM_4_15], 1, [has RPM 4.15 at least]) > - AC_MSG_NOTICE([rpm 4.15 support in abipkgdiff tests is enabled]) > + if test x$ENABLE_RPM_ZSTD =3D xyes; then > + AC_DEFINE([WITH_RPM_ZSTD], 1, [has rpm/zstd support]) > + AC_MSG_NOTICE([rpm/zstd in abipkgdiff testing is enabled]) > fi > else > AC_MSG_NOTICE([rpm support in abipkgdiff is disabled]); > @@ -980,7 +998,7 @@ AC_MSG_NOTICE([ > C++ standard level : ${CXX_STANDARD} > libdw has the dwarf_getalt function : ${FOUND_DWARF_GETAL= T_IN_LIBDW} > Enable rpm support in abipkgdiff : ${ENABLE_RPM} > - Enable rpm 4.15 support in abipkgdiff tests : ${ENABLE_RPM415} > + Enable rpm/zstd in abipkgdiff testing : ${ENABLE_RPM_ZSTD} > Enable self comparison debugging : ${ENABLE_DEBUG_SELF= _COMPARISON} > Enable type canonicalization debugging : ${ENABLE_DEBUG_TYPE= _CANONICALIZATION} > Enable deb support in abipkgdiff : ${ENABLE_DEB} > diff --git tests/test-diff-pkg.cc tests/test-diff-pkg.cc > index c9e221b7..bcf2e38e 100644 > --- tests/test-diff-pkg.cc > +++ tests/test-diff-pkg.cc > @@ -605,8 +605,7 @@ static InOutSpec in_out_specs[] =3D > "data/test-diff-pkg/PR24690/PR24690-report-0.txt", > "output/test-diff-pkg/PR24690/PR24690-report-0.txt" > }, > -#if WITH_RPM_4_15 > - // This RPM version supports packages compressed with zstd. > +#if WITH_RPM_ZSTD > // RPMs from Fedora 31 onwards are compressed with zstd. > { > "data/test-diff-pkg/mesa-libGLU-9.0.1-3.fc33.x86_64.rpm", > @@ -747,7 +746,7 @@ static InOutSpec in_out_specs[] =3D > "data/test-diff-pkg/wireshark/wireshark-cli-3.4.9-1.fc36.x86_64-self= -check-report.txt", > "output/test-diff-pkg/wireshark/wireshark-cli-3.4.9-1.fc36.x86_64-se= lf-check-report.txt" > } , > -#endif // WITH_RPM_4_15 > +#endif // WITH_RPM_ZSTD > #endif //WITH_RPM > > #ifdef WITH_DEB > -- > 2.25.1 ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955