<div dir="ltr"><div dir="ltr">Hi,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Aug 8, 2019 at 4:15 PM Wynand Pieterse via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi all, trust all is well!<div><br></div><div>I was wondering if LLVM would have a Bazel integrated build in the future? I can imagine the benefits this could bring, especially with regards to remote builds and caching.</div></div></blockquote><div><br></div><div>There was a round-table at EuroLLVM on this topic. I couldn't participate fully (I was writing my slides...) but I remember some key elements that we not playing in favor of Bazel:</div><div>1) It is written in Java, and not widely available by default on every platform. This is not a nice property to base a key piece of the requirement for getting started with LLVM.</div><div>2) It is memory heavy (maybe related to the previous point...): it consumes multiple GB by itself when building LLVM.</div><div>3) There are other solutions to have remote build execution and caching, for instance the <a href="https://chromium.googlesource.com/infra/goma/client">Chrome Goma Client</a> implements the same protocol for remote execution as Bazel and (in theory at least) can integrate well with `CMake` and `ninja` to build a project like LLVM (I am actually playing with this these days).</div><div>4) While sandboxing and the declarative approach that Bazel is using is nice, it isn't clear to me that Bazel provides the same ability that CMake has to detect the environment and configure the build. The "regular" LLVM build is likely easy to mimic with Bazel, but can you plumb all the knob and make it work on every platform that LLVM support?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I'm thinking of dumping the LLVM source-tree into my code-base and experiment with building LLVM via Bazel. Will pull requests be accepted for this? I won't mind contributing my changes back into the upstream.</div></div></blockquote><div></div><div><br></div><div>If you want to get started an play with it, the TensorFlow project builds LLVM with Bazel. They maintain their own <a href="https://github.com/tensorflow/tensorflow/blob/master/third_party/llvm/llvm.autogenerated.BUILD">BUILD file for LLVM</a> (it is probably not complete, but maybe a good way to get started).</div><div><br></div><div>Best,</div><div><br></div><div>-- </div><div>Mehdi</div><div><br></div></div></div>