Bug 29911 - fedabipkgdiff forgets to provide some debuginfo RPMs to abipkgdiff
authorDodji Seketeli <dodji@redhat.com>
Tue, 21 Mar 2023 17:18:19 +0000 (18:18 +0100)
committerDodji Seketeli <dodji@redhat.com>
Tue, 21 Mar 2023 17:18:19 +0000 (18:18 +0100)
Some packages like foo-utils.rpm can be associated with two debuginfo
RPMs: One foo-utils-debuginfo.rpm and foo-debuginfo.rpm.  This is
because the foo-debuginfo.rpm contains debug info that has been
factorized out of all the sub-packages of foo, foo-utils being one of
those sub-packages.  In those cases, fedabipkgdiff needs to provide
foo-debuginfo.rpm and foo-utils-debuginfo.rpm to abipkgdiff so that it
can find all the necessary debuginfo.

This patch fixes fedabipkgdiff accordingly and adds some more logging
to abipkgdiff to make it emit an explicit message for cases like this.

* tools/abipkgdiff.cc (compare_to_self): Emit an error message
when in verbose mode, for cases where we fail to find the
alternate debug info.
* tools/fedabipkgdiff (generate_comparison_halves): Always provide
all associated debuginfo packages to abipkgdiff.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
tools/abipkgdiff.cc
tools/fedabipkgdiff

index 46b920a196dfa1ad6fdd06cfaefb3942a73b2bb5..a2b6ab8bca0e2280647183b0b6a0bb70b2b42bd3 100644 (file)
@@ -1716,6 +1716,19 @@ compare_to_self(const elf_file&          elf,
 
        return abigail::tools_utils::ABIDIFF_ERROR;
       }
+    else if (c_status & abigail::fe_iface::STATUS_ALT_DEBUG_INFO_NOT_FOUND)
+      {
+       if (opts.verbose)
+         emit_prefix("abipkgdiff", cerr)
+           << "Could not read find alternate DWARF debug info for '"
+           << elf.path
+           << "'.  You might have forgotten to provide a debug info package\n";
+
+       if (detailed_error_status)
+         *detailed_error_status = c_status;
+
+       return abigail::tools_utils::ABIDIFF_ERROR;
+      }
 
     if (opts.verbose)
       emit_prefix("abipkgdiff", cerr)
index c05bd8b1deb4f96df9724b4e95ead9b501271cad..db23d5a3fdda8888c3d35d535529d3c20ccf411d 100755 (executable)
@@ -612,26 +612,18 @@ def generate_comparison_halves(rpm_col1, rpm_col2):
         debuginfo_list1 = []
         debuginfo_list2 = []
 
-        # If this is a *devel* package we are looking at, then get all
-        # the debug info packages associated to with the main package
-        # and stick them into the resulting comparison half.
-
-        if _rpm.is_devel:
-            debuginfo_list1 = rpm_col1.get_all_debuginfo_rpms(_rpm)
-        else:
-            debuginfo_list1.append(rpm_col1.get_matching_debuginfo(_rpm))
+        # Get all debug info packages associated to with the main
+        # package and stick them into the resulting comparison half.
 
+        debuginfo_list1 = rpm_col1.get_all_debuginfo_rpms(_rpm)
         devel1 = rpm_col1.get_sibling_devel(_rpm)
 
         if global_config.self_compare:
             debuginfo_list2 = debuginfo_list1
             devel2 = devel1
         else:
-            if rpm2.is_devel:
-                debuginfo_list2 = rpm_col2.get_all_debuginfo_rpms(rpm2)
-            else:
-                debuginfo_list2.append(rpm_col2.get_matching_debuginfo(rpm2))
-            devel2 = rpm_col2.get_sibling_devel(rpm2)
+             debuginfo_list2 = rpm_col2.get_all_debuginfo_rpms(rpm2)
+             devel2 = rpm_col2.get_sibling_devel(rpm2)
 
         yield (ComparisonHalf(subject=_rpm,
                               ancillary_debug=debuginfo_list1,