[PATCH] D109593: WIP: [libcxx] Add a CI configuration for standalone building in llvm-project/runtimes

Louis Dionne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 22 11:07:51 PDT 2021


ldionne added a comment.

I'm glad we're all on the same page.

In D109593#3014343 <https://reviews.llvm.org/D109593#3014343>, @mstorsjo wrote:

> That sounds like a good general direction. Distributors of llvm and the runtimes are going to need a decent sized transition period though.

Agreed, we can give them like 2 LLVM releases (roughly 1 year).

> The bigger disruption is going to be when/if we stop allowing building the runtime projects entirely on their own by pointing cmake directly at e.g. libcxx. Judging from last weeks LLVM Distributors Conference, I would say that's the way a majority of distributors build it today, and transitioning that into e.g. 1. above will take some effort in the more complex cases. And some of them build this way with standalone source dirs without the surrounding monorepo, e.g. cc @tstellar.

Indeed, and that sort of build (standalone builds) are something I've been trying to eradicate for a while. That type of build makes everything a lot more complicated for us. I think moving to a "normal build" using `<root>/runtimes` as the CMake root should be pretty easy -- they'll just end up with a single CMake invocation instead of two or more.

In D109593#3014375 <https://reviews.llvm.org/D109593#3014375>, @phosek wrote:

> Another thing I'd point out is that we may want to rethink the use of `LLVM_ENABLE_RUNTIMES` and `<root>/llvm/runtimes`. In the bootstrapping build, we want to build Clang and then use to build runtimes, but LLVM isn't aware of Clang, Clang depends on LLVM. To give you a concrete example, if you used `-DLLVM_ENABLE_PROJECTS=llvm -DLLVM_ENABLE_RUNTIMES=all`, it's not clear what should happen since there's no Clang being built.
>
> I think that in the long run, it'd be better if the bootstrapping build had moved either into Clang or even to the very top-level  of the monorepo (that is `<root>/CMakeLists.txt`) since in practice you'll also want a linker, and possibly Flang and other tools.

Yeah, I agree. How about this:

1. `cmake -S <root>/llvm -DLLVM_ENABLE_PROJECTS=libcxx` doesn't work anymore.
2. `cmake -S <root> -DLLVM_ENABLE_PROJECTS=clang -DLLVM_BOOTSTRAP_RUNTIMES=libcxx` performs a bootstrapping build (we can iterate on the naming, today this is `-DLLVM_ENABLE_RUNTIMES=libcxx`). If you don't add `LLVM_ENABLE_PROJECTS=clang`, the bootstrapping build can't work.
3. `cmake -S <root>/runtimes -DLLVM_ENABLE_RUNTIMES=libcxx` performs a normal build of libc++ with whatever system compiler you have.
4. All the other ways to build libc++ & al don't work anymore.

I think we can get there in the next year.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109593/new/

https://reviews.llvm.org/D109593



More information about the llvm-commits mailing list