Scroll to navigation

DUNE(1) Dune Manual DUNE(1)

NAME

dune - composable build system for OCaml

SYNOPSIS

dune build [--watch]

dune runtest [--watch]

dune exec NAME

dune utop [DIR]

dune install

dune init project NAME [PATH] [--libs=l1,l2 --ppx=p1,p2 --inline-tests]

DESCRIPTION

Dune is a build system designed for OCaml projects only. It focuses on providing the user with a consistent experience and takes care of most of the low-level details of OCaml compilation. All you have to do is provide a description of your project and Dune will do the rest.

The scheme it implements is inspired from the one used inside Jane Street and adapted to the open source world. It has matured over a long time and is used daily by hundreds of developers, which means that it is highly tested and productive.

COMMAND ALIASES

An alias for env.
An alias for promotion apply.
An alias for runtest.

COMMANDS

Build the given targets, or the default ones if none are given.
Manage Dune's shared cache of build artifacts.
Clean the project.
Command group related to Coq.
Describe the workspace.
Fetch and return errors from the current build.
Execute a command in a similar environment as if installation was performed.
Moved to dune describe external-lib-deps.
Format source code.
Format dune files.
Additional Dune help.
Command group for initializing Dune components.
Install packages defined in the workspace.
Print out libraries installed on the system.

Connect to a Dune RPC server and monitor it.
Command group related to OCaml.
Start a merlin configuration server.
Experimental package management
Control how changes are propagated back to source code.
Dune's RPC mechanism. Experimental.
Dump rules.
Run tests.
Command group for showing information about the workspace
Cancel and shutdown any builds in the current workspace.
Substitute watermarks in source files.
Print a list of toplevel directives for including directories and loading cma files.
Uninstall packages defined in the workspace.
Upgrade projects across major Dune versions.
Load library in utop.

COMMON OPTIONS

These options are common to all commands.

--help[=FMT] (default=auto)
Show this help in format FMT. The value FMT must be one of auto, pager, groff or plain. With auto, the format is pager or plain whenever the TERM env var is dumb or undefined.
--version
Show version information.

MORE HELP

Use `dune COMMAND --help' for help on a single command.

EXIT STATUS

dune exits with:

0
on success.
1
if an error happened.
130
if it was interrupted by a signal.

ENVIRONMENT

These environment variables affect the execution of dune:

If different than 0, ANSI colors are supported and should be used when the program isn't piped. If equal to 0, don't output ANSI color escape codes
If different than 0, ANSI colors should be enabled no matter what.
If set, determines the location of the machine-global shared cache.

BUGS

Check bug reports at https://github.com/ocaml/dune/issues

EXAMPLES

1.
Initialise a new project named `foo':


dune init project foo
2.
Build all targets in the current source tree:


dune build
3.
Run the executable named `bar':


dune exec bar
4.
Run all tests in the current source tree:


dune runtest
5.
Install all components defined in the project:


dune install
6.
Remove all build artefacts:


dune clean
Dune 3.15.0