has anyone got dmd and/or ldc working on alpine linux in docker?

Mathias Lang pro.mathias.lang at gmail.com
Tue Oct 15 05:13:15 UTC 2019


On Saturday, 12 October 2019 at 14:50:52 UTC, aliak wrote:
> This is the closest I've found: 
> https://hub.docker.com/r/andrewbenton/alpine-ldc/ But it 
> doesn't seem to work?
>
> THere's also no package for dmd/ldc/gdc to install via apk that 
> I can find.
>
> Has anyone done this?
>
> Cheers,
> - Ali

Yes, our company have. I even tried to submit it as a package 
upstream, but haven't got ANY feedback for than 2 months now.

https://github.com/alpinelinux/aports/pull/10107

The way we did it is by using LDC 1.8.0 to bootstrap LDC 1.17.0.
We also build our own dub, because 1) we need it for building, 
and 2) we needed a recent version with support for coverage 
(this: https://github.com/dlang/dub/pull/1755 ).

If you want to give it a quick try, you can look at how we do it:
https://github.com/bpfkorea/agora/blob/adeec783bce88feee4e115b66d11d88813546ecd/Dockerfile

Note that it's currently confined to a single version of LDC, but 
that's a starting point.
In the future I hope that my PR gets merged and I can get rid of 
all my custom setup.

Additionally, Iain Buclaw, GDC maintainer, has done a wonderful 
job at backporting patches for Musl. Since Alpine edge is already 
on GCC 9.x, that would be another way (probably more appropriate 
for upstream) to do bootstrapping.


More information about the Digitalmars-d mailing list