Build systems à la carte

Today I went to the talk “Build systems à la carte” of Andrey Mokhov. He presented the results of the identically named paper from last year authored by himself and his co-authors. The following links point to the paper and its related resources:

I had known about this paper from last year and I was excited to learn that Andrey was going to present this work at EPFL, Lausanne. In the next sections I summarize what I learned from the paper and the presentation.

Build systems

The study explores the design space of build systems such as Make, Ninja, Bazel. Interestingly, through the lens of this paper, systems like Excel and Docker can also be seen as build systems.

Typically we specify our builds as a set of rules: we tell how a given target is built out of its dependencies. The build system’s job is to bring a specified target up-to-date. Depending on the application domain a build system may have some of the following properties:

Classification space

Two key design choices are typically deeply wired in any build system:

  1. Scheduling: the order in which tasks are built
  2. Rebuilding: whether or not a task is rebuilt

Today’s most commonly used build systems can be classified along these two axes. Let’s see these two aspects in detail.

Scheduling strategies

Build systems use different strategies to execute the build tasks:

The chosen scheduling strategy has an effect on the properties of the resulting build system:

Rebuilding strategies

We find the following techniques to decide whether or not a task is rebuilt:

Again, picking a given rebuilding strategy has interesting consequences:

Executable build system models

After a detailed classification of build system the authors present executable Haskell code to model real-world build systems. The concrete implementations are broken down into two components: Scheduler and Rebuilder, Here are some models in their final form:

make = topological modTimeRebuilder
excel = restarting dirtyBitRebuilder
shake = suspending vtRebuilder
bazel = restartingQ ctRebuilder

It’s remarkable that the concepts presented in this work lead such succint implementations. The actual executable code can be found in this repository.


The work “Build systems à la carte” from Andrey Mokhov and his co-workers taught me a lot about how build systems work. It demonstrates the power of Haskell as a modeling language. I recommend you to read the paper and study the related resources shown at the beginning of this article.