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

NAME

6       dune-top - Print a list of toplevel directives for including
7       directories and loading cma files.
8

SYNOPSIS

10       dune top [OPTION]… [DIR]
11

DESCRIPTION

13       Print a list of toplevel directives for including directories and
14       loading cma files.
15
16       The output of dune toplevel-init-file should be evaluated in a toplevel
17       to make a library available there.
18

OPTIONS

20       --action-stderr-on-success=VAL
21           Same as --action-stdout-on-success but for the standard output for
22           error messages. A good default for large mono-repositories is
23           --action-stdout-on-success=swallow
24           --action-stderr-on-success=must-be-empty. This ensures that a
25           successful build has a "clean" empty output.
26
27       --action-stdout-on-success=VAL
28           Specify how to deal with the standard output of actions when they
29           succeed. Possible values are: print to just print it to Dune's
30           output, swallow to completely ignore it and must-be-empty to
31           enforce that the action printed nothing. With must-be-empty, Dune
32           will consider that the action failed if it printed something to its
33           standard output. The default is print.
34
35       --build-info
36           Show build information.
37
38       --context=CONTEXT (absent=default)
39           Select context where to build/run utop.
40
41       --display-separate-messages
42           Separate error messages with a blank line.
43
44       --error-reporting=VAL (absent=deterministic)
45           Controls when the build errors are reported. early - report errors
46           as soon as they are discovered. deterministic - report errors at
47           the end of the build in a deterministic order. twice - report each
48           error twice: once as soon as the error is discovered and then again
49           at the end of the build, in a deterministic order.
50
51       -f, --force
52           Force actions associated to aliases to be re-executed even if their
53           dependencies haven't changed.
54
55       --file-watcher=VAL (absent=automatic)
56           Mechanism to detect changes in the source. Automatic to make dune
57           run an external program to detect changes. Manual to notify dune
58           that files have changed manually."
59
60       --passive-watch-mode
61           Similar to [--watch], but only start a build when instructed
62           externally by an RPC.
63
64       --react-to-insignificant-changes
65           react to insignificant file system changes; this is only useful for
66           benchmarking dune
67
68       --sandbox=VAL (absent DUNE_SANDBOX env)
69           Sandboxing mode to use by default. Some actions require a certain
70           sandboxing mode, so they will ignore this setting. The allowed
71           values are: none, symlink, copy, hardlink.
72
73       -w, --watch
74           Instead of terminating build after completion, wait continuously
75           for file changes.
76
77       --wait-for-filesystem-clock
78           Dune digest file contents for better incrementally. These digests
79           are themselves cached. In some cases, Dune needs to drop some
80           digest cache entries in order for things to be reliable. This
81           option makes Dune wait for the file system clock to advance so that
82           it doesn't need to drop anything. You should probably not care
83           about this option; it is mostly useful for Dune developers to make
84           Dune tests of the digest cache more reproducible.
85

COMMON OPTIONS

