February 22, 2018
On 22/02/2018 10:17 PM, Suliman wrote:
> It would be nice if anyone will rewrite Musl to betterC :)

Combine it with dmc's libc and we're starting to get a reasonable state.
February 22, 2018
On Thursday, 22 February 2018 at 08:54:04 UTC, Joakim wrote:
> On Monday, 23 October 2017 at 18:18:28 UTC, Jacob Carlborg wrote:
>> [...]
>
> Yuxuan Shui has ported druntime to Musl over the last couple months:
>
> https://github.com/dlang/druntime/pulls?q=is%3Apr+author%3Ayshui+is%3Aclosed
>
> With his changes, all druntime unit tests pass, now only a few asserts tripping in the additional tests for shared libraries.  I added a couple more tweaks to get all but one of the Phobos unit tests passing too.
>
> With a last tiny patch to add a command-line flag to dmd to easily use this port- already added to the latest ldc 1.8 beta, though it doesn't have all the druntime support: https://github.com/ldc-developers/ldc/pull/2373 - anyone can use D with Alpine/Musl containers for microservices.

That makes me very happy!! Very much appreciated.
February 23, 2018
On 2018-02-22 09:54, Joakim wrote:

> Yuxuan Shui has ported druntime to Musl over the last couple months:
> 
> https://github.com/dlang/druntime/pulls?q=is%3Apr+author%3Ayshui+is%3Aclosed 
> 
> 
> With his changes, all druntime unit tests pass, now only a few asserts tripping in the additional tests for shared libraries.  I added a couple more tweaks to get all but one of the Phobos unit tests passing too.
> 
> With a last tiny patch to add a command-line flag to dmd to easily use this port- already added to the latest ldc 1.8 beta, though it doesn't have all the druntime support: https://github.com/ldc-developers/ldc/pull/2373 - anyone can use D with Alpine/Musl containers for microservices.

That's great.

-- 
/Jacob Carlborg
February 24, 2018
On Thursday, 22 February 2018 at 21:59:27 UTC, aberba wrote:
> On Thursday, 22 February 2018 at 08:54:04 UTC, Joakim wrote:
>> On Monday, 23 October 2017 at 18:18:28 UTC, Jacob Carlborg wrote:
>>> [...]
>>
>> Yuxuan Shui has ported druntime to Musl over the last couple months:
>>
>> https://github.com/dlang/druntime/pulls?q=is%3Apr+author%3Ayshui+is%3Aclosed
>>
>> With his changes, all druntime unit tests pass, now only a few asserts tripping in the additional tests for shared libraries.
>>  I added a couple more tweaks to get all but one of the Phobos unit tests passing too.
>>
>> With a last tiny patch to add a command-line flag to dmd to easily use this port- already added to the latest ldc 1.8 beta, though it doesn't have all the druntime support: https://github.com/ldc-developers/ldc/pull/2373 - anyone can use D with Alpine/Musl containers for microservices.
>
> That makes me very happy!! Very much appreciated.

I've updated ldc master to use Yuxuan's druntime port, which means the upcoming ldc 1.8 release will likely be a viable Alpine/Musl cross-compiler out of the box, provided you give it a C/Musl cross-compiler/linker to work with, by using the bundled ldc-build-runtime tool:

https://wiki.dlang.org/Building_LDC_runtime_libraries

Cross-compiling has not been tested however: do people normally cross-compile to Alpine containers or build their software in Alpine itself?  If the latter, building ldc from master on Alpine/x64 3.7.0 passes all of the druntime/phobos stdlib unit tests but one, so you're good to go there, as long as you don't need a pre-built binary. Maybe we'll put one out for ldc with the upcoming 1.8 release.
February 25, 2018
On Saturday, 24 February 2018 at 10:03:07 UTC, Joakim wrote:
> I've updated ldc master to use Yuxuan's druntime port, which means the upcoming ldc 1.8 release will likely be a viable Alpine/Musl cross-compiler out of the box, provided you give it a C/Musl cross-compiler/linker to work with, by using the bundled ldc-build-runtime tool:
>
> https://wiki.dlang.org/Building_LDC_runtime_libraries
>
> Cross-compiling has not been tested however: do people normally cross-compile to Alpine containers or build their software in Alpine itself?  If the latter, building ldc from master on Alpine/x64 3.7.0 passes all of the druntime/phobos stdlib unit tests but one, so you're good to go there, as long as you don't need a pre-built binary. Maybe we'll put one out for ldc with the upcoming 1.8 release.

great stuff, thank you! this will be very useful!

