Turtle

GitHub Action crates.io License

Clone of the Ninja build system written in Rust

Goals

Turtle is originally written for the Pen programming language. Therefore, we support only dynamic dependencies but not C/C++ header dependencies currently. Your contribution is welcome! 😄

Install

sh cargo install turtle-build

Usage

sh turtle

For more information, see turtle --help.

Compatibility

Turtle aims to support full syntax of the Ninja build files. It also supports basic command line arguments but is not going to implement all the original options (e.g. -t option.)

Syntax

Command line arguments

Others

Technical notes

Something different from the traditional build systems and notable in Turtle is that it solves parallel builds similar to parallel graph reduction naturally, where you modify graph structures in parallel and reduce it into a solution, thanks to an ecosystem of futures and stackless coroutines in Rust.

Here is how parallel builds work in Turtle:

  1. Turtle spawns futures for all builds of default targets.
  2. Depending on builds' configuration, they spawn more futures or resolve their futures.
  3. Those futures are scheduled and run in parallel by an asynchronous runtime in Rust.
  4. Builds complete when all the futures are resolved.

Currently, Turtle uses a topological sort algorithm only to detect dependency cycles but not for execution of build graphs.

Turtle is powered by the following neat projects and others!

Similar projects

License

Dual-licensed under MIT and Apache 2.0.