DUNE-COMPUTE(1)
π DUNE-COMPUTE(1) π
okay bestie, so this is a page from the Dune Manual β yes, that Dune, the OCaml build system one, not the sandworm one πͺ±β¨ β and we're about to go through it together, no cap.
β¨ NAME β¨
dune-compute β the little command that computes an internal function. yes that's the whole name, she's mysterious like that π
π SYNOPSIS π
dune compute [OPTION]... FUNCTION [INPUT]
that's the shape of it, gorgeous. options first, then you must hand her a FUNCTION, and INPUT is optional because she's flexible like that π¦
πΈ DESCRIPTION πΈ
She runs a registered memoize function with the input you give her and prints out the output. That's it. That's the job.
okay so real talk: this is only for debugging dune itself. It is not a "use this in your project" situation, bestie. It's giving dev-tools-only energy. π
π§ ARGUMENTS π§
FUNCTION(required) β computeFUNCTIONfor a given input. required, so like, you actually have to give her one, no skipping πINPUTβ useINPUTas the input to the function. optional! if you've got one, hand it over π«Ά
π₯ OPTIONS π₯
--build-infoβ show build information. the receipts, basically π§Ύ-f,--forceβ force actions associated to aliases to be re-executed even if their dependencies haven't changed. stubborn queen behaviour, we love it π--help[=FMT](default=auto) β show this help in formatFMT. The valueFMTmust be one ofauto,pager,grofforplain. Withauto, the format ispagerorplainwhenever theTERMenv var isdumbor undefined. she reads the room fr fr--sandbox=VAL(absentDUNE_SANDBOXenv) β sandboxing mode to use by default. Some actions require a certain sandboxing mode, so they will ignore this setting. The allowed values are:none,symlink,copy. choose your fighter β¨--versionβ show version information. drop the number, slay π-w,--watchβ instead of terminating build after completion, wait continuously for file changes. she's not leaving, she's staying π
π COMMON OPTIONS π
these ones are common to all commands, so they're like the shared group chat rules π«Ά
--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. auto-glow-up mode β¨--build-dir=FILE(absentDUNE_BUILD_DIRenv) β specified build directory._buildif unspecified--cache=VAL(absentDUNE_CACHEenv) β activate binary cache (eitherdisabledorenabled). Default isdisabled. so if you don't say anything, she's not caching, periodt--cache-check-probability=VAL(absent=0.orDUNE_CACHE_CHECK_PROBABILITYenv) β probability cached rules are rerun to check for reproducibility--cache-duplication=VAL(absentDUNE_CACHE_DUPLICATIONenv) β binary cache duplication mode--cache-transport=VAL(absentDUNE_CACHE_TRANSPORTenv) β binary cache protocol--config-file=FILEβ load this configuration file instead of the default one. pick your own config, main character energy π--debug-artifact-substitutionβ print debugging info about artifact substitution--debug-backtracesβ always print exception backtraces. the full tea when something goes wrong π--debug-dependency-pathβ in case of error, print the dependency path from the targets on the command line to the rule that failed. she'll trace the whole drama back to its source π΅οΈ--debug-findlibβ debug the findlib sub-system.--default-target=TARGET(absent=@@default) β set the default target that when none is specified todune build.--diff-command=VALβ shell command to use to diff files. Use-to disable printing the diff.--disable-promotion(absentDUNE_DISABLE_PROMOTIONenv) β disable all promotion rules--display=MODEβ control the display mode of Dune. Seedune-config(5)for more details. (yes bestie, a whole other manpage, go read her too π)--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β run no more thanJOBScommands simultaneously. multitasking but make it bounded π--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. okay that's a lot of caveats but they MATTER, don't skip them π€--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 --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. must. use. it. π--profile=VAL(absentDUNE_PROFILEenv) β select the build profile, for instancedevorrelease. The default isdev.--promote-install-files[=VAL](default=true) β promote the generated<package>.installfiles to the source tree--releaseβ put dune into a reproducible release mode. This is in fact a shorthand for--root . --ignore-promoted-rules --no-config --profile release --always-show-command-line --promote-install-files --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. the whole combo meal π--root=DIRβ 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--terminal-persistence=MODEβ changes how the log of build results are displayed to the console between rebuilds while in--watchmode. Supported modes:preserve,clear-on-rebuild.--trace-file=FILEβ output trace data in catapult format (compatible withchrome://tracing)--verboseβ same as--display verbose--workspace=FILE(absentDUNE_WORKSPACEenv) β use this specific workspace file instead of looking it up.-x VALβ cross-compile using this toolchain.
π¦ MORE HELP π¦
use dune COMMAND --help for help on a single command. one command at a time, bestie, we're being specific π
π ENVIRONMENT π
these environment variables affect the execution of compute:
DUNE_BUILD_DIRβ specified build directory._buildif unspecifiedDUNE_CACHEβ activate binary cache (eitherdisabledorenabled). Default isdisabled.DUNE_CACHE_CHECK_PROBABILITYβ probability cached rules are rerun to check for reproducibilityDUNE_CACHE_DUPLICATIONβ binary cache duplication modeDUNE_CACHE_TRANSPORTβ binary cache protocolDUNE_DISABLE_PROMOTIONβ disable all promotion rulesDUNE_INSTRUMENT_WITHβ "Enable instrumentation byBACKENDS.BACKENDSis a comma-separated list of library names, each one of which must declare an instrumentation backend.DUNE_PROFILEβ build profile.devif unspecified orreleaseif-pis set.DUNE_SANDBOXβ sandboxing mode to use by default. (see--sandbox)DUNE_STORE_ORIG_SOURCE_DIRβ store original source location indune-packagemetadataDUNE_WORKSPACEβ use this specific workspace file instead of looking it up.
π BUGS π
check bug reports at https://github.com/ocaml/dune/issues β go tell them what's wrong, they wanna know, fr fr π«Ά
and that's the whole page, bestie!! this one's from Dune 2.9.3, mwah π go compute something iconic πβ¨
π¦ where this page comes from
- debian bookworm: ocaml-dune 2.9.3-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms