From: Dodji Seketeli <dodji@seketeli.org>
To: Giuliano Procida <gprocida@google.com>
Cc: libabigail@sourceware.org, kernel-team@android.com,
maennich@google.com
Subject: Re: [RFC] Fix has_net_changes for leaf-changes-only mode.
Date: Thu, 26 Mar 2020 18:12:23 +0100 [thread overview]
Message-ID: <87tv2bqbuw.fsf@seketeli.org> (raw)
In-Reply-To: <20200324171344.258865-1-gprocida@google.com> (Giuliano Procida's message of "Tue, 24 Mar 2020 17:13:44 +0000")
Hello Giuliano,
Giuliano Procida <gprocida@google.com> a écrit:
> * 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
Sorry, but what do you mean by "anonymous struct name changes" ?
[...]
> 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())
In essence, this is code which behaviour depends on the kind of
"reporter" we are using. That is, if we are using the leaf reporter,
then we want a given behaviour, otherwise we want another behaviour.
So I think a route to make the whole thing maintainable going forward
would be to put that code in the reporters.
That is, in include/abg-reporter.h, add a pure virtual
bool reporter_base::diff_has_net_changes(const corpus_diff&) const function.
That interface would then be implemented in both default_reporter and
leaf_reporter class types.
Then in corpus_diff::has_net_changes(), we'd do something like:
return context()->get_reporter()->diff_has_net_changes(*this);
That way, the actual choice of what constitute the set of net changes
would be left to the each reporter.
Does that make any sense?
[...]
> (mostly but not all filtered out in non-leaf mode which may be its own
> bug).
Hopefully with this approach, this issue should go away as well.
Thanks a lot for looking into this.
Cheers,
--
Dodji
next prev parent reply other threads:[~2020-03-26 17:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-24 17:13 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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87tv2bqbuw.fsf@seketeli.org \
--to=dodji@seketeli.org \
--cc=gprocida@google.com \
--cc=kernel-team@android.com \
--cc=libabigail@sourceware.org \
--cc=maennich@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).