[flang-dev] Which version of clang-format to use?

Diana Picus via flang-dev flang-dev at lists.llvm.org
Mon May 17 09:19:05 PDT 2021


It seems the pre-merge has just moved to
<https://lists.llvm.org/pipermail/llvm-dev/2021-May/150614.html> LLVM 12.

I think it is actually sensible to use the latest released version (so in
this case 12, as 13 is not out yet), otherwise whenever you rebase a patch
that's in review you also need to rebuild clang-format locally (instead of
just flang + tests). In addition, there's no connection in Phabricator
between a patch and the commit it is based on, so it's not clear what the
in-tree version is. If you mean ToT, then that can change while a patch is
in review. Think about what it would mean for a flang patch if a
clang-format patch is committed, then reverted for bug-fixes, then
committed again, all while the flang patch is still in review. Does that
mean the pre-merge checks should be run 3 times, potentially with different
results each time? That would be both confusing and very resource
intensive. On the other hand, if the pre-merge checks are only run once,
when you first upload the patch, then you'd essentially have
non-deterministic formatting, depending on what happened to be in tree at
that exact moment. Using the release binaries gives much more stability.

There may be some delay between when the release binaries become available
and when the pre-merge bots are updated, but that's probably something that
can be mitigated. In this case, the delay was a whole month, which is
admittedly quite long, especially since the release cycles are only a
couple of months long if you count minor releases too. But with the release
process moving towards becoming more and more automated, I suspect this
step could be automated too, and then there would be no delay at all. You
could still end up in a situation where you submitted a patch just before
the release went public, and then you'd have to update your formatting to
match the new release, but that should only happen infrequently.

Just my 2 cents, I hope I didn't misinterpret what you were saying.

Cheers,
Diana

On Fri, 14 May 2021 at 23:32, Michael Kruse via flang-dev <
flang-dev at lists.llvm.org> wrote:
>
> I think the only canonical version is the version in-tree at the same
> revision. Everything else would require another discussion and/or
> manual work with the bots after clang has had a new release.
>
> Maybe the pre-merge bot could be changed to also keep clang-format and
> clang-tidy up-to-date?
>
> Michael
>
>
> Am Fr., 14. Mai 2021 um 08:35 Uhr schrieb Peter Steinfeld via
> flang-dev <flang-dev at lists.llvm.org>:
> >
> > Over the past several months, I’ve always used the latest version of
clang-format built from the latest version of LLVM.  Currently, this is
version 13.0.0.  When recently reviewing Phabricator requests, I’ve noticed
differences caused by changes in clang-format.  So I decided to clean up
all of the differences and filed https://reviews.llvm.org/D102424.  But
when Phabricator displayed my request, it annotated it with several
comments saying that clang-format needed to be run on some of the files.
Apparently Phabricator is using a different version of clang-format, so I
filed https://github.com/google/llvm-premerge-checks/issues/303 for this
issue.
> >
> >
> >
> > What’s the proper process?  Which version of clang-format should we all
be using?
> >
> >
> >
> > Pete
> >
> >
> >
> > _______________________________________________
> > flang-dev mailing list
> > flang-dev at lists.llvm.org
> > https://lists.llvm.org/cgi-bin/mailman/listinfo/flang-dev
> _______________________________________________
> flang-dev mailing list
> flang-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/flang-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/flang-dev/attachments/20210517/fc9a5dd2/attachment.html>


More information about the flang-dev mailing list