1DUNE-RULES(1) Dune Manual DUNE-RULES(1)
2
3
4
6 dune-rules - Dump internal rules.
7
9 dune rules [OPTION]… [TARGET]…
10
12 Dump Dune internal rules for the given targets. If no targets are
13 given, dump all the internal rules.
14
15 By default the output is a list of S-expressions, one S-expression per
16 rule. Each S-expression is of the form:
17
18 ((deps (<dependencies>))
19 (targets (<targets>))
20 (context <context-name>)
21 (action <action>))
22
23 <context-name> is the context is which the action is executed. It is
24 omitted if the action is independent from the context.
25
26 <action> is the action following the same syntax as user actions, as
27 described in the manual.
28
30 --action-stderr-on-success=VAL
31 Same as --action-stdout-on-success but for the standard output for
32 error messages. A good default for large mono-repositories is
33 --action-stdout-on-success=swallow
34 --action-stderr-on-success=must-be-empty. This ensures that a
35 successful build has a "clean" empty output.
36
37 --action-stdout-on-success=VAL
38 Specify how to deal with the standard output of actions when they
39 succeed. Possible values are: print to just print it to Dune's
40 output, swallow to completely ignore it and must-be-empty to
41 enforce that the action printed nothing. With must-be-empty, Dune
42 will consider that the action failed if it printed something to its
43 standard output. The default is print.
44
45 --build-info
46 Show build information.
47
48 --error-reporting=VAL (absent=deterministic)
49 Controls when the build errors are reported. early - report errors
50 as soon as they are discovered. deterministic - report errors at
51 the end of the build in a deterministic order. twice - report each
52 error twice: once as soon as the error is discovered and then again
53 at the end of the build, in a deterministic order.
54
55 -f, --force
56 Force actions associated to aliases to be re-executed even if their
57 dependencies haven't changed.
58
59 --file-watcher=VAL (absent=automatic)
60 Mechanism to detect changes in the source. Automatic to make dune
61 run an external program to detect changes. Manual to notify dune
62 that files have changed manually."
63
64 -m, --makefile
65 Output the rules in Makefile syntax.
66
67 -o FILE
68 Output to a file instead of stdout.
69
70 --passive-watch-mode
71 Similar to [--watch], but only start a build when instructed
72 externally by an RPC.
73
74 -r, --recursive
75 Print all rules needed to build the transitive dependencies of the
76 given targets.
77
78 --react-to-insignificant-changes
79 react to insignificant file system changes; this is only useful for
80 benchmarking dune
81
82 --sandbox=VAL (absent DUNE_SANDBOX env)
83 Sandboxing mode to use by default. Some actions require a certain
84 sandboxing mode, so they will ignore this setting. The allowed
85 values are: none, symlink, copy, hardlink.
86
87 -w, --watch
88 Instead of terminating build after completion, wait continuously
89 for file changes.
90
91 --wait-for-filesystem-clock
92 Dune digest file contents for better incrementally. These digests
93 are themselves cached. In some cases, Dune needs to drop some
94 digest cache entries in order for things to be reliable. This
95 option makes Dune wait for the file system clock to advance so that
96 it doesn't need to drop anything. You should probably not care
97 about this option; it is mostly useful for Dune developers to make
98 Dune tests of the digest cache more reproducible.
99
101 These options are common to all commands.
102
103 --always-show-command-line
104 Always show the full command lines of programs executed by dune
105
106 --auto-promote
107 Automatically promote files. This is similar to running dune
108 promote after the build.
109
110 --build-dir=FILE (absent DUNE_BUILD_DIR env)
111 Specified build directory. _build if unspecified
112
113 --cache=VAL (absent DUNE_CACHE env)
114 Enable or disable Dune cache (either enabled or disabled). Default
115 is `disabled'.
116
117 --cache-check-probability=VAL (absent DUNE_CACHE_CHECK_PROBABILITY env)
118 Check build reproducibility by re-executing randomly chosen rules
119 and comparing their results with those stored in Dune cache. Note:
120 by increasing the probability of such checks you slow down the
121 build. The default probability is zero, i.e. no rules are checked.
122
123 --cache-storage-mode=VAL (absent DUNE_CACHE_STORAGE_MODE env)
124 Dune cache storage mode (one of auto, hardlink or copy). Default is
125 `auto'.
126
127 --config-file=FILE
128 Load this configuration file instead of the default one.
129
130 --debug-artifact-substitution
131 Print debugging info about artifact substitution
132
133 --debug-backtraces
134 Always print exception backtraces.
135
136 --debug-cache=VAL
137 Show debug messages on cache misses for the given cache layers.
138 Value is a comma-separated list of cache layer names. All available
139 cache layers: shared,workspace-local,fs.
140
141 --debug-dependency-path
142 In case of error, print the dependency path from the targets on the
143 command line to the rule that failed.
144
145 --debug-digests
146 Explain why Dune decides to re-digest some files
147
148 --debug-load-dir
149 Print debugging info about directory loading
150
151 --debug-store-digest-preimage
152 Store digest preimage for all computed digests, so that it's
153 possible to reverse them later, for debugging. The digests are
154 stored in the shared cache (see --cache flag) as values, even if
155 cache is otherwise disabled. This should be used only for
156 debugging, since it's slow and it litters the shared cache.
157
158 --default-target=TARGET (absent=@@default)
159 Set the default target that when none is specified to dune build.
160
161 --diff-command=VAL (absent DUNE_DIFF_COMMAND env)
162 Shell command to use to diff files. Use - to disable printing the
163 diff.
164
165 --disable-promotion (absent DUNE_DISABLE_PROMOTION env)
166 Disable all promotion rules
167
168 --display=MODE
169 Control the display mode of Dune. See dune-config(5) for more
170 details. Valid values for this option are One of progress, verbose,
171 short or quiet
172
173 --dump-memo-graph=FILE
174 Dumps the dependency graph to a file after the build is complete
175
176 --dump-memo-graph-format=FORMAT (absent=gexf)
177 File format to be used when dumping dependency graph
178
179 --dump-memo-graph-with-timing
180 With --dump-memo-graph, will re-run each cached node in the Memo
181 graph after building and include the runtime in the output. Since
182 all nodes contain a cached value, this will measure just the
183 runtime of each node
184
185 --help[=FMT] (default=auto)
186 Show this help in format FMT. The value FMT must be one of auto,
187 pager, groff or plain. With auto, the format is pager or plain
188 whenever the TERM env var is dumb or undefined.
189
190 --ignore-promoted-rules
191 Ignore rules with (mode promote), except ones with (only ...). The
192 variable %{ignoring_promoted_rules} in dune files reflects whether
193 this option was passed or not.
194
195 --instrument-with=BACKENDS (absent DUNE_INSTRUMENT_WITH env)
196 "Enable instrumentation by BACKENDS. BACKENDS is a comma-separated
197 list of library names, each one of which must declare an
198 instrumentation backend.
199
200 -j JOBS
201 Run no more than JOBS commands simultaneously.
202
203 --no-buffer
204 Do not buffer the output of commands executed by dune. By default
205 dune buffers the output of subcommands, in order to prevent
206 interleaving when multiple commands are executed in parallel.
207 However, this can be an issue when debugging long running tests.
208 With --no-buffer, commands have direct access to the terminal. Note
209 that as a result their output won't be captured in the log file.
210 You should use this option in conjunction with -j 1, to avoid
211 interleaving. Additionally you should use --verbose as well, to
212 make sure that commands are printed before they are being executed.
213
214 --no-config
215 Do not load the configuration file
216
217 --no-print-directory
218 Suppress "Entering directory" messages
219
220 --only-packages=PACKAGES
221 Ignore stanzas referring to a package that is not in PACKAGES.
222 PACKAGES is a comma-separated list of package names. Note that this
223 has the same effect as deleting the relevant stanzas from dune
224 files. It is mostly meant for releases. During development, it is
225 likely that what you want instead is to build a particular
226 <package>.install target.
227
228 -p PACKAGES, --for-release-of-packages=PACKAGES (required)
229 Shorthand for --release --only-packages PACKAGE. You must use this
230 option in your <package>.opam files, in order to build only what's
231 necessary when your project contains multiple packages as well as
232 getting reproducible builds.
233
234 --print-metrics
235 Print out various performance metrics after every build
236
237 --profile=VAL (absent DUNE_PROFILE env)
238 Select the build profile, for instance dev or release. The default
239 is dev.
240
241 --promote-install-files[=VAL] (default=true)
242 Promote the generated <package>.install files to the source tree
243
244 --release
245 Put dune into a reproducible release mode. This is in fact a
246 shorthand for --root . --ignore-promoted-rules --no-config
247 --profile release --always-show-command-line
248 --promote-install-files --default-target @install
249 --require-dune-project-file. You should use this option for release
250 builds. For instance, you must use this option in your
251 <package>.opam files. Except if you already use -p, as -p implies
252 this option.
253
254 --require-dune-project-file[=VAL] (default=true)
255 Fail if a dune-project file is missing.
256
257 --root=DIR
258 Use this directory as workspace root instead of guessing it. Note
259 that this option doesn't change the interpretation of targets given
260 on the command line. It is only intended for scripts.
261
262 --store-orig-source-dir (absent DUNE_STORE_ORIG_SOURCE_DIR env)
263 Store original source location in dune-package metadata
264
265 --terminal-persistence=MODE
266 Changes how the log of build results are displayed to the console
267 between rebuilds while in --watch mode. Supported modes: preserve,
268 clear-on-rebuild, clear-on-rebuild-and-flush-history.
269
270 --trace-file=FILE
271 Output trace data in catapult format (compatible with
272 chrome://tracing)
273
274 --verbose
275 Same as --display verbose
276
277 --version
278 Show version information.
279
280 --workspace=FILE (absent DUNE_WORKSPACE env)
281 Use this specific workspace file instead of looking it up.
282
283 -x VAL
284 Cross-compile using this toolchain.
285
287 Use `dune COMMAND --help' for help on a single command.
288
290 rules exits with the following status:
291
292 0 on success.
293
294 123 on indiscriminate errors reported on standard error.
295
296 124 on command line parsing errors.
297
298 125 on unexpected internal errors (bugs).
299
301 These environment variables affect the execution of rules:
302
303 DUNE_BUILD_DIR
304 Specified build directory. _build if unspecified
305
306 DUNE_CACHE
307 Enable or disable Dune cache (either enabled or disabled). Default
308 is `disabled'.
309
310 DUNE_CACHE_CHECK_PROBABILITY
311 Check build reproducibility by re-executing randomly chosen rules
312 and comparing their results with those stored in Dune cache. Note:
313 by increasing the probability of such checks you slow down the
314 build. The default probability is zero, i.e. no rules are checked.
315
316 DUNE_CACHE_STORAGE_MODE
317 Dune cache storage mode (one of auto, hardlink or copy). Default is
318 `auto'.
319
320 DUNE_DIFF_COMMAND
321 Shell command to use to diff files. Use - to disable printing the
322 diff.
323
324 DUNE_DISABLE_PROMOTION
325 Disable all promotion rules
326
327 DUNE_INSTRUMENT_WITH
328 "Enable instrumentation by BACKENDS. BACKENDS is a comma-separated
329 list of library names, each one of which must declare an
330 instrumentation backend.
331
332 DUNE_PROFILE
333 Build profile. dev if unspecified or release if -p is set.
334
335 DUNE_SANDBOX
336 Sandboxing mode to use by default. (see --sandbox)
337
338 DUNE_STORE_ORIG_SOURCE_DIR
339 Store original source location in dune-package metadata
340
341 DUNE_WORKSPACE
342 Use this specific workspace file instead of looking it up.
343
345 Check bug reports at https://github.com/ocaml/dune/issues
346
348 dune(1)
349
350
351
352Dune n/a DUNE-RULES(1)