Q: what would be needed to build a single binary (a la golang) that works in a FROM SCRATCH docker container?
February 25, 2018
On Saturday, 24 February 2018 at 10:03:07 UTC, Joakim wrote:
> On Thursday, 22 February 2018 at 21:59:27 UTC, aberba wrote:
>> On Thursday, 22 February 2018 at 08:54:04 UTC, Joakim wrote:
>>> [...]
>>
>> That makes me very happy!! Very much appreciated.
>
> I've updated ldc master to use Yuxuan's druntime port, which means the upcoming ldc 1.8 release will likely be a viable Alpine/Musl cross-compiler out of the box, provided you give it a C/Musl cross-compiler/linker to work with, by using the bundled ldc-build-runtime tool:
>
> https://wiki.dlang.org/Building_LDC_runtime_libraries
>
> Cross-compiling has not been tested however: do people normally cross-compile to Alpine containers or build their software in Alpine itself?  If the latter, building ldc from master on Alpine/x64 3.7.0 passes all of the druntime/phobos stdlib unit tests but one, so you're good to go there, as long as you don't need a pre-built binary. Maybe we'll put one out for ldc with the upcoming 1.8 release.

I usually ship and compile code in Alpine itself. Once I have an ldc compiler with Alpine as base image,  I'm good to go. Some platforms like OpenShift will rebuild when a release is triggered in git master... Copying binary require some hacks.
February 25, 2018
On Sunday, 25 February 2018 at 16:51:09 UTC, yawniek wrote:
> great stuff, thank you! this will be very useful!
>
> Q: what would be needed to build a single binary (a la golang) that works in a FROM SCRATCH docker container?

I don't know, presumably you're referring to the static linking support Jacob mentioned earlier in this thread.  I have not tried that.

On Sunday, 25 February 2018 at 17:48:34 UTC, aberba wrote:
> I usually ship and compile code in Alpine itself. Once I have an ldc compiler with Alpine as base image,  I'm good to go. Some platforms like OpenShift will rebuild when a release is triggered in git master... Copying binary require some hacks.

OK, I will look at releasing a native ldc binary for Alpine with the upcoming 1.8 release.
March 01, 2018
On 2018-02-25 17:51, yawniek wrote:

> Q: what would be needed to build a single binary (a la golang) that
> works in a FROM SCRATCH docker container?

Build a completely statically linked binary by compiling using LDC and add the "-static" flag.

-- 
/Jacob Carlborg
March 05, 2018
On Sunday, 25 February 2018 at 22:12:38 UTC, Joakim wrote:
> On Sunday, 25 February 2018 at 16:51:09 UTC, yawniek wrote:
>> great stuff, thank you! this will be very useful!
>>
>> Q: what would be needed to build a single binary (a la golang) that works in a FROM SCRATCH docker container?
>
> I don't know, presumably you're referring to the static linking support Jacob mentioned earlier in this thread.  I have not tried that.
>
> On Sunday, 25 February 2018 at 17:48:34 UTC, aberba wrote:
>> I usually ship and compile code in Alpine itself. Once I have an ldc compiler with Alpine as base image,  I'm good to go. Some platforms like OpenShift will rebuild when a release is triggered in git master... Copying binary require some hacks.
>
> OK, I will look at releasing a native ldc binary for Alpine with the upcoming 1.8 release.

LDC 1.8 is out!
March 05, 2018
On Monday, 5 March 2018 at 14:34:44 UTC, aberba wrote:
> On Sunday, 25 February 2018 at 22:12:38 UTC, Joakim wrote:
>> On Sunday, 25 February 2018 at 16:51:09 UTC, yawniek wrote:
>>> great stuff, thank you! this will be very useful!
>>>
>>> Q: what would be needed to build a single binary (a la golang) that works in a FROM SCRATCH docker container?
>>
>> I don't know, presumably you're referring to the static linking support Jacob mentioned earlier in this thread.  I have not tried that.
>>
>> On Sunday, 25 February 2018 at 17:48:34 UTC, aberba wrote:
>>> I usually ship and compile code in Alpine itself. Once I have an ldc compiler with Alpine as base image,  I'm good to go. Some platforms like OpenShift will rebuild when a release is triggered in git master... Copying binary require some hacks.
>>
>> OK, I will look at releasing a native ldc binary for Alpine with the upcoming 1.8 release.
>
> LDC 1.8 is out!

The Alpine build is up, let me know if you have any problems.  Note the changelog entry that says you'll need to install llvm and maybe other packages from the Alpine package manager first.