public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [RFC] Fix has_net_changes for leaf-changes-only mode.
@ 2020-03-24 17:13 Giuliano Procida
  2020-03-24 17:17 ` Giuliano Procida
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Giuliano Procida @ 2020-03-24 17:13 UTC (permalink / raw)
  To: libabigail; +Cc: dodji, kernel-team, gprocida, maennich

* Which other functions need the same treatment?
* Should something else change instead?
* What about tracking of changed types (inclusion of these in summary
  stats and exit code for leaf mode)?

This patch breaks tests and is not suitable for applying in its
current form.

The issue we saw is that anonymous struct name changes triggered
hundreds of diffs (mostly but not all filtered out in non-leaf mode
which may be its own bug).

	* src/abg-comparison.cc (corpus_diff::has_net_changes): In
        leaf-changes-only mode, check leaf changes to functions and
        variables to avoid returning non-zero exit code with empty
        output.

Signed-off-by: Giuliano Procida <gprocida@google.com>
---
 src/abg-comparison.cc | 33 +++++++++++++++++++--------------
 1 file changed, 19 insertions(+), 14 deletions(-)

diff --git a/src/abg-comparison.cc b/src/abg-comparison.cc
index 46bf9e30..7756c12b 100644
--- a/src/abg-comparison.cc
+++ b/src/abg-comparison.cc
@@ -10602,21 +10602,26 @@ corpus_diff::has_net_changes() const
     const diff_stats& stats = const_cast<corpus_diff*>(this)->
       apply_filters_and_suppressions_before_reporting();
 
+    bool leaf = context()->show_leaf_changes_only();
     return (architecture_changed()
-	    || soname_changed()
-	    || stats.net_num_func_changed()
-	    || stats.net_num_vars_changed()
-	    || stats.net_num_func_added()
-	    || stats.net_num_added_func_syms()
-	    || stats.net_num_func_removed()
-	    || stats.net_num_removed_func_syms()
-	    || stats.net_num_vars_added()
-	    || stats.net_num_added_var_syms()
-	    || stats.net_num_vars_removed()
-	    || stats.net_num_removed_var_syms()
-	    || stats.net_num_added_unreachable_types()
-	    || stats.net_num_removed_unreachable_types()
-	    || stats.net_num_changed_unreachable_types());
+            || soname_changed()
+            || (leaf
+                  ? stats.net_num_leaf_func_changes()
+                  : stats.net_num_func_changed())
+            || (leaf
+                  ? stats.net_num_leaf_var_changes()
+                  : stats.net_num_vars_changed())
+            || stats.net_num_func_added()
+            || stats.net_num_added_func_syms()
+            || stats.net_num_func_removed()
+            || stats.net_num_removed_func_syms()
+            || stats.net_num_vars_added()
+            || stats.net_num_added_var_syms()
+            || stats.net_num_vars_removed()
+            || stats.net_num_removed_var_syms()
+            || stats.net_num_added_unreachable_types()
+            || stats.net_num_removed_unreachable_types()
+            || stats.net_num_changed_unreachable_types());
 }
 
 /// Apply the different filters that are registered to be applied to
-- 
2.25.1.696.g5e7596f4ac-goog


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-07-21  6:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-24 17:13 [RFC] Fix has_net_changes for leaf-changes-only mode Giuliano Procida
2020-03-24 17:17 ` Giuliano Procida
2020-03-26 10:37 ` Matthias Maennich
2020-03-26 12:01   ` Giuliano Procida
2020-03-26 17:12 ` Dodji Seketeli
2020-03-27 18:42   ` Giuliano Procida
2020-03-27 19:01 ` [PATCH v2] Fix has_net_changes for --leaf-changes-only mode Giuliano Procida
2020-03-30  9:17   ` Matthias Maennich
2020-07-01 13:19     ` [PATCH v3 0/1] Fix abidiff exit code when diffs are suppressed Giuliano Procida
2020-07-01 13:19       ` [PATCH v3 1/1] Fix has_net_changes for --leaf-changes-only mode Giuliano Procida
2020-07-17 13:54         ` Dodji Seketeli
2020-07-17 16:34           ` Giuliano Procida
2020-07-21  6:28             ` Dodji Seketeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).