Practical Problems with distribution D projects

Jakob Ovrum jakobovrum at gmail.com
Mon Feb 24 17:32:53 PST 2014


On Tuesday, 25 February 2014 at 01:21:03 UTC, Assaf Gordon wrote:
> 1.
> Packaging for source-based distribution (ie a "tarball"):
> I couldn't find a working autotools template (only few old 
> discussions),
> and so far it seems the best way is writing my own makefile 
> (which I have).
>
> My concern is that the parameters are so different between 
> dmd/gdc/ldc that I basically force the users to choose one.

GDC and LDC have gdmd/ldmd respectively, which wrap DMD-style 
command line arguments over the GCC/Clang-style arguments that 
`gdc` and `ldc` accept.

> I'm also not sure whether it will work on windows or not (I'm 
> developing on linux). For windows users, would a 
> custom,hand-written make file just work?

That depends almost entirely on the shell commands used in the 
target recipes. Also, it's easy to create reliance on a certain 
flavour of `make`, such as by using GNU-make-specific features; 
it's not a big problem though because GNU make is relatively easy 
to get on Windows through MinGW.

> Although "rdmd" is terrific, I would really prefer not to 
> require it (since it is 'dmd' specific and not free in the FOSS 
> sense).

`rdmd` itself should be free software, and supports `gdmd` and 
`ldmd` through the --compiler flag.

DMD itself is indeed not entirely free software.

> 2.
> How complicated it for potential users of the program to 
> install a D compiler?
>
> Based on my humble experience:
> dmd: fine, as long as the downloadable binary version works. I 
> tested only on multiple debians and ubuntus. But it's not free, 
> and it requires root privileges.
> gdc: only source code available, compiling is a bit tricky. 
> After compilation, it works.
> ldc: the pre-compiled version doesn't work on old Ubuntu (10.4) 
> or new Debian (7). The source code version is messy to compile 
> and I stopped after couple of tries.
>
> So, it seems, that if a random person (not unix expert) wants 
> to compiler my program, he/she will not have an easy time doing 
> so.

Maybe we should have a generic Linux binary package that 
statically links all dependencies, which would then be usable on 
a wide variety of Linux systems without requiring root privileges.

But are there really no packages of `gdc` and `ldc` in various 
package repositories? I haven't used D on Linux in a while, but I 
find that hard to believe.

> 3.
> Distributing Binaries:
> Since I already assume source distribution is not friendly, I 
> consider also making the pre-compiled binaries available for 
> download.
> But it looks like it's only possible to compile 
> dynamically-linked binaries.

I'm pretty sure the default still uses static linking, even with 
recent Linux releases? Either way, I'm sure there's a way to get 
the old behaviour. Dynamic linking of the runtime is a relatively 
recent ability.


More information about the Digitalmars-d mailing list