Many dune projects contain a root Makefile. It is often only there for convenience, for the following reasons:
- there are many different build systems out there, all with a different CLI. If you have been hacking for a long time, the one true invocation you know is make && make install, possibly preceded by ./configure
- you often have a few common operations that are not part of the build and make <blah> is a good way to provide them
- make is shorter to type than dune build @install
The with-configure-step example shows one way to do it which preserves composability; i.e. it doesn't require manually running ./configure script when working on multiple projects at the same time.
It's possible using the topkg-jbuilder but it's not recommended. dune-release subsumes topkg-jbuilder and is specifically tailored to dune projects.
Dune is just a build system and considers publishing outside of its scope. However, the dune-release project is specifically designed for releasing dune projects to opam. We recommend using tool for publishing dune packages.
The dune-universe repository contains a snapshot of the latest versions of all opam packages depending on dune. It is therefore a useful reference to search through to find different approaches to constructing build rules.
jenga is a build system developed by Jane Street mainly for internal use. It was never usable outside of Jane Street, and hence not recommended for general use. It has no relationship to dune apart from dune being the successor to Jenga externally. Eventually, dune is expected to replace Jenga internally at Jane Street as well.
jbuilder
used to display warnings, but most of them would not stop the
build. But dune
makes all warnings fatal by default. This can be a
challenge when porting a codebase to dune
. There are two ways to make warnings
non-fatal:
- the
jbuilder
compatibility executable works even withdune
files. You can use it while some warnings remain, and then switch over to thedune
executable. This is the recommended way to handle the situation. - you can pass
--profile release
todune
. It will set up different compilation options that usually make sense for release builds, including making warnings non-fatal. This is done by default when installing packages from opam. - you can change the flags that are used by the
dev
profile by adding the following stanza to adune
file:
(env
(dev
(flags (:standard -warn-error -A))))
When dune
runs external commands, it redirects and saves their output and
displays it when they have completed. This ensures that there is no interleaving
when writing to the console.
But this might not be what the you want, for example when debugging a hanging build.
In that case, one can pass -j1 --no-buffer
so that the commands are directly
printed on the console (and the parallelism is disabled so that the output stays
readable).