[PATCH] D34197: Added Dockerfiles to build clang from sources.

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 19 08:44:07 PDT 2017


mehdi_amini added a comment.

In https://reviews.llvm.org/D34197#783750, @ilya-biryukov wrote:

> I would advocate for an easier interface to the build script, even if it would add some maintenance costs (that said, I'm ready to maintain it).
>  I think having a script, accepting parameters like 'make a 2-stage bootstrap and install lld+clang)', is a better interface than 'checkout projects cfe, lld, pass arguments "-X -Y -Z" to cmake'. Keeping an interface to the build script simple (while also not letting the maintenance costs blow up) should be a priority here, IMO.


Feel free to advocate for it, but except that stating an opinion above I'm missing you arguments.

You're stating some priority above without clearly defining the goals. I'm missing the big picture: who is the target of these images? What problem are we addressing? In my previous comment I put forward that one the main use case for the LLVM project would be to help people to start using LLVM (which is why I mentioned  http://llvm.org/docs/GettingStarted.html )

Now why should the interface for this script be different from the build interface we *already* have? 
You mention that you're looking for a `make a 2-stage bootstrap and install lld+clang` kind of interface, but that's already possible with our cmake AFAIK, it should something like: `cmake  -DCLANG_ENABLE_BOOTSTRAP=On  -DLLVM_ENABLE_PROJECTS="lld;clang" && make install`



================
Comment at: docs/Docker.rst:58
+
+- `build/` image is used to compile clang, it installs gcc and all build
+  dependencies of clang. After the build process is done, the build image will
----------------
ilya-biryukov wrote:
> mehdi_amini wrote:
> > Why does it install gcc? Why not apt-get install clang?
> No specific reason, since we do 2-stage build and end up with "clang, compiled from clang" in the end, this shouldn't matter.
Of course it shouldn't matter, but if both gcc and clang are equally available, I always tend to take clang.


================
Comment at: utils/docker/debian8/build/build_install_clang.sh:62
+svn co -q $SVN_REV_ARG "http://llvm.org/svn/llvm-project/cfe/$LLVM_BRANCH" \
+  "$CLANG_BUILD_DIR/llvm/tools/clang"
+
----------------
ilya-biryukov wrote:
> mehdi_amini wrote:
> > That's where it becomes to get interesting: why only cfe?
> > Why wouldn't we package libc++, compiler-rt, lld, lldb, etc.
> > I understand you may not care, or that it even may be a burden (extra size), but as LLVM developers it isn't clear to me why we wouldn't have by default everything included.
> > 
> > It also seems to me that this script `build_install_clang.sh` is `yet another build script` to maintain while we already have some in the repo.
> > 
> > I suspect everyone will have different needs, and we will end up with a very complicated script to handle all possibilities (I for one am interested into using this, but with a very different config: bootstrap+LTO+lld+only some targets to begin with).
> > 
> > We really need more thoughts around this.
> The maintenance cost is exactly the reason why we hard-coded the script to build only clang. It makes the script very easy. That said, I'm in favour of more configuration in the future, building clang is just a first iteration.
> 
> I can spend some time making the script configurable enough to cover your use-case too. Than we could iterate to make it even more configurable.
> > I suspect everyone will have different needs, and we will end up with a very complicated script to handle all possibilities
> Could you elaborate more on what exactly are 'only some targets to begin with'?
I rather not land this before we settle on this at this point (I don't see any urgency to land it that would motivate doing otherwise).

> Could you elaborate more on what exactly are 'only some targets to begin with'?

`-DLLVM_TARGETS_TO_BUILD=X86`


================
Comment at: utils/docker/debian8/build/build_install_clang.sh:81
+      -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$CLANG_INSTALL_DIR" \
+      "$CLANG_BUILD_DIR/llvm"
+
----------------
ilya-biryukov wrote:
> mehdi_amini wrote:
> > LLVM has a bootstrap process in a single cmake invocation, and can even build LLD during stage 1 and use it to link stage 2 (with LTO for example).
> Thanks, will look into using it.
FYI: http://llvm.org/docs/AdvancedBuilds.html


https://reviews.llvm.org/D34197





More information about the llvm-commits mailing list