1dune(1) Dune Manual dune(1)
2
3
4
6 dune - composable build system for OCaml
7
9 dune COMMAND ...
10
12 Dune is a build system designed for OCaml projects only. It focuses on
13 providing the user with a consistent experience and takes care of most
14 of the low-level details of OCaml compilation. All you have to do is
15 provide a description of your project and Dune will do the rest.
16
17 The scheme it implements is inspired from the one used inside Jane
18 Street and adapted to the open source world. It has matured over a long
19 time and is used daily by hundreds of developers, which means that it
20 is highly tested and productive.
21
23 build
24 Build the given targets, or all installable targets if none are
25 given.
26
27 clean
28 Clean the project.
29
30 compute
31 Compute internal function.
32
33 exec
34 Execute a command in a similar environment as if installation was
35 performed.
36
37 external-lib-deps
38 Print out external libraries needed to build the given targets.
39
40 format-dune-file
41 Format dune files
42
43 help
44 Additional Dune help
45
46 init
47 Initialize dune components
48
49 install
50 Install packages.
51
52 installed-libraries
53 Print out libraries installed on the system.
54
55 printenv
56 Print the environment of a directory
57
58 promote
59 Promote files from the last run
60
61 rules
62 Dump internal rules.
63
64 runtest
65 Run tests.
66
67 subst
68 Substitute watermarks in source files.
69
70 uninstall
71 Uninstall packages.
72
73 upgrade
74 Upgrade jbuilder projects to dune
75
76 utop
77 Load library in utop
78
80 --build-info
81 Show build information.
82
83 -f, --force
84 Force actions associated to aliases to be re-executed even if their
85 dependencies haven't changed.
86
87 --help[=FMT] (default=auto)
88 Show this help in format FMT. The value FMT must be one of `auto',
89 `pager', `groff' or `plain'. With `auto', the format is `pager` or
90 `plain' whenever the TERM env var is `dumb' or undefined.
91
92 --version
93 Show version information.
94
95 -w, --watch
96 Instead of terminating build after completion, wait continuously
97 for file changes.
98
100 These options are common to all commands.
101
102 --always-show-command-line
103 Always show the full command lines of programs executed by dune
104
105 --auto-promote
106 Automatically promote files. This is similar to running dune
107 promote after the build.
108
109 --build-dir=FILE (absent DUNE_BUILD_DIR env)
110 Specified build directory. _build if unspecified
111
112 --config-file=FILE
113 Load this configuration file instead of the default one.
114
115 --debug-backtraces
116 Always print exception backtraces.
117
118 --debug-dependency-path
119 In case of error, print the dependency path from the targets on the
120 command line to the rule that failed.
121
122 --debug-findlib
123 Debug the findlib sub-system.
124
125 --default-target=TARGET (absent=@@default)
126 Set the default target that when none is specified to dune build.
127
128 --dev
129 Same as --profile dev
130
131 --diff-command=VAL
132 Shell command to use to diff files. Use - to disable printing the
133 diff.
134
135 --display=MODE
136 Control the display mode of Dune. See dune-config(5) for more
137 details.
138
139 --ignore-promoted-rules
140 Ignore rules with (mode promote), except ones with (only ...). The
141 variable %{ignoring_promoted_rules} in dune files reflects whether
142 this option was passed or not.
143
144 -j JOBS
145 Run no more than JOBS commands simultaneously.
146
147 --no-buffer
148 Do not buffer the output of commands executed by dune. By default
149 dune buffers the output of subcommands, in order to prevent
150 interleaving when multiple commands are executed in parallel.
151 However, this can be an issue when debugging long running tests.
152 With --no-buffer, commands have direct access to the terminal. Note
153 that as a result their output won't be captured in the log file.
154 You should use this option in conjunction with -j 1, to avoid
155 interleaving. Additionally you should use --verbose as well, to
156 make sure that commands are printed before they are being executed.
157
158 --no-config
159 Do not load the configuration file
160
161 --no-print-directory
162 Suppress "Entering directory" messages
163
164 --only-packages=PACKAGES
165 Ignore stanzas referring to a package that is not in PACKAGES.
166 PACKAGES is a comma-separated list of package names. Note that this
167 has the same effect as deleting the relevant stanzas from jbuild
168 files. It is mostly meant for releases. During development, it is
169 likely that what you want instead is to build a particular
170 <package>.install target.
171
172 -p PACKAGES, --for-release-of-packages=PACKAGES
173 Shorthand for --root . --only-packages PACKAGE
174 --ignore-promoted-rules --no-config --profile release. You must use
175 this option in your <package>.opam files, in order to build only
176 what's necessary when your project contains multiple packages as
177 well as getting reproducible builds.
178
179 --profile=VAL (absent DUNE_PROFILE env)
180 Select the build profile, for instance dev or release. The default
181 is dev.
182
183 --root=DIR
184 Use this directory as workspace root instead of guessing it. Note
185 that this option doesn't change the interpretation of targets given
186 on the command line. It is only intended for scripts.
187
188 --store-orig-source-dir (absent DUNE_STORE_ORIG_SOURCE_DIR env)
189 Store original source location in dune-package metadata
190
191 --trace-file=FILE
192 Output trace data in catapult format (compatible with
193 chrome://tracing)
194
195 --verbose
196 Same as --display verbose
197
198 --workspace=FILE (absent DUNE_WORKSPACE env)
199 Use this specific workspace file instead of looking it up.
200
201 -x VAL
202 Cross-compile using this toolchain.
203
205 Use `dune COMMAND --help' for help on a single command.
206
208 These environment variables affect the execution of dune:
209
210 DUNE_BUILD_DIR
211 Specified build directory. _build if unspecified
212
213 DUNE_PROFILE
214 Build profile. dev if unspecified or release if -p is set.
215
216 DUNE_STORE_ORIG_SOURCE_DIR
217 Store original source location in dune-package metadata
218
219 DUNE_WORKSPACE
220 Use this specific workspace file instead of looking it up.
221
223 Check bug reports at https://github.com/ocaml/dune/issues
224
225
226
227Dune n/a dune(1)