Forward build system, with caching and speculation


Version on this page:0.1@rev:1
LTS Haskell 22.22:0.2
Stackage Nightly 2024-05-16:0.2
Latest on Hackage:0.2

See all snapshots rattle appears in

BSD-3-Clause licensed and maintained by Neil Mitchell
This version can be pinned in stack with:rattle-0.1@sha256:9ce94472a49b72cee4cb7b19d437b14c610efcdea7cf53a079972c24688af4de,2063

Module documentation for 0.1

Rattle Hackage version Stackage version Linux build status Windows build status

A very early prototype of a unique build system.

A forward based build system, where you can make calls to cmd. These are:

  1. Skipped if their inputs/outputs haven’t changed
  2. Have their outputs copied in if only the outputs have changed
  3. Can be speculated in advance

The innovation over something like Fabricate is that I have a notion of hazards - if two rules write to the same file, or one writes after another reads, I consider that a build hazard and throw an error - the result is no longer consistent. For speculation, I just run commands that look useful and don’t look like they’ll cause a hazard. If speculation does cause a hazard, I give up and try again without speculation.

This build system fundamentally relies on tracing the files used by system commands, and currently uses the fsatrace program to do so, which must be installed. As a consequence of the design, if fsatrace fails, then rattle won’t work properly. Example reasons that fsatrace might fail include:

  • If you use Go compiled binaries on Linux or Mac then it’s unlikely to be traced, see Issue 24.
  • If you a Mac OS X 1.10 or higher then system binaries that themselves invoke system binaries they won’t be traced, unless you disable System Integrity Protection (which you do at your own risk).
  • If you use statically linked binaries on Linux they probably won’t be traced.

It is possible to write alternative tracing mechanisms that wouldn’t have these limitations, for example:

  • Bigbro uses ptrace so works for Go binaries and statically linked binaries.
  • traced-fs is an unfinished file system tracer that implements a user file system that would also work for Go binaries and static linking.


Changelog for Rattle (* = breaking change)

0.1, released 2019-04-17
Initial version, not ready for public use