crystal-lang / distribution-scripts

40 stars 24 forks source link

Install llvm-dev in the Docker image #60

Closed oprypin closed 4 years ago

oprypin commented 4 years ago

It would be nice to not have to install llvm-8-dev when working on Crystal itself in the docker image.

E.g. eliminate this installation step here https://github.com/crystal-lang/crystal/runs/597246816#step:4:1 https://github.com/crystal-lang/crystal/actions/runs/81290075/workflow#L12

Only llvm-8 is provided, though:

https://github.com/crystal-lang/distribution-scripts/blob/cfe843ff938697174afea976f4499fef806b5286/docker/ubuntu.Dockerfile#L24

The -dev package should be a small difference.

bcardiff commented 4 years ago

What is missing in the llvm-8 package that is needed for cross-compiling to windows?

oprypin commented 4 years ago

make libcrystal

Makefile:55: *** Could not locate llvm-config, make sure it is installed and in your PATH, or set LLVM_CONFIG. Stop

oprypin commented 4 years ago

Wait, that's part of llvm-8, not necessarily llvm-8-dev. Was I confused? Is llvm just not installed on those images?

oprypin commented 4 years ago

The logs here are very interesting https://github.com/oprypin/crystal/runs/606062333#step:4:29

  1. installing llvm-8 also pulls in llvm-8-dev?
  2. llvm-8 is part of NEW packages so apparently it's not installed?
jhass commented 4 years ago

Well to me it would make sense to have to kinds of images, one lightweight for using the compiler normally (targeted at the majority of crystal users and CIs for their projects) and one with all the bells and whistles that allow one to recompile the compiler (targeted at compiler devs and the compiler CIs).

I don't use docker though, so no clue what's the current landscape.

oprypin commented 4 years ago

Ah that's fine. I was just under the assumption that the image already has LLVM, but without the headers, which would be a tiny addition. But perhaps not.

straight-shoota commented 4 years ago

@jhass That's already the case. There are separate runtime and build images.

@oprypin You need to use crystallang/crystal:0.34.0-build to get the build image with LLVM.

oprypin commented 4 years ago

Ooh maybe I'll try that and it will just work

oprypin commented 4 years ago

Yes, thanks. Works in https://github.com/crystal-lang/crystal/pull/9155

This and https://github.com/crystal-lang/distribution-scripts/issues/60#issuecomment-617334835 shows that the base assumption of this issue is incorrect. Everything is good.

oprypin commented 4 years ago

To clarify: