Reggae: a metabuild system in D (Daniel, you should read this). Now with more dub. And package builds.

Atila Neves via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Tue Jun 2 06:45:39 PDT 2015


http://code.dlang.org/packages/reggae

Daniel: see last paragraph (see, I mentioned your name! ;) )

Let's see if I can explain it better this time. Reggae is:

. An executable and a library of data definitions to describe 
build systems declaratively, in D. It also allows for imperative 
code when needed, since the definition language is D
. A collection of low-level primitives to describe a build DAG, 
making completely arbitrary builds possible
. A collection of high-level convenience rules for C, C++ and D 
builds
. The high-level D rules provide a per-package compilation model 
by default, but there's a command-line switch to build per file
. Automatic dependency tracking for C, C++ and D builds
. Integrates with dub for package management, reggae delegates to 
it
. An API to use dub project configurations, builds and source 
files
. A seamless way to get out-of-tree builds with make or ninja for 
dub projects. No configuration needed! Simply type `reggae -b 
make /path/to/project` or `reggae -b ninja /path/to/project` from 
where you want to build it and that's that.

Reggae depends on `dub describe` to get the information from dub 
it requires to generate a build system. Unfortunately, "dub 
describe" is currently buggy for `dub.json` files with 
configurations, which are most of them. Fortunately, I fixed the 
bug and there's an open pull request at 
https://github.com/D-Programming-Language/dub/pull/577. If it 
doesn't work for you, clone my repo, build the dub version from 
there and make sure it's in your `PATH` when you run reggae. If 
your project happens to not have configurations in your dub.json, 
the latest dub release should work just fine.

You should get faster builds out of the box. I have to run more 
tests, but using the Ninja backend I managed to do a build of 
vibe.d 2x faster after changing `core.d` than the equivalent 
build using dub. I guess YMMV and is probably especially 
dependent on how many

Please try to use it and complain about the API so I (we?) can 
make it better. This for me is the bare minimum to make it work; 
there are several open questions I have myself, who knows what'd 
happen if someone were to use this for an actual production 
build. I'd write a blog about it but it's early days methinks.

I'm going to try and make the JSON dependency a compile-time 
option so that a version of reggae can be built that doesn't 
support dub. I'm also going to see if I can get a binary backend 
going that isn't particularly fast but works; the idea being to 
not depend on make, ninja, or in the future, tup.

Atila


More information about the Digitalmars-d-announce mailing list