DUNE-MONITOR(1)
π DUNE-MONITOR(1) β Dune Manual π
okay bestie, welcome to the Dune manual, section 1. this is the page for dune-monitor, and it's a long one so buckle up, we're going section by section, no skips, no skimming, we're eating the whole plate π
β¨ NAME β¨
dune-monitor β connect to a Dune RPC server and monitor it.
π¦ SYNOPSIS π¦
dune monitor [OPTION]β¦
like. that's it. that's the whole vibe. you run it, you pass it options, it does the thing π
πΈ DESCRIPTION πΈ
so dune monitor connects to an RPC server that's already running in your current workspace, and then it justβ¦ shows you everything? the build progress, the diagnostics, the whole story. main character energy fr π
and here's the part that's lowkey iconic: if there's no server running, or the connection got dropped, it does not give up. it will continuously try to reconnect. it's giving devoted. it's giving "i'll wait for you." π«Ά
π OPTIONS π
--action-stderr-on-success=VALβ literally the same as--action-stdout-on-successexcept it's for standard error instead of standard output. and ngl, if you're working in a giant mono-repository, the chef's kiss combo is--action-stdout-on-success=swallowplus--action-stderr-on-success=must-be-empty. that way a successful build gets a "clean" empty output. no noise. just peace β¨--action-stdout-on-success=VALβ this lets you pick how Dune handles the standard output of actions when they succeed. the possible values are:print(just print it to Dune's output),swallow(completely ignore it), andmust-be-empty(enforce that the action printed literally nothing). withmust-be-empty, if the action printed anything at all to standard output, Dune is gonna consider that action failed. the default isprint.--build-infoβ show build information. that's it, that's the whole thing π--display-separate-messagesβ separate error messages with a blank line. breathing room between the chaos.--error-reporting=VAL(absent=deterministic) β controls when build errors get reported.earlyreports errors the moment they're discovered.deterministicreports them at the end of the build, in a deterministic order.twicereports each error twice β once right when it's discovered, and then again at the end of the build, in a deterministic order. (twice? yeah. twice. she's thorough.)-f,--forceβ force actions associated with aliases to be re-executed even if their dependencies haven't changed. don't care, doing it anyway π--file-watcher=VAL(absent=automatic) β the mechanism used to detect changes in the source.Automaticmakes dune run an external program to detect changes.Manualmeans you notify dune that files have changed, manually, with your own two hands.--passive-watch-modeβ like[--watch], but it only starts a build when it's instructed externally by an RPC. it waits. patiently. like a good listener π--quit-on-disconnectβ quit if the connection to the server is lost. no toxic reconnecting, we're walking away πͺ--sandbox=VAL(absentDUNE_SANDBOXenv) β set the sandboxing mode. heads up: some actions require a certain sandboxing mode, so they will straight-up ignore this setting. the allowed values are:none,symlink,copy,hardlink.--stop-on-first-errorβ stop the build the second an error shows up. no "let's see how bad it gets." just stop π-w,--watchβ instead of terminating the build after completion, wait continuously for file changes. she lives here now π--wait-for-filesystem-clockβ okay so Dune digests file contents for better incrementality, and those digests are themselves cached. in some cases Dune needs to drop some digest cache entries so things stay reliable. this option makes Dune wait for the file system clock to advance, so it doesn't need to drop anything. and honestly? you should probably not care about this option. it's mostly useful for Dune developers to make Dune tests of the digest cache more reproducible. iykyk π§
π COMMON OPTIONS π
--always-show-command-lineβ always show the full command lines of programs executed by dune. full transparency, no mystery π--auto-promoteβ automatically promote files. this is similar to runningdune promoteafter the build.--build-dir=FILE(absentDUNE_BUILD_DIRenv) β specified build directory._buildif unspecified.--cache=VAL(absentDUNE_CACHEenv) β enable or disable the Dune cache. one ofdisabled,enabled-except-user-rulesorenabled. default isenabled-except-user-rules.--cache-check-probability=VAL(absentDUNE_CACHE_CHECK_PROBABILITYenv) β check build reproducibility by re-executing randomly chosen rules and comparing their results with those stored in the Dune cache. note: by increasing the probability of such checks you slow down the build. the default probability is zero, i.e. no rules are checked. (zero. none. nothing is being checked. we're chill.)--cache-storage-mode=VAL(absentDUNE_CACHE_STORAGE_MODEenv) β Dune cache storage mode. one ofauto,hardlinkorcopy. default ishardlink.--config-file=FILEβ load this configuration file instead of the default one. you're special, you get a custom one π--debug-backtracesβ always print exception backtraces. the receipts, always.--debug-dependency-pathβ in case of error, print the dependency path from the targets on the command line to the rule that failed. follow the crumbs π--debug-package-logs(absentDUNE_DEBUG_PACKAGE_LOGSenv) β always print the standard logs when building packages.--default-target=TARGET(absent=@@default) β set the default target used when none is specified todune build.--diff-command=VAL(absentDUNE_DIFF_COMMANDenv) β shell command to use to diff files. use-to disable printing the diff.--disable-promotion(absentDUNE_DISABLE_PROMOTIONenv) β disable all promotion rules. the promotion pipeline is CLOSED π«--display=MODEβ control the display mode of Dune. seedune-config(5)for more details. valid values for this option areprogress,verbose,short,quietortui.--dump-gc-stats=FILEβ dump the garbage collector stats to a file after the build is complete. numbers. to a file. for later π--help[=FMT](default=auto) β show this help in formatFMT. the valueFMTmust be one ofauto,pager,grofforplain. withauto, the format ispagerorplainwhenever theTERMenv var isdumbor undefined.--ignore-promoted-rulesβ ignore rules with(mode promote), except ones with(only ...). the variable%{ignoring_promoted_rules}in dune files reflects whether this option was passed or not.--instrument-with=BACKENDS(absentDUNE_INSTRUMENT_WITHenv) β enable instrumentation byBACKENDS.BACKENDSis a comma-separated list of library names, each one of which must declare an instrumentation backend.-j JOBS(absentDUNE_JOBSenv) β run no more thanJOBScommands simultaneously.JOBSmust be a positive integer, orautoto auto-detect the number of cores (the default).--no-bufferβ do not buffer the output of commands executed by dune. by default dune buffers the output of subcommands, in order to prevent interleaving when multiple commands are executed in parallel. however, this can be an issue when debugging long running tests. with--no-buffer, commands have direct access to the terminal. note that as a result their output won't be captured in the log file. you should use this option in conjunction with-j 1, to avoid interleaving. additionally you should use--verboseas well, to make sure that commands are printed before they are being executed. (that's three options holding hands. a little trio π«Ά)--no-configβ do not load the configuration file.--no-print-directoryβ suppress "Entering directory" messages.--only-packages=PACKAGESβ ignore stanzas referring to a package that is not inPACKAGES.PACKAGESis a comma-separated list of package names. note that this has the same effect as deleting the relevant stanzas from dune files. it is mostly meant for releases. during development, it is likely that what you want instead is to build a particular<package>.installtarget.-p PACKAGES,--for-release-of-packages=PACKAGES(required) β shorthand for--release --pkg=disabled --only-packages PACKAGE. you must use this option in your<package>.opamfiles, in order to build only what's necessary when your project contains multiple packages, as well as getting reproducible builds.--pkg=VALβ enable or disable package management. the default behaviour depends on whether a lock directory exists.--profile=VAL(absentDUNE_PROFILEenv) β select the build profile, for instancedevorrelease. the default isdev.--promote-install-files[=VAL](default=true) β promote any generated<package>.installfiles to the source tree.--releaseβ put dune into a reproducible release mode. shorthand for--root . --ignore-promoted-rules --no-config --profile release --always-show-command-line --promote-install-files --require-dune-project-file --default-target @install. you should use this option for release builds. for instance, you must use this option in your<package>.opamfiles. except if you already use-p, as-pimplies this option.--require-dune-project-file[=VAL](default=true) β fail if adune-projectfile is missing.--root=DIR(absentDUNE_ROOTenv) β use this directory as workspace root instead of guessing it. note that this option doesn't change the interpretation of targets given on the command line. it is only intended for scripts. π§--store-orig-source-dir(absentDUNE_STORE_ORIG_SOURCE_DIRenv) β store original source location indune-packagemetadata.--target-exec=TOOLCHAIN=CMD(absentDUNE_TARGET_EXECenv) β wrapper command for running target binaries when cross-compiling. format:TOOLCHAIN=CMD(e.g.,'windows=wine').--terminal-persistence=MODEβ change how the log of build results are displayed to the console between rebuilds while in--watchmode. supported modes:preserve,clear-on-rebuild,clear-on-rebuild-and-flush-history.--trace-file=FILEβ output trace data in catapult format (compatible withchrome://tracing).--verboseβ same as--display verbose.--versionβ show version information.--watch-exclusions=REGEXβ adds a POSIX regular expression that will exclude matching directories fromdune build --watch. the option--watch-exclusionscan be repeated to add multiple exclusions. semicolons can be also used as a separator. if no exclusions are provided, then a standard set of exclusions is used; however, if one or more--watch-exclusionsare used, none of the standard exclusions are used. the standard exclusions are:^_opam /_opam ^_esy /_esy ^\.#.* /\.#.* ~$ ^#[^#]*#$ /#[^#]*#$ ^4913$ /4913$ /.git /.hg :/windows--workspace=FILE(absentDUNE_WORKSPACEenv) β use this specific workspace file instead of looking it up.-x VAL(absentDUNE_CROSS_TARGETenv) β cross-compile using this toolchain.
π EXIT STATUS π
dune monitor exits with:
0β on success. slay β¨1β if an error happened π130β if it was interrupted by a signal π
π ENVIRONMENT π
okay bestie so these environment variables literally change how monitor runs. set them in your shell, they vibe with the whole build, iykyk π
DUNE_BUILD_DIRβ the build directory you want. if you don't say anything, it's_build. no cap β¨DUNE_CACHEβ turns the Dune cache on or off. you gotta pick one ofdisabled,enabled-except-user-rulesorenabled. the default isenabled-except-user-rulesπDUNE_CACHE_CHECK_PROBABILITYβ this one checks whether your builds are reproducible by re-executing randomly chosen rules and comparing their results with the ones stored in the Dune cache. heads up bestie: bump the probability and your build gets slower, that's just how it is π. default probability is zero, meaning literally no rules get checked.DUNE_CACHE_STORAGE_MODEβ how the Dune cache stores stuff. one ofauto,hardlinkorcopy. default ishardlinkπDUNE_CROSS_TARGETβ cross-compile using this toolchain. periodt π¦DUNE_DEBUG_PACKAGE_LOGSβ always print the standard logs whenever you're building packages πDUNE_DIFF_COMMANDβ the shell command used to diff files. use-to disable printing the diff entirely πDUNE_DISABLE_PROMOTIONβ disables all the promotion rules. all of them. every single one πDUNE_INSTRUMENT_WITHβ enables instrumentation by BACKENDS. BACKENDS is a comma-separated list of library names, and every single one of them has to declare an instrumentation backend, no exceptions π₯DUNE_JOBSβ run no more than JOBS commands at the same time. JOBS has to be a positive integer, orautoto auto-detect the number of cores (that's the default btw) πDUNE_PROFILEβ the build profile. it'sdevif unspecified, orreleaseif-pis set πΈDUNE_ROOTβ use this directory as the workspace root instead of letting dune guess it. note that this doesn't change how targets given on the command line get interpreted, it's only meant for scripts. okay? okay π«ΆDUNE_SANDBOXβ the sandboxing mode to use by default. see--sandboxfor the deets πDUNE_STORE_ORIG_SOURCE_DIRβ store the original source location indune-packagemetadata β¨DUNE_TARGET_EXECβ a wrapper command for running target binaries when you're cross-compiling. the format isTOOLCHAIN=CMD(like, e.g.,'windows=wine') πDUNE_WORKSPACEβ use this specific workspace file instead of looking one up π
π SEE ALSO π
dune(1)β go read the main character's page, fr fr π
and that's the whole vibe check, bestie π this was Dune 3.24.1, the DUNE-MONITOR(1) page, and it ate, no crumbs. go forth and monitor, you absolute icon πβ¨π
π¦ where this page comes from
- ubuntu stonking: ocaml-dune 3.24.1-4 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms