DUNE-OCAML-MERLIN(1)
π DUNE-OCAML-MERLIN(1) π
okay so bestie, welcome to the Dune Manual β this is the page for dune-ocaml-merlin, and no, it's not the glow-up you were hoping for, it's the plumbing. but it's important plumbing. let's go β¨
β¨ NAME β¨
dune-ocaml-merlin β Start a merlin configuration server. π§
πΈ SYNOPSIS πΈ
dune ocaml-merlin [OPTION]β¦
π¦ DESCRIPTION π¦
okay so dune ocaml-merlin literally just starts up a server that other things can query to get .merlin info out of. that's the whole job. π
and likeβ¦ it's not for you, bestie. it's meant to be used by Merlin itself, and the output is not user-friendly β it's giving cryptic-machine-whisper, not giving friendly-little-dashboard. it does not provide a user-friendly output. no cap. π
π OPTIONS π
--action-stderr-on-success=VALβ same vibe as--action-stdout-on-successbut for standard error instead of standard output. and the tea is: for big mono-repos a really good default is--action-stdout-on-success=swallowplus--action-stderr-on-success=must-be-empty. that way a successful build has a "clean" empty output. iconic behavior honestly. β¨--action-stdout-on-success=VALβ tells Dune how to handle the standard output of actions when they succeed. the possible values are:printβ literally just print it to Dune's outputswallowβ completely ignore it, gone, deletedmust-be-emptyβ enforce that the action printed nothing; withmust-be-empty, Dune will consider the action failed if it printed something to its standard output
the default is print. periodt.
--build-infoβ show build information. π--context=CONTEXT(absent=default) β pick which Dune build context gets used when returning information.--display-separate-messagesβ separate error messages with a blank line. little breathing room, we love that πΈ--error-reporting=VAL(absent=deterministic) β controls when build errors get reported:earlyβ reports errors as soon as they're discovereddeterministicβ reports errors at the end of the build, in a deterministic ordertwiceβ reports each error twice: once the moment it's discovered, and then again at the end of the build in a deterministic order
-f,--forceβ force actions associated to aliases to be re-executed even if their dependencies haven't changed. rude but effective π--file-watcher=VAL(absent=automatic) β the mechanism used to detect changes in the source:automaticβ makes dune run an external program to detect changesmanualβ you notify dune that files have changed, yourself, by hand
--passive-watch-modeβ similar to--watch, except it only starts a build when it's instructed externally by an RPC. it's the chill version, it waits to be asked.--sandbox=VAL(absent DUNE_SANDBOX env) β set the sandboxing mode. heads up: some actions require a certain sandboxing mode, so they will 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 second chances, we're dramatic like that π-w,--watchβ instead of terminating the build after it completes, wait continuously for file changes. it justβ¦ stays. watching. π--wait-for-filesystem-clockβ Dune digests file contents for better incrementality, and those digests are themselves cached. sometimes Dune needs to drop some digest cache entries to keep things reliable. this option makes Dune wait for the file system clock to advance so it doesn't need to drop anything. ngl 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. it's giving dev-tools-only, iykyk π§
π COMMON OPTIONS π
these options are common to all commands. yes, all of them. π«Ά
--always-show-command-lineβ always show the full command lines of programs executed by dune.--auto-promoteβ automatically promote files. this is similar to runningdune promoteafter the build.--build-dir=FILE(absent DUNE_BUILD_DIR env) β specify the build directory. it's_buildif unspecified.--cache=VAL(absent DUNE_CACHE env) β enable or disable the Dune cache. one ofdisabled,enabled-except-user-rulesorenabled. default isenabled-except-user-rules.--cache-check-probability=VAL(absent DUNE_CACHE_CHECK_PROBABILITY env) β 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.--cache-storage-mode=VAL(absent DUNE_CACHE_STORAGE_MODE env) β Dune cache storage mode, one ofauto,hardlinkorcopy. default ishardlink.--config-file=FILEβ load this configuration file instead of the default one.--debug-backtracesβ always print exception backtraces. all of them. every last crumb. π--debug-dependency-pathβ in case of error, print the dependency path from the targets on the command line to the rule that failed. a little map of the crime scene π--debug-package-logs(absent DUNE_DEBUG_PACKAGE_LOGS env) β 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(absent DUNE_DIFF_COMMAND env) β the shell command used to diff files. use-to disable printing the diff.--disable-promotion(absent DUNE_DISABLE_PROMOTION env) β disable all promotion rules. none of them. zero. β--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. ποΈβ¨--help[=FMT](default=auto) β show this help in format FMT. the value FMT must 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(absent DUNE_INSTRUMENT_WITH env) β enable instrumentation by BACKENDS. BACKENDS is a comma-separated list of library names, each one of which must declare an instrumentation backend.-j JOBS(absent DUNE_JOBS env) β run no more than JOBS commands simultaneously. JOBS must be a positive integer, orautoto auto-detect the number of cores (that's 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. it's a whole combo, bestie π--no-configβ do not load the configuration file.--no-print-directoryβ suppress "Entering directory" messages. shhhh π€«--only-packages=PACKAGESβ ignore stanzas referring to a package that is not in PACKAGES. PACKAGES is 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. mandatory, no skips π--pkg=VALβ enable or disable package management. the default behaviour depends on whether a lock directory exists.--profile=VAL(absent DUNE_PROFILE env) β 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>.opam files. except if you already use -p, as -p implies this option. (so don't double up, that's redundant energy π
)
--require-dune-project-file[=VAL](default=true) β fail if adune-projectfile is missing.--root=DIR(absent DUNE_ROOT env) β use this directory as the 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(absent DUNE_STORE_ORIG_SOURCE_DIR env) β store the original source location indune-packagemetadata.--target-exec=TOOLCHAIN=CMD(absent DUNE_TARGET_EXEC env) β 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 is 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). pretty graphs, we stan π--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 also be 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(absent DUNE_WORKSPACE env) β use this specific workspace file instead of looking it up.-x VAL(absent DUNE_CROSS_TARGET env) β cross-compile using this toolchain.
π MORE HELP π
use dune COMMAND --help for help on a single command. one command at a time, we love a focused queen π
β EXIT STATUS β
dune ocaml-merlin exits with:
0β on success. π1β if an error happened. π130β if it was interrupted by a signal. π
πΏ ENVIRONMENT πΏ
ok bestie listen, these are the env vars that change how ocaml-merlin actually runs when you invoke it. set them, export them, vibe with them π
DUNE_BUILD_DIRβ this is where the build dir lives. if you don't say anything it's just_build, no thoughts head empty.DUNE_CACHEβ turns the Dune cache on or off. pick exactly one ofdisabled,enabled-except-user-rulesorenabled. the default isenabled-except-user-rules(yes, that default is a little extra, she's iconic like that β¨).DUNE_CACHE_CHECK_PROBABILITYβ this one re-executes randomly chosen rules and compares what comes out with what's already chilling in the Dune cache, i.e. it checks build reproducibility. β οΈ heads up bestie: the more you crank the probability, the slower your build gets. default probability is zero, meaning literally nothing gets checked. zero thoughts, no cap.DUNE_CACHE_STORAGE_MODEβ how the Dune cache stores stuff. one ofauto,hardlinkorcopy. default ishardlink.DUNE_CROSS_TARGETβ cross-compile using this toolchain. πDUNE_DEBUG_PACKAGE_LOGSβ always print the standard logs while building packages. yes she's chatty, let her talk.DUNE_DIFF_COMMANDβ the shell command used to diff files. pass-if you want to disable printing the diff entirely (the silent treatment, but make it diff).DUNE_DISABLE_PROMOTIONβ disables all promotion rules. all of them. periodt.DUNE_INSTRUMENT_WITHβ enables instrumentation usingBACKENDS.BACKENDSis a comma-separated list of library names, and every single one of them has to declare an instrumentation backend, no exceptions bestie.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 β andautois the default btw. π₯DUNE_PROFILEβ the build profile. it'sdevif you don't specify anything, orreleaseif-pis set. she picks for you, you're welcome.DUNE_ROOTβ use this directory as the workspace root instead of making Dune guess it. π«Ά lowkey important: this option does not change how targets on the command line are interpreted. it's only intended for scripts, iykyk.DUNE_SANDBOXβ the sandboxing mode used by default (peep--sandboxfor the deets).DUNE_STORE_ORIG_SOURCE_DIRβ stores the original source location indune-packagemetadata.DUNE_TARGET_EXECβ wrapper command for running target binaries when you're cross-compiling. format isTOOLCHAIN=CMD, like'windows=wine'. πDUNE_WORKSPACEβ use this specific workspace file instead of going looking for one. she's decisive, we love her.
π BUGS π
found something cursed? check the bug reports at https://github.com/ocaml/dune/issues π
π BUGS π
(no fr, same thing again, because apparently the page said it twice and I'm a completionist: check the bug reports at https://github.com/ocaml/dune/issues) π
π SEE ALSO π
and that's the whole page bestie π this was DUNE-OCAML-MERLIN(1) from Dune 3.24.1 β go forth, cross-compile, set your env vars, and slay πβ¨π
π¦ 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