llvm / Community.o

Community.o website and other resources
0 stars 1 forks source link

Create Dockerfile/Docker image to build LLVM #6

Open kbeyls opened 9 months ago

kbeyls commented 9 months ago

The idea is that having a dockerfile available will remove a number of potential build issues that newcomers could struggle with.

kbeyls commented 9 months ago

@rsundahl will create a Dockerfile that (minimally) will build llvm-project agnostic of the host Docker OS.

rsundahl commented 8 months ago

Playing with this... NB: llvm-project already has some Dockerfile support and I started there but going for a bare-bones simple Dockerfile. Moved from Debian to Alpine for a lighter lift and it is, but relatively. It's still a big bloat. Optimizing build sequencing for overlayfs. First layer: minimal Alpine. Second layer: git clone. Third layer: additional packages. Fourth layer: build artifacts.

kbeyls commented 3 months ago

This idea was raised again at the EuroLLVM 2024 community.o workshop as maybe one of the most effective ways to help newcomers overcome the first hurdle when starting with LLVM: how to build it. This continues to be a non-trivial challenge.

rsundahl commented 2 months ago

That's good to know. I spent a decent amount of time on this after the last meeting but either the size of the container is too big, the amount of data needed to download during the build of the image is too much, or the amount of resources needed for Docker to be happy building it, are acceptable. I might have to go back to it and pick one thing to tolerate, go into detail on how to configure for the demand, and then optimize around the remaining things that I can control. One thing that stands out for me is that staying "current" with the llvm repo is just too much and not valuable enough to entertain. I was thinking that at some cadence that's roughly yearly(?) we do the work of putting together a reference container or Dockerfile bound to downloading building that release, and then we go with it for the year. At least that way, we can write tutorials, demos, etc. on a stable platform. I don't think we'd lose much doing that and we'd know that things are working and stable for our users and that the work of bringing thing up to the next release will be contained and not some ongoing nightmare.