From patchwork Wed Jan 27 10:41:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 41826 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 91D623959E4B; Wed, 27 Jan 2021 10:42:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 91D623959E4B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1611744132; bh=C1yZsKeGLSZjxPSxEKqAJDzxaw3Pt6WLk1ovBxovOhU=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Help: List-Subscribe:From:Reply-To:From; b=TZ67b2HPEuYIMwMoP/exHVZOI6dNEtNW12WgXq5qIz4Z+oxMuyUyz7yvSIaa1qBCv 0eWlbmEkByqB6AT0o0xH83+hy0+lEa+qgDu2/+Lhcwzfn4yAcApjLquzeju7gNfVsp GX3w55IzBGIrAIrQIog3p7EvQHTgPOB1Xar5BuwA= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id A0D313953422 for ; Wed, 27 Jan 2021 10:42:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A0D313953422 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-188-8arcpnZqNaS3bKIVacX_Ew-1; Wed, 27 Jan 2021 05:42:07 -0500 X-MC-Unique: 8arcpnZqNaS3bKIVacX_Ew-1 Received: by mail-wm1-f69.google.com with SMTP id s10so672444wme.8 for ; Wed, 27 Jan 2021 02:42:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:organization:date:message-id :user-agent:mime-version; bh=C1yZsKeGLSZjxPSxEKqAJDzxaw3Pt6WLk1ovBxovOhU=; b=entldBt6fbaINWn7gSXp3jC5mhDzoe1hevM9XPnp7UhkUSJB3QOXg/0YGiVYLXA+to gK3Iu6fiKoNpLRmtv0gYh+aaesspc48OLJY1oXBAEoBRbsTrTY3hyyYmcvX/BWP+o+Fw knFuOkawMSiuA7oWu3jk08QXbj9SfgNrdFPrXkGmvPvUcoeoVSxgGA7VXIzh97kegQn/ oE9PR3yaVFpfXoEFA7mjGyCXqdskSLORpdpwgwt4Ah2zuqR1MhXJEWCuRWJYFReheDSg Kt+ImxN3Ph46mZf/DSIJekc200/vcc813PXYxJvFB4JmOHSKjo/fiIIsEciBY39Wxl7P N4CQ== X-Gm-Message-State: AOAM531JhMnnkSpOmVotXLG0H/jtlK+uX3LMnU7e2y/YMIu/hytjaprM WM/3oIbAyipA7TwM6O4ry3uFP6CbIrmml7L+UhsplR16HjLF7uWaH69RbaNJYZptxOIPiIDcwhs bxSxBS/sCBTpP23KEURfUYHhcuFbSMNQXIVGwy10eAZZOR9Sc82D8yF9xt9IFx7KRyA2r X-Received: by 2002:a05:6000:1542:: with SMTP id 2mr10591938wry.356.1611744125789; Wed, 27 Jan 2021 02:42:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJxiE/EzTzyg9pdMH053bm70fJQF0UiQeBtfnKQsBTlhbNz/8twZ1DDTamwRKkOky1IoH6j4+Q== X-Received: by 2002:a05:6000:1542:: with SMTP id 2mr10591915wry.356.1611744125472; Wed, 27 Jan 2021 02:42:05 -0800 (PST) Received: from localhost (91-166-131-65.subs.proxad.net. [91.166.131.65]) by smtp.gmail.com with ESMTPSA id g9sm8533892wmh.3.2021.01.27.02.42.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jan 2021 02:42:04 -0800 (PST) Received: by localhost (Postfix, from userid 1000) id DE3BE581CAC; Wed, 27 Jan 2021 11:41:52 +0100 (CET) To: libabigail@sourceware.org Subject: [PATCH] Bug 27255 - fedabipkgdiff fails on nfs-utils on Fedora 33 Organization: Red Hat / France X-Operating-System: Fedora 34 X-URL: http://www.redhat.com Date: Wed, 27 Jan 2021 11:41:52 +0100 Message-ID: <877dnyhdan.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-Patchwork-Original-From: Dodji Seketeli via Libabigail From: Dodji Seketeli Reply-To: Dodji Seketeli Errors-To: libabigail-bounces@sourceware.org Sender: "Libabigail" Hello, When running fedabipkgdiff as: fedabipkgdiff --self-compare -a --from fc33 nfs-utils I am getting: Error encountered while running fedabipkgdiff with error message: Running it with the --verbose option yields more clue, though. It turns out that fedabipkgdiff runs abipkgdiff on an RPM and gives it the wrong associated -debuginfo RPM. This is because the member function RPMCollection.get_sibling_debuginfo() doesn't returns the "first" debuginfo package that comes with a given RPM. In the case of the package nfs-utils-2.5.2-1.rc4.fc33.aarch64.rpm, it was using the package nfs-utils-coreos-debuginfo-2.5.2-1.rc4.fc33.aarch64.rpm instead of the package nfs-utils-debuginfo-2.5.2-1.rc4.fc33.aarch64.rpm. So, of course, abipkgdiff could not find the proper debuginfo for the binaries carried by nfs-utils-2.5.2-1.rc4.fc33.aarch64.rpm. This happens only in cases where there a several debuginfo packages for a given RPM. In that case, we need to be more careful to select the right debuginfo package and not just a random one. This patch adds a RPMCollection.get_matching_debuginfo() member function that does the right thing. It thus teaches generate_comparison_halves() to use the new function. * tools/fedabipkgdiff (RPMCollection::get_sibling_debuginfo): Update comment. (RPMCollection::get_matching_debuginfo): Define new function. (generate_comparison_halves): Use RPMCollection::get_matching_debuginfo instead of RPMCollection::get_sibling_debuginfo. Signed-off-by: Dodji Seketeli --- tools/fedabipkgdiff | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/tools/fedabipkgdiff b/tools/fedabipkgdiff index ea303a02..89cbd15c 100755 --- a/tools/fedabipkgdiff +++ b/tools/fedabipkgdiff @@ -514,11 +514,32 @@ class RPMCollection(object): yield _rpm def get_sibling_debuginfo(self, rpm): - """Get sibling debuginfo package of given rpm""" + """Get sibling debuginfo package of given rpm + + The sibling debuginfo is a debug info package for the + 'rpm'. Note that if there are several debuginfo packages + associated to 'rpm' and users want to get the one which name + matches exactly 'rpm', then they might want to use the member + function 'get_matching_debuginfo' instead. + + """ if rpm.arch not in self.ancillary_rpms: return None return self.ancillary_rpms[rpm.arch].get('debuginfo') + def get_matching_debuginfo(self, rpm): + """Get the debuginfo package that matches a given one """ + all_debuginfo_list = self.get_all_debuginfo_rpms(rpm) + debuginfo_pkg = None + for d in all_debuginfo_list: + if d.name == '{0}-debuginfo'.format(rpm.name): + debuginfo_pkg = d + break + if not debuginfo_pkg: + debuginfo_pkg = self.get_sibling_debuginfo(rpm) + + return debuginfo_pkg + def get_sibling_devel(self, rpm): """Get sibling devel package of given rpm""" if rpm.arch not in self.ancillary_rpms: @@ -578,8 +599,7 @@ def generate_comparison_halves(rpm_col1, rpm_col2): if _rpm.is_devel: debuginfo_list1 = rpm_col1.get_all_debuginfo_rpms(_rpm) else: - debuginfo_list1.append(rpm_col1.get_sibling_debuginfo(_rpm)) - + debuginfo_list1.append(rpm_col1.get_matching_debuginfo(_rpm)) devel1 = rpm_col1.get_sibling_devel(_rpm) @@ -590,7 +610,7 @@ def generate_comparison_halves(rpm_col1, rpm_col2): if rpm2.is_devel: debuginfo_list2 = rpm_col2.get_all_debuginfo_rpms(rpm2) else: - debuginfo_list2.append(rpm_col2.get_sibling_debuginfo(rpm2)) + debuginfo_list2.append(rpm_col2.get_matching_debuginfo(rpm2)) devel2 = rpm_col2.get_sibling_devel(rpm2) yield (ComparisonHalf(subject=_rpm,