The annoying D build system

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Nov 19 12:00:41 PST 2012


On 11/19/12 3:29 AM, Jacob Carlborg wrote:
> Is it just me that thinks the build system of D (DMD, Phobos, druntime,
> and so on) is really annoying. I'm mostly thinking of the directory
> structure that the makefiles expect.
>
> For example, when building Phobos it will also, automatically, build
> druntime, which it expects to find in the parent directory.

That's because phobos is dependent on druntime.

> Today I tried to build the dlang.org web site. The first thing that hit
> me was that it tried to build a complete release out of DMD by default.

That is because the current site docs must include the current druntime 
and phobos docs. In turn, those must be built with the currently 
released compiler. To automate all that, the build makes sure the latest 
released compiler is built and then the docs for the latest released 
libs are built.

Before that we were in the situation that updating the site was putting 
whatever was in the Phobos head (or worse, what was on the machine the 
site was built on).

> Sure that can be consider my fault since I didn't check what targets the
> makefile would run by default. But this makefile will also expect DMD,
> Phobos and so on to be in the parent directory. It will also expect that
> its own folder is named "d-programming-language.org". I renamed that to
> "dlang.org" since it's shorter and that's what the site is called these
> days, but that completely broke the makefile. The makefile is looking
> explicitly for a folder named "d-programming-language.org", i.e.
> "../d-programming-language.org/std.ddoc".

That's the name of the github project.

> I think it's really annoying, and slightly scary, that the build system
> breaks out of its own directory, doing things in the parent directory
> and expects a certain parent directory structure.

The makefiles have evolved organically out of clear and simple 
necessities. Also, they could use some love because there was more focus 
on solving specific automation issues, rather than on a globally nice 
system.

So if you have ideas on how to improve the above - great! Just don't 
fall for Chesterton's fence fallacy.


Andrei


More information about the Digitalmars-d mailing list