From patchwork Tue Nov 24 10:34:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 41178 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 50CA93896822; Tue, 24 Nov 2020 10:34:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 50CA93896822 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1606214087; bh=ZRaISPurl6DZAhlIKWMKVnWMJX5MKEckEsMPWgBJC60=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Help: List-Subscribe:From:Reply-To:From; b=kd78Uk+U0d9juNnqcmN8jZksd0DL7hJh010Xz8mkOOOn7/X5ovPYucxpgh81+2Le3 0J8s32H31XghOLDiiRE/8v0AnccX9fkG/jdM/gXxvu3WMB++jA3Im6cU163yaaI/gZ XJXXG2oP2+SuiZ3nMeaivsNTaLeIB54VmLSAs0Dg= 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 7BEEF3842439 for ; Tue, 24 Nov 2020 10:34:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7BEEF3842439 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-128-XN-2svMIMe6J26x7EUgDdA-1; Tue, 24 Nov 2020 05:34:43 -0500 X-MC-Unique: XN-2svMIMe6J26x7EUgDdA-1 Received: by mail-wr1-f71.google.com with SMTP id w17so1260820wrl.8 for ; Tue, 24 Nov 2020 02:34:43 -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=ZRaISPurl6DZAhlIKWMKVnWMJX5MKEckEsMPWgBJC60=; b=dPk43a6MuCp4mqYPtmVqt/h3Pl/pAzvzpcMOEU4Gu50ZE06NMVfu+Q3BCu6WFLDsy3 1Bs2DPUdKmSxuLTLJbI13/10XAd5q1wscTojkAA7TqulA6IS/9LYk0lwlwQo99rV4U6L +jd7GIDh/opGleeESNkmGt3wQHllF24vIk/E7pTpj6lCBmpWMGqtlVsM/USe0cYZ5JtS NB3uTlcQsVCAfrPj50yiQ+avSfh78/H5n4a5jOhdpHx2SDzUyLqH4pk5K8YW/0vdFlxY 1GfEum4a24/a6TdViFfzvgjVtYS3omBLp9Q5JYXqCPIcQ/thD5DJ9BdkX8w5cY0lbjdD OCaw== X-Gm-Message-State: AOAM533dForcKp2AcanjVV/JIMMSd9YlNHF+W1VOm/Mb/xxKFt6JsvvP iURgNwi9KUogPulWYzik9bsySSygEtz0eLIx1CnpZ0Onb7iVGe/ajmGi1w1XotMriK2vHSqldWL H/Ma+L5ba0ZTeehQx0y0W/dZt+VQYfLsEtRKkxsIckWOKdpL5uDmt+1pCQpWfcW7nwTm+ X-Received: by 2002:a5d:634d:: with SMTP id b13mr4498294wrw.310.1606214081772; Tue, 24 Nov 2020 02:34:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJwqlfyqj6XpHon9z+bjI32s4PWo+tDYZOv7ERgZDy2ez9ImzfAZzqbjrjPdLQ9UHAtgz9KKbQ== X-Received: by 2002:a5d:634d:: with SMTP id b13mr4498263wrw.310.1606214081447; Tue, 24 Nov 2020 02:34:41 -0800 (PST) Received: from localhost (91-166-131-65.subs.proxad.net. [91.166.131.65]) by smtp.gmail.com with ESMTPSA id t11sm4698089wmf.35.2020.11.24.02.34.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Nov 2020 02:34:40 -0800 (PST) Received: by localhost (Postfix, from userid 1001) id 9D7921A111B; Tue, 24 Nov 2020 11:34:39 +0100 (CET) To: libabigail@sourceware.org Subject: [PATCH] fedabipkgdiff: make --self-compare use abipkgdiff --self-check Organization: Red Hat / France X-Operating-System: Red Hat Enterprise Linux Server 7.8 X-URL: http://www.redhat.com Date: Tue, 24 Nov 2020 11:34:39 +0100 Message-ID: <86r1ojqc00.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, 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, Now that the abipkgdiff program supports the --self-check option to make it compare the binaries in an RPM against their own ABIXML representation, make the --self-compare option of fedabipkgdiff use the abipkgdiff --self-check. * tools/fedabipkgdiff (abipkgdiff): If the user provides the --self-compare options, generate the abipkgdiff command by using the --self-check option. (run_abipkgdiff): Each return value of the abipkgidiff runs can be negative because they are unsigned values in essence, but as python doesn't seem to have a unsigned integer type. So we need to consider the max of the absolute value of the return codes here. * tests/data/test-fedabipkgdiff/test7-self-compare-from-fc23-dbus-glib-report-0.txt: Adjust. Signed-off-by: Dodji Seketeli --- ...7-self-compare-from-fc23-dbus-glib-report-0.txt | 6 ++++ tools/fedabipkgdiff | 39 ++++++++++++++-------- 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/tests/data/test-fedabipkgdiff/test7-self-compare-from-fc23-dbus-glib-report-0.txt b/tests/data/test-fedabipkgdiff/test7-self-compare-from-fc23-dbus-glib-report-0.txt index 63a6dca..e037e7e 100644 --- a/tests/data/test-fedabipkgdiff/test7-self-compare-from-fc23-dbus-glib-report-0.txt +++ b/tests/data/test-fedabipkgdiff/test7-self-compare-from-fc23-dbus-glib-report-0.txt @@ -1,12 +1,18 @@ Comparing the ABI of binaries between dbus-glib-0.106-1.fc23.i686.rpm and dbus-glib-0.106-1.fc23.i686.rpm: +==== SELF CHECK SUCCEEDED for 'dbus-binding-tool' ==== +==== SELF CHECK SUCCEEDED for 'libdbus-glib-1.so.2.3.3' ==== Comparing the ABI of binaries between dbus-glib-devel-0.106-1.fc23.i686.rpm and dbus-glib-devel-0.106-1.fc23.i686.rpm: +==== SELF CHECK SUCCEEDED for 'dbus-bash-completion-helper' ==== Comparing the ABI of binaries between dbus-glib-0.106-1.fc23.x86_64.rpm and dbus-glib-0.106-1.fc23.x86_64.rpm: +==== SELF CHECK SUCCEEDED for 'dbus-binding-tool' ==== +==== SELF CHECK SUCCEEDED for 'libdbus-glib-1.so.2.3.3' ==== Comparing the ABI of binaries between dbus-glib-devel-0.106-1.fc23.x86_64.rpm and dbus-glib-devel-0.106-1.fc23.x86_64.rpm: +==== SELF CHECK SUCCEEDED for 'dbus-bash-completion-helper' ==== diff --git a/tools/fedabipkgdiff b/tools/fedabipkgdiff index 2191613..06ab573 100755 --- a/tools/fedabipkgdiff +++ b/tools/fedabipkgdiff @@ -1118,19 +1118,30 @@ def abipkgdiff(cmp_half1, cmp_half2): else: debuginfo_pkg2 = format_debug_info_pkg_options("--d2", cmp_half2.ancillary_debug); - cmd = [ - abipkgdiff_tool, - suppressions, - '--show-identical-binaries' if global_config.show_identical_binaries else '', - '--no-default-suppression' if global_config.no_default_suppr else '', - '--dso-only' if global_config.dso_only else '', - debuginfo_pkg1, - debuginfo_pkg2, - devel_pkg1, - devel_pkg2, - cmp_half1.subject.downloaded_file, - cmp_half2.subject.downloaded_file, - ] + cmd = [] + + if global_config.self_compare: + cmd = [ + abipkgdiff_tool, + '--dso-only' if global_config.dso_only else '', + '--self-check', + debuginfo_pkg1, + cmp_half1.subject.downloaded_file, + ] + else: + cmd = [ + abipkgdiff_tool, + suppressions, + '--show-identical-binaries' if global_config.show_identical_binaries else '', + '--no-default-suppression' if global_config.no_default_suppr else '', + '--dso-only' if global_config.dso_only else '', + debuginfo_pkg1, + debuginfo_pkg2, + devel_pkg1, + devel_pkg2, + cmp_half1.subject.downloaded_file, + cmp_half2.subject.downloaded_file, + ] cmd = [s for s in cmd if s != ''] if global_config.dry_run: @@ -1193,7 +1204,7 @@ def run_abipkgdiff(rpm_col1, rpm_col2): return_codes = [ abipkgdiff(cmp_half1, cmp_half2) for cmp_half1, cmp_half2 in generate_comparison_halves(rpm_col1, rpm_col2)] - return max(return_codes) if return_codes else 0 + return max(return_codes, key=abs) if return_codes else 0 @log_call