A brief survey of build tools, focused on D

Neia Neutuladh neia at ikeran.org
Mon Dec 10 22:18:28 UTC 2018

On Mon, 10 Dec 2018 21:53:40 +0000, GoaLitiuM wrote:
> The results for touching second file seems like an anomaly to me,

The generated ninja file had one rule per source file. If your modules 
tend to import each other a lot, or if they transitively import the code 
that's doing expensive stuff, then one rule per source file is bad. If 
your modules have few transitive dependencies and they're each fast to 
compile, one rule per source file is good.

My project used Pegged, and a lot of stuff referenced the grammar. That 
meant incremental builds went long and it would have been better to build 
the whole project at once.

Separating the grammar into a different build would reduce compile times 
significantly, and that might make incremental builds fast.

>From discussions on IRC about reducing compile times, though, using Phobos 
is a good way to get slow compilation, and I use Phobos. That alone means 
incremental builds are likely to go long.

> You also have to make sure the dependencies are built with the same
> compiler, which could explain the headache #3 in your article.

I've been using dmd as my primary compiler for ages, cleared out all the 
cached dub builds I could find, ran `dub build -v` to ensure that it was 
invoking dmd, and explicitly told Meson to use dmd.

Meson was still convinced that I'd built pegged with some other compiler.

> The comparison and some of the other headaches with meson does not seem
> to be fair as you are comparing dub, which is both a build system and a
> package manager, to meson which is only a build system, you have to make
> sure all the dependencies are installed to your system beforehand.

That *would* be a reasonable objection, but Meson explicitly advertises 
that you can use dub dependencies. The two flaws are the extra work 
required and the fact that it's broken. If it had not even pretended to 
support dub dependencies, I could have avoided several of the problems and 
just used git submodules from the start.

Just like with Bazel.

More information about the Digitalmars-d-announce mailing list