[llvm-dev] Flang landing in the monorepo

Peter Waller via llvm-dev llvm-dev at lists.llvm.org
Tue Dec 17 13:30:50 PST 2019


Hi All,

The flang project (a Fortran compiler) is getting ready to join the 
monorepo. We intend to preserve the existing history by rewriting the 
existing commits as a linear series of commits on top of llvm-project.

I understand the flang community would like to do this before the LLVM 
10 branch in due in mid January, so please speak up soon if you see 
anything needing fixing in what I write below.

I've taken into account the discussion raised during the MLIR landing 
discussion found at 
http://lists.llvm.org/pipermail/llvm-dev/2019-November/136813.html. As 
with MLIR, we rewrite the commits so that flang's work all appears to 
happen in the flang directory, starting with llvm-project master as it 
appears today. The topology of the f18 history was fairly interesting, 
which is why I ended up writing a new program to rewrite it rather than 
using an existing one.

=== Key links

* Resulting tree of the rewrite:
https://github.com/peterwaller-arm/f18/tree/rewritten-history-v2-llvm-project-merge

* Rewritten history, with flang commits applied on top of llvm-project 
master:
https://github.com/peterwaller-arm/f18/commits/rewritten-history-v2-llvm-project-merge

* The history rewriting program is published here:
   https://github.com/flang-compiler/f18/pull/854

* Latest mailing list discussion of rewrite on flang-dev:
http://lists.llvm.org/pipermail/flang-dev/2019-December/000122.html

=== Additional considerations

* Existing references to pull request and issue numbers are rewritten so 
that they point at the originals as, e.g. flang-compiler/f18#123. This 
prevents those patches from generating bogus references to Issues/PRs of 
llvm-project if/when those appear in the llvm-project repository.

* Developers using the llvm-project repo, when they pull after this 
push, will see 2,700ish commits appear on the tip. These will follow on 
as normal commits from wherever master is at the time of the push. The 
fetch takes 40s and I see my ".git" directory grow by approximately 
90MiB when I simulate this.

* Rewriting and validating the rewritten f18 history is sufficiently 
fast that I don't think it will be necessary to pause commits to LLVM. 
The script runs in a few seconds. Before this is done though, I think 
new commits should no longer be accepted on the original repository.

* You can simulate the experience of the fresh merge with `git remote 
add peterwaller-arm https://github.com/peterwaller-arm/f18 && time git 
fetch peterwaller-arm rewritten-history-v2-llvm-project-merge`, and then 
look at the peterwaller-arm/rewritten-history-v2-llvm-project-merge 
branch with git log.

* Remember that you can restrict the "git log" output to what you are 
interested in by specifying a directory, e.g. `git log clang/`.

That's all for now. Season's greetings!

- Peter



More information about the llvm-dev mailing list