github.com/ocaml/dune ↗
A composable build system for OCaml.
Open this visualization on its own page →
Contributors
151
Lines of Code
40,080
From
2016-10-30
To
2021-01-08
About ocaml/dune
Dune is a composable build system for OCaml that automates the low-level details of compilation. Users provide simple project descriptions in dune files using S-expression syntax, and Dune handles setup of build rules, configuration for development tools like Merlin, installation, and parallel builds across all platforms. The system has no external dependencies beyond OCaml itself and works seamlessly on Windows through the standard console.
The project's core strength is composability, allowing multiple Dune projects to combine into a single build and enabling monorepos and simultaneous development across packages. Dune gracefully handles multi-package repositories by correctly resolving libraries that may exist both in the source tree and as previously installed packages. It also supports building the same codebase against multiple OCaml versions and configurations simultaneously, which is particularly useful for cross-compilation and maintaining compatibility across OCaml releases.
Dune is mature and heavily used in production, having evolved from build practices at Jane Street and been refined through daily use by hundreds of developers. It requires OCaml 4.14.0 or later to build itself, but can build projects targeting OCaml 4.02.3 and above. Installation is straightforward via opam or manual compilation, and the resulting dune binary is fully relocatable.