dune-config(5)
π dune-config β configuring the dune build system π
okay bestie, so this is the dune-config(5) page from the Dune manual, and it's literally all about how you tell Dune what vibe to build in. let's get into it π«Ά
β¨ SYNOPSIS β¨
~/.config/dune/config
πΈ DESCRIPTION πΈ
so here's the tea: unless you pass --no-config or -p, Dune is gonna go read a configuration file from your user home directory. that file is how you control a whole bunch of different aspects of how Dune behaves. she's customizable like that π
the config file normally lives at ~/.config/dune/config on Unix systems, and at Local Settings/dune/config inside the User home directory on Windows. but ngl, you can point her at a different config file entirely with the --config-file option. main character choice, honestly.
the very first line of the file must be of the form (lang dune X.Y) where X.Y is the version of the dune language used in the file. no skipping this, it's giving mandatory β
the rest of the file has to be written in S-expression syntax and be composed of a list of stanzas. the sections below break down all the stanzas you've got available. periodt.
π CACHING π
Syntax: (cache ENABLED)
this stanza determines whether dune's build caching is enabled. see <https://dune.readthedocs.io/en/stable/caching.html> for details. valid values for ENABLED are enabled or disabled. that's it, that's the whole vibe check. π
π DISPLAY MODES π
Syntax: (display MODE)
this stanza controls how Dune reports what it's doing to you, the user. you can also set this from the command line via --display MODE, so pick your fighter. the following display modes are available:
progressβ this is the default! Dune shows and update a status line as build goals are being completed. iconic.quietβ only display errors. minimalism, but make it stressed.shortβ print one line per command being executed, with the binary name on the left and the reason it is being executed for on the right.verboseβ print the full command lines of programs being executed by Dune, with some colors to help differentiate programs.
heads up bestie: when the selected display mode isprogressand the output is not a terminal, then thequietmode is selected instead. plot twist!
that rule doesn't apply when running Dune inside Emacs, though. Dune detects whether it is executed from inside Emacs or not by looking at the environment variable INSIDE_EMACS that is set by Emacs. so if you want the same behavior with another editor, you can set this variable yourself. and if your editor already sets another variable, please open a ticket on the ocaml/dune GitHub project so that support for it can be added. they're literally asking, so go off π
π JOBS π
Syntax: (jobs NUMBER)
set the maximum number of jobs Dune might run in parallel. you can also set this from the command line via -j NUMBER. multitasking queen π
the default for this value is the number of processors.
π¦ SANDBOXING π¦
Syntax: (sandboxing_preference MODE ...)
controls the sandboxing mode preference order used by dune. Dune will use the earliest item from this list that's allowed by the action dependency specification, or fall back on the hard-coded default. see man dune-build for the description of individual modes. yes, you have to go read another manpage, i don't make the rules π
π BUGS π
found something cursed? check bug reports at <https://github.com/ocaml/dune/issues>. fr fr, that's where the receipts live.
and that's the whole page, bestie π this was the Dune manual's dune-config(5) β written by Dune themselves. go configure something cute β¨ππΈ
π¦ where this page comes from
- alpine 3.24: dune-doc 3.22.2-r1 Β· MIT
- arch rolling: dune 3.24.2-1 Β· MIT
- centos-stream 10: ocaml-dune 3.16.0-5.el10 Β· MIT AND ISC AND LGPL-2.0-only AND LGPL-2.0-only WITH OCaml-LGPL-linking-exception AND LGPL-2.1-or-later
- debian trixie: ocaml-dune 3.17.2-1+b1 Β· MIT
- fedora 43: ocaml-dune 3.20.2-1.fc43 Β· MIT AND BSD-2-Clause AND ISC AND LGPL-2.1-only AND LGPL-2.1-only WITH OCaml-LGPL-linking-exception AND LGPL-2.1-or-later
- fedora 44: ocaml-dune 3.22.0-1.fc44 Β· MIT AND BSD-2-Clause AND BSD-3-Clause AND ISC AND LGPL-2.1-only AND LGPL-2.1-only WITH OCaml-LGPL-linking-exception AND LGPL-2.1-or-later
- fedora 44: ocaml-dune 3.23.1-1.fc44 Β· MIT AND BSD-2-Clause AND BSD-3-Clause AND ISC AND LGPL-2.1-only AND LGPL-2.1-only WITH OCaml-LGPL-linking-exception AND LGPL-2.1-or-later
- nixos 26.05: dune 3.21.1
- nixpkgs unstable: dune 3.23.1
- opensuse-leap 16.0: ocaml-dune 3.19.1-160000.2.2 Β· MIT
- opensuse-leap 16.0: ocaml-dune 3.19.1-160000.2.2 Β· MIT
- opensuse-leap 16.0: ocaml-dune 3.19.1-160000.2.2 Β· MIT
- opensuse-leap 16.0: ocaml-dune 3.19.1-160000.2.2 Β· MIT
- ubuntu noble: ocaml-dune 3.14.0-1 Β· MIT
- ubuntu questing: ocaml-dune 3.17.2-1build1
- ubuntu resolute: ocaml-dune 3.20.2-3build3 Β· MIT
- ubuntu stonking: ocaml-dune 3.24.1-4 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms