From patchwork Thu Mar 13 23:38:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 107864 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 3D9E33857C6C for ; Thu, 13 Mar 2025 23:38:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3D9E33857C6C Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=O6jpMOqX 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 [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id D03253858D39 for ; Thu, 13 Mar 2025 23:38:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D03253858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D03253858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1741909109; cv=none; b=jHV7arq46urEjUNjK+GeUVgZjHT0TMiZAmyv9GpIvmSqhAw5L8dAjiSaCR95IXks6CVl89zcmGeO/JFqMB5FFoiGZE27gEJCx1qXjJmA6RRTZROtlMasKvqEcoUUSvFoYYNV9TaHA5ZpTvLcCQbz4LES4O1eKzlZsM8xOsOo608= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1741909109; c=relaxed/simple; bh=phdzqARDHz4j9G4HYpgZb1EPBO0ZcB9z1o/nHlUlanE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ibkTDO9IWonNg5krnYF6cAJhr1o7uQBzO7TawnFgCUXE6t1PO4ImO48+8k1y/BHJKr8BnXyTdNmhySQLWYsmllafBkWqgmqO/c9+FkoQn0vCAxdrh63dnIqRWmfZrEjRy9Nu5YRn6E7NBmQB9nq4wAsY6IdB6kbnSUDTDh8U5L4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D03253858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741909109; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=w3UO8mf4Fhuh81fqt31pe31WTjttW07KutwqXB1GO/w=; b=O6jpMOqXV7FoD7T9ZYDGlL89DZjpQm0svZfFDfdXk1H1j4U0LGVl2kvBe3aAkabD1uw1x9 GbH3ZFgXOeM/uegBv5Y+lVEQ+Y2jOQZA7fd3g8vxOEqSCn8xWhc8I1F+08vNs+F0NF3ghx NQaD8Ic3xrkS3aRASTr1eSK9S2GhvtI= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-589-kgJ5f5qENvqv1XDN0t-onQ-1; Thu, 13 Mar 2025 19:38:25 -0400 X-MC-Unique: kgJ5f5qENvqv1XDN0t-onQ-1 X-Mimecast-MFC-AGG-ID: kgJ5f5qENvqv1XDN0t-onQ_1741909104 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4EC3F19560B0 for ; Thu, 13 Mar 2025 23:38:24 +0000 (UTC) Received: from localhost (unknown [10.44.22.27]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EDB281955F2D for ; Thu, 13 Mar 2025 23:38:23 +0000 (UTC) Received: by localhost (Postfix, from userid 1000) id 924C55077C4C; Fri, 14 Mar 2025 00:38:21 +0100 (CET) From: Dodji Seketeli To: libabigail@sourceware.org Subject: [PATCH, applied] abipkgdiff: Avoid wrongly considering binaries being added/removed Organization: Red Hat / France X-Operating-System: AlmaLinux 9.5 X-URL: http://www.redhat.com Date: Fri, 14 Mar 2025 00:38:21 +0100 Message-ID: <87msdo7b82.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: zgO_xRHccku0vpACyuLLsa0OtrGFH85huqyFh_4Iw28_1741909104 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.9 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_HOSTKARMA_W, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libabigail-bounces~patchwork=sourceware.org@sourceware.org Hello, When the layout of binaries in a package changes across versions of the package, abipkgdiff can wrongly consider one particular binary to be removed from the old package and then added again in the new one, even though the SONAME (when present) has not changed. This patch makes it so that only the SONAME (when present) is used as a key for the binary. That fixes the issue. * tools/abipkgdiff.cc (create_maps_of_package_set_content): Use the SONAME when present as the key of the binary. * tests/data/test-diff-pkg/dbus-glib-0.104-3.fc23.x86_64--dbus-glib-0.104-3.fc23.armv7hl-report-0.txt: Adjust. Signed-off-by: Dodji Seketeli --- ..._64--dbus-glib-0.104-3.fc23.armv7hl-report-0.txt | 13 +++++++++---- tools/abipkgdiff.cc | 10 ++-------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/tests/data/test-diff-pkg/dbus-glib-0.104-3.fc23.x86_64--dbus-glib-0.104-3.fc23.armv7hl-report-0.txt b/tests/data/test-diff-pkg/dbus-glib-0.104-3.fc23.x86_64--dbus-glib-0.104-3.fc23.armv7hl-report-0.txt index 8bd25704..b72d855b 100644 --- a/tests/data/test-diff-pkg/dbus-glib-0.104-3.fc23.x86_64--dbus-glib-0.104-3.fc23.armv7hl-report-0.txt +++ b/tests/data/test-diff-pkg/dbus-glib-0.104-3.fc23.x86_64--dbus-glib-0.104-3.fc23.armv7hl-report-0.txt @@ -1,3 +1,12 @@ +================ changes of 'libdbus-glib-1.so.2.3.2'=============== + ELF architecture changed + Functions changes summary: 0 Removed, 0 Changed, 0 Added function + Variables changes summary: 0 Removed, 0 Changed, 0 Added variable + + architecture changed from 'elf-amd-x86_64' to 'elf-arm' + +================ end of changes of 'libdbus-glib-1.so.2.3.2'=============== + ================ changes of 'dbus-binding-tool'=============== ELF architecture changed Functions changes summary: 0 Removed, 0 Changed, 0 Added function @@ -17,7 +26,3 @@ ================ end of changes of 'dbus-binding-tool'=============== -Removed binaries: - [D] /usr/lib64/libdbus-glib-1.so.2.3.2, SONAME: libdbus-glib-1.so.2 -Added binaries: - [A] /usr/lib/libdbus-glib-1.so.2.3.2, SONAME: libdbus-glib-1.so.2 diff --git a/tools/abipkgdiff.cc b/tools/abipkgdiff.cc index aae23577..5193f7c4 100644 --- a/tools/abipkgdiff.cc +++ b/tools/abipkgdiff.cc @@ -2850,11 +2850,11 @@ create_maps_of_package_set_content(const package_set_sptr& ps, // soname. So let's *also* consider the full path of the // binary inside the extracted directory, not just the // soname. - string key = e->soname; + string key = string("/@soname:") + e->soname; if (must_compare_public_dso_only(ps, opts)) { - if (ps->public_dso_sonames().find(key) + if (ps->public_dso_sonames().find(e->soname) == ps->public_dso_sonames().end()) { // We are instructed to compare public DSOs only and @@ -2867,12 +2867,6 @@ create_maps_of_package_set_content(const package_set_sptr& ps, } } - if (ps->convert_path_to_unique_suffix(resolved_e_path, key)) - { - dir_name(key, key); - key += string("/@soname:") + e->soname; - } - if (ps->path_elf_file_sptr_map().find(key) != ps->path_elf_file_sptr_map().end()) // 'key' has already been seen before. So we won't do itl