Best build tool for D projects

Nick Sabalausky a at a.a
Fri May 13 14:56:30 PDT 2011


"Chris Molozian" <chris at cmoz.me> wrote in message 
news:mailman.137.1305310099.14074.digitalmars-d at puremagic.com...
> Hey All,
>
> This is my first post to the mailing list, I'm an avid follower of D's
> development and am currently using it to develop a compiler for my
> thesis work. One of the goals of this stage of the development work is
> to provide a simple build environment to compile the codebase on Linux,
> Windows and Mac OS X. The only complex aspects of the build process is
> compiling the LLVM-D bindings and linking to LLVM.
>


Bu(il)d, rebuild and dsss are all old, out-of-date and abandoned.

Xfbuild is abandoned (unless someone else has picked up the reins since the 
original author left), and it doesn't work for D2.

I hate make with a passion, so I won't go near anything that requires make 
(such as CMake).

There are other good build systems that aren't targeted directly at D, like 
Rake, SCons and A-A-P. But A-A-P's documentation is very difficult to 
understand. Rake and SCons introduce a dependency on Ruby and Python, 
respectively. And none of them (to my knowledge) will find dependencies 
automatically, you have to keep track of every single D source file 
individually, which is a pointless pain in the ass.

But there is a good option: RDMD. There's a version of RDMD that comes with 
DMD, but it has a lot of bugs that have been around forever, and some of 
them are real blockers for using RDMD as a general D build tool. So I'd 
recommend using the patched version of RDMD I created:

http://www.dsource.org/projects/semitwist/wiki/WikiStart#RDMDSeemaTadBitrotted

Works great for me.

If you need to do more than just simply build a D executable with a specific 
configuration, I'd recommend using one of the following and just have them 
invoke RDMD instead of invoking DMD directly.

- Rake: I kind of like it despite the fact that it's Ruby instead of D.

- SCons: You use Python. A lot of people like it.

- STBuild: Included in my SemiTwist D Tools project:

http://www.dsource.org/projects/semitwist/

STBuild is nowhere near as fancy or powerful as Rake or SCons, and there's 
no real documentation other than the built-in "--help" screen. But it's 
simple, and it's good if you don't have any custom build steps and all you 
need to do is manage debug and release builds of multiple D-based targets. 
It uses RDMD internally (It can optionally use rebuild or xfbuild instead if 
you really want, and will even convert most commandline parameters between 
rdmd/rebuild/xfbuild). I have to be honest, though, my plan is to completely 
re-write STBuild as a D equivalent of Rake or SCons. But anyway, here are 
some example configuration files for STBuild:

http://www.dsource.org/projects/semitwist/browser/trunk/stbuild.conf
http://www.dsource.org/projects/goldie/browser/trunk/stbuild.conf






More information about the Digitalmars-d mailing list