1dune-exec(1) Dune Manual dune-exec(1)
2
3
4
6 dune-exec - Execute a command in a similar environment as if
7 installation was performed.
8
10 dune exec [OPTION]... PROG [ARGS]...
11
13 dune exec -- COMMAND should behave in the same way as if you do:
14
15 $ dune install
16 $ COMMAND
17
18 In particular if you run dune exec ocaml, you will have access to the
19 libraries defined in the workspace using your usual directives
20 (#require for instance)
21
22 When a leading / is present in the command (absolute path), then the
23 path is interpreted as an absolute path
24
25 When a / is present at any other position (relative path), then the
26 path is interpreted as relative to the build context + current working
27 directory (or the value of --root when ran outside of the project root)
28
30 --context=CONTEXT (absent=default)
31 Run the command in this build context.
32
33 -f, --force
34 Force actions associated to aliases to be re-executed even if their
35 dependencies haven't changed.
36
37 --help[=FMT] (default=auto)
38 Show this help in format FMT. The value FMT must be one of `auto',
39 `pager', `groff' or `plain'. With `auto', the format is `pager` or
40 `plain' whenever the TERM env var is `dumb' or undefined.
41
42 --no-build
43 don't rebuild target before executing
44
45 --version
46 Show version information.
47
49 These options are common to all commands.
50
51 --auto-promote
52 Automatically promote files. This is similar to running dune
53 promote after the build.
54
55 --build-dir=FILE (absent DUNE_BUILD_DIR env)
56 Specified build directory. _build if unspecified
57
58 --config-file=FILE
59 Load this configuration file instead of the default one.
60
61 --debug-backtraces
62 Always print exception backtraces.
63
64 --debug-dependency-path
65 In case of error, print the dependency path from the targets on the
66 command line to the rule that failed.
67
68 --debug-findlib
69 Debug the findlib sub-system.
70
71 --default-target=TARGET
72 Set the default target that when none is specified to dune build.
73 It defaults to @@default.
74
75 --dev
76 Same as --profile dev
77
78 --diff-command=VAL
79 Shell command to use to diff files
80
81 --display=MODE
82 Control the display mode of Dune. See dune-config(5) for more
83 details.
84
85 --ignore-promoted-rules
86 Ignore rules with (mode promote)
87
88 -j JOBS
89 Run no more than JOBS commands simultaneously.
90
91 --no-buffer
92 Do not buffer the output of commands executed by dune. By default
93 dune buffers the output of subcommands, in order to prevent
94 interleaving when multiple commands are executed in parallel.
95 However, this can be an issue when debugging long running tests.
96 With --no-buffer, commands have direct access to the terminal. Note
97 that as a result their output won't be captured in the log file.
98 You should use this option in conjunction with -j 1, to avoid
99 interleaving. Additionally you should use --verbose as well, to
100 make sure that commands are printed before they are being executed.
101
102 --no-config
103 Do not load the configuration file
104
105 --only-packages=PACKAGES
106 Ignore stanzas referring to a package that is not in PACKAGES.
107 PACKAGES is a comma-separated list of package names. Note that this
108 has the same effect as deleting the relevant stanzas from jbuild
109 files. It is mostly meant for releases. During development, it is
110 likely that what you want instead is to build a particular
111 <package>.install target.
112
113 -p PACKAGES, --for-release-of-packages=PACKAGES
114 Shorthand for --root . --only-packages PACKAGE --promote ignore
115 --no-config --profile release. You must use this option in your
116 <package>.opam files, in order to build only what's necessary when
117 your project contains multiple packages as well as getting
118 reproducible builds.
119
120 --profile=VAL
121 Select the build profile, for instance dev or release. The default
122 is dev.
123
124 --root=DIR
125 Use this directory as workspace root instead of guessing it. Note
126 that this option doesn't change the interpretation of targets given
127 on the command line. It is only intended for scripts.
128
129 --verbose
130 Same as --display verbose
131
132 --workspace=FILE
133 Use this specific workspace file instead of looking it up.
134
135 -x VAL
136 Cross-compile using this toolchain.
137
139 Use `dune COMMAND --help' for help on a single command.
140
142 These environment variables affect the execution of exec:
143
144 DUNE_BUILD_DIR
145 Specified build directory. _build if unspecified
146
148 Check bug reports at https://github.com/ocaml/dune/issues
149
150
151
152Dune 11VERSION11 dune-exec(1)