87       These options are common to all commands.
88
89       --always-show-command-line
90           Always show the full command lines of programs executed by dune
91
92       --auto-promote
93           Automatically promote files. This is similar to running dune
94           promote after the build.
95
96       --build-dir=FILE (absent DUNE_BUILD_DIR env)
97           Specified build directory. _build if unspecified
98
99       --cache=VAL (absent DUNE_CACHE env)
100           Enable or disable Dune cache (either enabled or disabled). Default
101           is `disabled'.
102
103       --cache-check-probability=VAL (absent DUNE_CACHE_CHECK_PROBABILITY env)
104           Check build reproducibility by re-executing randomly chosen rules
105           and comparing their results with those stored in Dune cache. Note:
106           by increasing the probability of such checks you slow down the
107           build. The default probability is zero, i.e. no rules are checked.
108
109       --cache-storage-mode=VAL (absent DUNE_CACHE_STORAGE_MODE env)
110           Dune cache storage mode (one of auto, hardlink or copy). Default is
111           `auto'.
112
113       --config-file=FILE
114           Load this configuration file instead of the default one.
115
116       --debug-artifact-substitution
117           Print debugging info about artifact substitution
118
119       --debug-backtraces
120           Always print exception backtraces.
121
122       --debug-cache=VAL
123           Show debug messages on cache misses for the given cache layers.
124           Value is a comma-separated list of cache layer names. All available
125           cache layers: shared,workspace-local,fs.
126
127       --debug-dependency-path
128           In case of error, print the dependency path from the targets on the
129           command line to the rule that failed.
130
131       --debug-digests
132           Explain why Dune decides to re-digest some files
133
134       --debug-load-dir
135           Print debugging info about directory loading
136
137       --debug-store-digest-preimage
138           Store digest preimage for all computed digests, so that it's
139           possible to reverse them later, for debugging. The digests are
140           stored in the shared cache (see --cache flag) as values, even if
141           cache is otherwise disabled. This should be used only for
142           debugging, since it's slow and it litters the shared cache.
143
144       --default-target=TARGET (absent=@@default)
145           Set the default target that when none is specified to dune build.
146
147       --diff-command=VAL (absent DUNE_DIFF_COMMAND env)
148           Shell command to use to diff files. Use - to disable printing the
149           diff.
150
151       --disable-promotion (absent DUNE_DISABLE_PROMOTION env)
152           Disable all promotion rules
153
154       --display=MODE
155           Control the display mode of Dune. See dune-config(5) for more
156           details. Valid values for this option are progress, verbose, short,
157           quiet or tui.
158
159       --dump-gc-stats=FILE
160           Dump the garbage collector stats to a file after the build is
161           complete.
162
163       --dump-memo-graph=FILE
164           Dumps the dependency graph to a file after the build is complete
165
166       --dump-memo-graph-format=FORMAT (absent=gexf)
167           File format to be used when dumping dependency graph
168
169       --dump-memo-graph-with-timing
170           With --dump-memo-graph, will re-run each cached node in the Memo
171           graph after building and include the runtime in the output. Since
172           all nodes contain a cached value, this will measure just the
173           runtime of each node
174
175       --help[=FMT] (default=auto)
176           Show this help in format FMT. The value FMT must be one of auto,
177           pager, groff or plain. With auto, the format is pager or plain
178           whenever the TERM env var is dumb or undefined.
179
180       --ignore-promoted-rules
181           Ignore rules with (mode promote), except ones with (only ...). The
182           variable %{ignoring_promoted_rules} in dune files reflects whether
183           this option was passed or not.
184
185       --instrument-with=BACKENDS (absent DUNE_INSTRUMENT_WITH env)
186           "Enable instrumentation by BACKENDS. BACKENDS is a comma-separated
187           list of library names, each one of which must declare an
188           instrumentation backend.
189
190       -j JOBS
191           Run no more than JOBS commands simultaneously.
192
193       --no-buffer
194           Do not buffer the output of commands executed by dune. By default
195           dune buffers the output of subcommands, in order to prevent
196           interleaving when multiple commands are executed in parallel.
197           However, this can be an issue when debugging long running tests.
198           With --no-buffer, commands have direct access to the terminal. Note
199           that as a result their output won't be captured in the log file.
200           You should use this option in conjunction with -j 1, to avoid
201           interleaving. Additionally you should use --verbose as well, to
202           make sure that commands are printed before they are being executed.
203
204       --no-config
205           Do not load the configuration file
206
207       --no-print-directory
208           Suppress "Entering directory" messages
209
210       --only-packages=PACKAGES
211           Ignore stanzas referring to a package that is not in PACKAGES.
212           PACKAGES is a comma-separated list of package names. Note that this
213           has the same effect as deleting the relevant stanzas from dune
214           files. It is mostly meant for releases. During development, it is
215           likely that what you want instead is to build a particular
216           <package>.install target.
217
218       -p PACKAGES, --for-release-of-packages=PACKAGES (required)
219           Shorthand for --release --only-packages PACKAGE. You must use this
220           option in your <package>.opam files, in order to build only what's
221           necessary when your project contains multiple packages as well as
222           getting reproducible builds.
223
224       --print-metrics
225           Print out various performance metrics after every build
226
227       --profile=VAL (absent DUNE_PROFILE env)
228           Select the build profile, for instance dev or release. The default
229           is dev.
230
231       --promote-install-files[=VAL] (default=true)
232           Promote the generated <package>.install files to the source tree
233
234       --release
235           Put dune into a reproducible release mode. This is in fact a
236           shorthand for --root . --ignore-promoted-rules --no-config
237           --profile release --always-show-command-line
238           --promote-install-files --default-target @install
239           --require-dune-project-file. You should use this option for release
240           builds. For instance, you must use this option in your
241           <package>.opam files. Except if you already use -p, as -p implies
242           this option.
243
244       --require-dune-project-file[=VAL] (default=true)
245           Fail if a dune-project file is missing.
246
247       --root=DIR
248           Use this directory as workspace root instead of guessing it. Note
249           that this option doesn't change the interpretation of targets given
250           on the command line. It is only intended for scripts.
251
252       --store-orig-source-dir (absent DUNE_STORE_ORIG_SOURCE_DIR env)
253           Store original source location in dune-package metadata
254
255       --terminal-persistence=MODE
256           Changes how the log of build results are displayed to the console
257           between rebuilds while in --watch mode. Supported modes: preserve,
258           clear-on-rebuild, clear-on-rebuild-and-flush-history.
259
260       --trace-extended
261           Output extended trace data (requires trace-file)
262
263       --trace-file=FILE
264           Output trace data in catapult format (compatible with
265           chrome://tracing)
266
267       --verbose
268           Same as --display verbose
269
270       --version
271           Show version information.
272
273       --watch-exclusions=REGEX
274           Adds a POSIX regular expression that will exclude matching
275           directories from `dune build --watch`. The option
276           --watch-exclusions can be repeated to add multiple exclusions.
277           Semicolons can be also used as a separator. If no exclusions are
278           provided, then a standard set of exclusions is used; however, if
279           one or more --watch-exclusions are used, none of the standard
280           exclusions are used. The standard exclusions are: ^_opam /_opam
281           ^_esy /_esy ^\.#.* /\.#.* ~$ ^#[^#]*#$ /#[^#]*#$ ^4913$ /4913$
282           /.git /.hg :/windows
283
284       --workspace=FILE (absent DUNE_WORKSPACE env)
285           Use this specific workspace file instead of looking it up.
286
287       -x VAL
288           Cross-compile using this toolchain.
289

MORE HELP

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

EXIT STATUS

294       top exits with the following status:
295
296       0   on success.
297
298       1   if an error happened.
299
300       130 if it was interrupted by a signal.
301

ENVIRONMENT

303       These environment variables affect the execution of top:
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-TOP(1)
Impressum