DUNE-COMPUTE(1)

πŸ“¦
version 2.9.3 Β· 3 versions
, in debian bookworm

πŸ’– 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) β€” compute FUNCTION for a given input. required, so like, you actually have to give her one, no skipping πŸ’…
  • INPUT β€” use INPUT as 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 format FMT. The value FMT must be one of auto, pager, groff or plain. With auto, the format is pager or plain whenever the TERM env var is dumb or undefined. she reads the room fr fr
  • --sandbox=VAL (absent DUNE_SANDBOX env) β€” 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 running dune promote after the build. auto-glow-up mode ✨
  • --build-dir=FILE (absent DUNE_BUILD_DIR env) β€” specified build directory. _build if unspecified
  • --cache=VAL (absent DUNE_CACHE env) β€” activate binary cache (either disabled or enabled). Default is disabled. so if you don't say anything, she's not caching, periodt
  • --cache-check-probability=VAL (absent=0. or DUNE_CACHE_CHECK_PROBABILITY env) β€” probability cached rules are rerun to check for reproducibility
  • --cache-duplication=VAL (absent DUNE_CACHE_DUPLICATION env) β€” binary cache duplication mode
  • --cache-transport=VAL (absent DUNE_CACHE_TRANSPORT env) β€” 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 to dune build.
  • --diff-command=VAL β€” shell command to use to diff files. Use - to disable printing the diff.
  • --disable-promotion (absent DUNE_DISABLE_PROMOTION env) β€” disable all promotion rules
  • --display=MODE β€” control the display mode of Dune. See dune-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 (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 β€” run no more than JOBS commands 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 --verbose as 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 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>.install target.
  • -p PACKAGES, --for-release-of-packages=PACKAGES (required) β€” shorthand for --release --only-packages PACKAGE. You must use this option in your <package>.opam files, 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 (absent DUNE_PROFILE env) β€” select the build profile, for instance dev or release. The default is dev.
  • --promote-install-files[=VAL] (default=true) β€” promote the generated <package>.install files 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>.opam files. Except if you already use -p, as -p implies 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 (absent DUNE_STORE_ORIG_SOURCE_DIR env) β€” store original source location in dune-package metadata
  • --terminal-persistence=MODE β€” changes how the log of build results are displayed to the console between rebuilds while in --watch mode. Supported modes: preserve, clear-on-rebuild.
  • --trace-file=FILE β€” output trace data in catapult format (compatible with chrome://tracing)
  • --verbose β€” same as --display verbose
  • --workspace=FILE (absent DUNE_WORKSPACE env) β€” 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. _build if unspecified
  • DUNE_CACHE β€” activate binary cache (either disabled or enabled). Default is disabled.
  • DUNE_CACHE_CHECK_PROBABILITY β€” probability cached rules are rerun to check for reproducibility
  • DUNE_CACHE_DUPLICATION β€” binary cache duplication mode
  • DUNE_CACHE_TRANSPORT β€” binary cache protocol
  • DUNE_DISABLE_PROMOTION β€” disable all promotion rules
  • DUNE_INSTRUMENT_WITH β€” "Enable instrumentation by BACKENDS. BACKENDS is a comma-separated list of library names, each one of which must declare an instrumentation backend.
  • DUNE_PROFILE β€” build profile. dev if unspecified or release if -p is set.
  • DUNE_SANDBOX β€” sandboxing mode to use by default. (see --sandbox)
  • DUNE_STORE_ORIG_SOURCE_DIR β€” store original source location in dune-package metadata
  • DUNE_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