1DUNE-RULES(1)                     Dune Manual                    DUNE-RULES(1)
2
3
4

NAME

6       dune-rules - Dump internal rules.
7

SYNOPSIS

9       dune rules [OPTION]… [TARGET]…
10

DESCRIPTION

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

OPTIONS

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

COMMON OPTIONS

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-findlib
149           Debug the findlib sub-system.
150
151       --debug-load-dir
152           Print debugging info about directory loading
153
154       --debug-store-digest-preimage
155           Store digest preimage for all computed digests, so that it's
156           possible to reverse them later, for debugging. The digests are
157           stored in the shared cache (see --cache flag) as values, even if
158           cache is otherwise disabled. This should be used only for
159           debugging, since it's slow and it litters the shared cache.
160
161       --default-target=TARGET (absent=@@default)
162           Set the default target that when none is specified to dune build.
163
164       --diff-command=VAL (absent DUNE_DIFF_COMMAND env)
165           Shell command to use to diff files. Use - to disable printing the
166           diff.
167
168       --disable-promotion (absent DUNE_DISABLE_PROMOTION env)
169           Disable all promotion rules
170
171       --display=MODE
172           Control the display mode of Dune. See dune-config(5) for more
173           details.
174
175       --dump-memo-graph=FILE
176           Dumps the dependency graph to a file after the build is complete
177
178       --dump-memo-graph-format=FORMAT (absent=gexf)
179           File format to be used when dumping dependency graph
180
181       --dump-memo-graph-with-timing
182           With --dump-memo-graph, will re-run each cached node in the Memo
183           graph after building and include the runtime in the output. Since
184           all nodes contain a cached value, this will measure just the
185           runtime of each node
186
187       --help[=FMT] (default=auto)
188           Show this help in format FMT. The value FMT must be one of auto,
189           pager, groff or plain. With auto, the format is pager or plain
190           whenever the TERM env var is dumb or undefined.
191
192       --ignore-promoted-rules
193           Ignore rules with (mode promote), except ones with (only ...). The
194           variable %{ignoring_promoted_rules} in dune files reflects whether
195           this option was passed or not.
196
197       --instrument-with=BACKENDS (absent DUNE_INSTRUMENT_WITH env)
198           "Enable instrumentation by BACKENDS. BACKENDS is a comma-separated
199           list of library names, each one of which must declare an
200           instrumentation backend.
201
202       -j JOBS
203           Run no more than JOBS commands simultaneously.
204
205       --no-buffer
206           Do not buffer the output of commands executed by dune. By default
207           dune buffers the output of subcommands, in order to prevent
208           interleaving when multiple commands are executed in parallel.
209           However, this can be an issue when debugging long running tests.
210           With --no-buffer, commands have direct access to the terminal. Note
211           that as a result their output won't be captured in the log file.
212           You should use this option in conjunction with -j 1, to avoid
213           interleaving. Additionally you should use --verbose as well, to
214           make sure that commands are printed before they are being executed.
215
216       --no-config
217           Do not load the configuration file
218
219       --no-print-directory
220           Suppress "Entering directory" messages
221
222       --only-packages=PACKAGES
223           Ignore stanzas referring to a package that is not in PACKAGES.
224           PACKAGES is a comma-separated list of package names. Note that this
225           has the same effect as deleting the relevant stanzas from dune
226           files. It is mostly meant for releases. During development, it is
227           likely that what you want instead is to build a particular
228           <package>.install target.
229
230       -p PACKAGES, --for-release-of-packages=PACKAGES (required)
231           Shorthand for --release --only-packages PACKAGE. You must use this
232           option in your <package>.opam files, in order to build only what's
233           necessary when your project contains multiple packages as well as
234           getting reproducible builds.
235
236       --print-metrics
237           Print out various performance metrics after every build
238
239       --profile=VAL (absent DUNE_PROFILE env)
240           Select the build profile, for instance dev or release. The default
241           is dev.
242
243       --promote-install-files[=VAL] (default=true)
244           Promote the generated <package>.install files to the source tree
245
246       --release
247           Put dune into a reproducible release mode. This is in fact a
248           shorthand for --root . --ignore-promoted-rules --no-config
249           --profile release --always-show-command-line
250           --promote-install-files --default-target @install
251           --require-dune-project-file. You should use this option for release
252           builds. For instance, you must use this option in your
253           <package>.opam files. Except if you already use -p, as -p implies
254           this option.
255
256       --require-dune-project-file[=VAL] (default=true)
257           Fail if a dune-project file is missing.
258
259       --root=DIR
260           Use this directory as workspace root instead of guessing it. Note
261           that this option doesn't change the interpretation of targets given
262           on the command line. It is only intended for scripts.
263
264       --store-orig-source-dir (absent DUNE_STORE_ORIG_SOURCE_DIR env)
265           Store original source location in dune-package metadata
266
267       --terminal-persistence=MODE
268           Changes how the log of build results are displayed to the console
269           between rebuilds while in --watch mode. Supported modes: preserve,
270           clear-on-rebuild, clear-on-rebuild-and-flush-history.
271
272       --trace-file=FILE
273           Output trace data in catapult format (compatible with
274           chrome://tracing)
275
276       --verbose
277           Same as --display verbose
278
279       --version
280           Show version information.
281
282       --workspace=FILE (absent DUNE_WORKSPACE env)
283           Use this specific workspace file instead of looking it up.
284
285       -x VAL
286           Cross-compile using this toolchain.
287

MORE HELP

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

EXIT STATUS

292       rules exits with the following status:
293
294       0   on success.
295
296       123 on indiscriminate errors reported on standard error.
297
298       124 on command line parsing errors.
299
300       125 on unexpected internal errors (bugs).
301

ENVIRONMENT

303       These environment variables affect the execution of rules:
304
305       DUNE_BUILD_DIR
306           Specified build directory. _build if unspecified
307
308       DUNE_CACHE
309           Enable or disable Dune cache (either enabled or disabled). Default
310           is `disabled'.
311
312       DUNE_CACHE_CHECK_PROBABILITY
313           Check build reproducibility by re-executing randomly chosen rules
314           and comparing their results with those stored in Dune cache. Note:
315           by increasing the probability of such checks you slow down the
316           build. The default probability is zero, i.e. no rules are checked.
317
318       DUNE_CACHE_STORAGE_MODE
319           Dune cache storage mode (one of auto, hardlink or copy). Default is
320           `auto'.
321
322       DUNE_DIFF_COMMAND
323           Shell command to use to diff files. Use - to disable printing the
324           diff.
325
326       DUNE_DISABLE_PROMOTION
327           Disable all promotion rules
328
329       DUNE_INSTRUMENT_WITH
330           "Enable instrumentation by BACKENDS. BACKENDS is a comma-separated
331           list of library names, each one of which must declare an
332           instrumentation backend.
333
334       DUNE_PROFILE
335           Build profile. dev if unspecified or release if -p is set.
336
337       DUNE_SANDBOX
338           Sandboxing mode to use by default. (see --sandbox)
339
340       DUNE_STORE_ORIG_SOURCE_DIR
341           Store original source location in dune-package metadata
342
343       DUNE_WORKSPACE
344           Use this specific workspace file instead of looking it up.
345

BUGS

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

SEE ALSO

350       dune(1)
351
352
353
354Dune n/a                                                         DUNE-RULES(1)
Impressum