[llvm-dev] [monorepo] Much improved downstream zipping tool available

Björn Pettersson A via llvm-dev llvm-dev at lists.llvm.org
Tue Jan 29 08:41:03 PST 2019


Thanks for working on this David.

One problem that I've found with our downstream repos (and nestled
submodule structure) is that we haven't always been in sync when
updating the llvm and clang repos (considering svn-id:s).

Basically we can have a commit DL1 on our downstream llvm branch
being based on commit UL1 from the upstream llvm branch,
pointing out the submodule commit DC1 in clang (from downstream
branch) and that one could be based on UC1 from upstream clang
branch.

In the new monorepo UC1 may or may not be a parent to UL1.
We could actually have something like this:

  UL4->UC2->UL3->UL2->UL1->UL0->UC1

Our DL1 commit should preferably have UL1 as parent after
conversion

  UL4->UC2->UL3->UL2->UL1->UL0->UC1
                       |
                 ...->DL1

but since it also includes DC1 (via submodule reference) we
want to zip in DC1 before DL1, right? 

  UL4->UC2->UL3->UL2->UL1->UL0->UC1
                       |
            ...->DC1->DL1

The problem is that DC1 is based on UC1, so we would get something
like this

  UL4->UC2->UL3->UL2->UL1->UL0->UC1
                       |         |
            ...->DC1->DL1        |
                  ^              |
                  |              |
                   --------------

Which is not correct, since then we also get the UL0 commit
as predecessor to DL1.


This make me wonder if zipping really is that interesting for
us. When checking out an old downstream commit like DL1 in the
monorepo I would not be certain that I see the same version of
clang as in the old split repos (with submodule updates).
Often it would be correct, but not always.

I'll take a look at your updated script to see if it would
make any sense for us to use it (to get some kind of zipped
history). Although, I got at feeling that doing the octopus
merge might be the simple solution for us. If we ever want to
build something old, we would use our old split repos. The
octopus merge would indicate how far back we can do bisects etc.
in the monorepo. Even with some kind of zipping it would be
hard to build/bisect older commits (on our downstream branches).

Regards,
Björn


> -----Original Message-----
> From: David Greene <dag at cray.com>
> Sent: den 29 januari 2019 17:02
> To: llvm-dev at lists.llvm.org; cfe-dev at lists.llvm.org; openmp-
> dev at lists.llvm.org; clangd-dev at lists.llvm.org; libclc-
> dev at lists.llvm.org; libcxx-dev at lists.llvm.org; lldb-dev at lists.llvm.org
> Cc: Björn Pettersson A <bjorn.a.pettersson at ericsson.com>
> Subject: [monorepo] Much improved downstream zipping tool available
> 
> He all,
> 
> I've updated the downstream fork zipping tool that I posted about last
> November [1].  It is much improved in every way.  The most important
> enhancements are:
> 
> - Does a better job of simplifying history
> 
> - Handles nested submodules
> 
> - Will put non-submodule-update content in a subdirectory of the
>   monorepo
> 
> - Updates tags
> 
> In addition there are plenty of the requisite bug fixes.  The latest
> version of the tool can be found here:
> 
> https://github.com/greened/llvm-git-migration/tree/zip
> 
> With the nested submodules and the subdirectory features, the tool can
> now take a downstream llvm repository with submodules (e.g. clang in
> tools/clang and so on) as an umbrella and order the commits according
> to
> changes in llvm and its submodules.
> 
> Björn, this new version may well be able to handle the tasks you
> outlined in December [2].
> 
> I've written some recipes as proposed additions to the GitHub migration
> proposal [3].  If you have a different scenario, please comment there
> and if it seems a like a common case I can add a recipe for it so we
> can
> all benefit from the learning.
> 
> Much of the bugfixing work was the result of some artificial histories
> I
> created to shake out problems.  I believe it is ready for some testing
> in the wild.  If you do try it, please let me know how it worked for
> you
> and any problems you run into.  I will try to fix them.  It's easiest
> if
> you can provide me with a test repository showing the problem but even
> a
> verbal description of what is happening can help.
> 
> I hope this tool is helpful to the community.
> 
>                              -David
> 
> [1] http://lists.llvm.org/pipermail/llvm-dev/2018-November/127704.html
> [2] http://lists.llvm.org/pipermail/llvm-dev/2018-December/128620.html
> [3] https://reviews.llvm.org/D56550


More information about the llvm-dev mailing list