DUNE-SHUTDOWN(1)

πŸ’… dune-shutdown, from the Dune Manual

okay so hi bestie πŸ’– welcome to dune-shutdown(1) β€” yeah, it's in the Dune Manual, one of the dune girlies, and it is exactly what it sounds like: it cancels everything and shuts the whole thing down. no notes, no mercy, slay.


✨ NAME ✨

dune-shutdown β€” Cancel and shutdown any builds in the current workspace.

like, all of them. right now. the workspace is closing bestie, go home 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

dune shutdown [OPTION]…

that's it. that's the whole vibe. you just say dune shutdown and add whatever options your little heart desires. ✨


πŸŽ€ OPTIONS πŸŽ€

okay this is the long part but stay with me, it's all good info i promise 🌸

  • --action-stderr-on-success=VAL β€” Same as --action-stdout-on-success but for standard error instead of standard output. A good default for large mono-repositories is --action-stdout-on-success=swallow --action-stderr-on-success=must-be-empty. This ensures that a successful build has a "clean" empty output. clean output is such a mood honestly 🧼✨
  • --action-stdout-on-success=VAL β€” Specify how to deal with the standard output of actions when they succeed. Possible values are: print to just print it to Dune's output, swallow to completely ignore it and must-be-empty to enforce that the action printed nothing. With must-be-empty, Dune will consider that the action failed if it printed something to its standard output. The default is print.
  • --build-info β€” Show build information. like a little get-to-know-me for your build πŸ‘‘
  • --display-separate-messages β€” Separate error messages with a blank line. breathing room for your errors ✨
  • --error-reporting=VAL (absent=deterministic) β€” Controls when the build errors are reported. early reports errors as soon as they are discovered. deterministic reports errors at the end of the build in a deterministic order. twice reports each error twice: once as soon as the error is discovered and then again at the end of the build, in a deterministic order. (not me making you read the same error twice, but ok, it's literally an option πŸ’€)
  • -f, --force β€” Force actions associated to aliases to be re-executed even if their dependencies haven't changed. no thoughts, just re-run πŸ”₯
  • --file-watcher=VAL (absent=automatic) β€” Mechanism to detect changes in the source. Automatic to make dune run an external program to detect changes. Manual to notify dune that files have changed manually. bestie you can literally just tell dune. iconic 🫢
  • --passive-watch-mode β€” Similar to [--watch], but only start a build when instructed externally by an RPC. it just waits. patiently. for you. πŸ’œ
  • --sandbox=VAL (absent DUNE_SANDBOX env) β€” Set sandboxing mode. 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 as soon as an error is encountered. one strike and we're out βœ‹
  • -w, --watch β€” Instead of terminating build after completion, wait continuously for file changes. it's giving main character who never leaves the party 🌈
  • --wait-for-filesystem-clock β€” Dune digest file contents for better incrementally. These digests are themselves cached. In some cases, Dune needs to drop some digest cache entries in order for things to be reliable. This option makes Dune wait for the file system clock to advance so that it doesn't need to drop anything. You should probably not care about this option; it is mostly useful for Dune developers to make Dune tests of the digest cache more reproducible. fr fr, it's for the dune devs, not you, no cap πŸ’…

🫢 COMMON OPTIONS 🫢

these are the ones that show up all over dune, so like, they're basically family at this point πŸŽ€

  • --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 ✨
  • --build-dir=FILE (absent DUNE_BUILD_DIR env) β€” Specified build directory. _build if unspecified. (gender-neutral, iconic, classic _build πŸ’–)
  • --cache=VAL (absent DUNE_CACHE env) β€” Enable or disable Dune cache (one of disabled, enabled-except-user-rules or enabled). Default is enabled-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 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 checks by default because girl we are BUSY 😭
  • --cache-storage-mode=VAL (absent DUNE_CACHE_STORAGE_MODE env) β€” Dune cache storage mode (one of auto, hardlink or copy). Default is hardlink.
  • --config-file=FILE β€” Load this configuration file instead of the default one.
  • --debug-backtraces β€” Always print exception backtraces. they said the quiet part OUT LOUD πŸ‘‘
  • --debug-dependency-path β€” In case of error, print the dependency path from the targets on the command line to the rule that failed. it's giving receipts 🧾✨
  • --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 that is used when none is specified to dune build.
  • --diff-command=VAL (absent DUNE_DIFF_COMMAND env) β€” Shell command to use to diff files. Use - to disable printing the diff.
  • --disable-promotion (absent DUNE_DISABLE_PROMOTION env) β€” Disable all promotion rules. nobody's getting promoted today, not on my watch πŸ’…
  • --display=MODE β€” Control the display mode of Dune. See dune-config(5) for more details. Valid values for this option are progress, verbose, short, quiet or tui. pick your aesthetic bestie πŸŽ€
  • --dump-gc-stats=FILE β€” Dump the garbage collector stats to a file after the build is complete. garbage stats? in THIS economy? πŸ’š
  • --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. (the TERM var being dumb is genuinely sending me πŸ™ˆ)
  • --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 or auto to auto-detect the number of cores (the default). parallelism, the actual love language πŸ”₯
  • --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. yes it's a whole combo, order it like a meal πŸ“
  • --no-config β€” Do not load the configuration file.
  • --no-print-directory β€” Suppress "Entering directory" messages. (bestie we KNOW where we are πŸ™ˆ)
  • --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 --pkg=disabled --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. this one is REQUIRED, not optional, do not skip it πŸ’€
  • --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 instance dev or release. The default is dev. dev girlies stay winning 🌱
  • --promote-install-files[=VAL] (default=true) β€” Promote any generated <package>.install files 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. the everything-bagel of release flags πŸ‘‘
  • --require-dune-project-file[=VAL] (default=true) β€” Fail if a dune-project file is missing. no dune-project, no service πŸŽ€
  • --root=DIR (absent DUNE_ROOT env) β€” 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. scripts only, bestie, don't get creative πŸ’œ
  • --store-orig-source-dir (absent DUNE_STORE_ORIG_SOURCE_DIR env) β€” Store original source location in dune-package metadata.
  • --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 are displayed to the console between rebuilds while in --watch mode. Supported modes: preserve, clear-on-rebuild, clear-on-rebuild-and-flush-history. aesthetic choices for your scrollback ✨
  • --trace-file=FILE β€” Output trace data in catapult format (compatible with chrome://tracing). yes typing chrome://tracing into chrome is a real thing, slay 🌈
  • --verbose β€” Same as --display verbose.
  • --version β€” Show version information. what's your version bestie πŸ’š
  • --watch-exclusions=REGEX β€” Adds a POSIX regular expression that will exclude matching directories from dune build --watch. The option --watch-exclusions can 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-exclusions are used, none of the standard exclusions are used. The standard exclusions are: ^_opam /_opam ^_esy /_esy ^\.#.* /\.#.* ~$ ^#[^#]*#$ /#[^#]*#$ ^4913$ /4913$ /.git /.hg :/windows. that's the whole list, character for character, no edits, periodt πŸ’…
  • --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. going to another platform? we ride πŸ¦‹

πŸ’€ EXIT STATUS πŸ’€

dune shutdown exits with:

  • 0 β€” on success. we ate πŸŽ€
  • 1 β€” if an error happened. ngl it happens 😭
  • 130 β€” if it was interrupted by a signal. someone hit Ctrl+C and ended the whole thing πŸ’«

okay bestie that's not even the whole story β€” there's MORE coming, don't go anywhere πŸ«ΆπŸ’–

🌸 ENVIRONMENT 🌸

okay bestie, so shutdown is lowkey nosy about your environment β€” these variables all change how it behaves, so let's go through them one by one πŸ’…


  • DUNE_BUILD_DIR β€” the build directory you're pointing at. If you don't say anything, it just assumes _build like the confident main character it is ✨
  • DUNE_CACHE β€” turns the Dune cache on or off. Your choices are disabled, enabled-except-user-rules, or enabled. Default? enabled-except-user-rules, no cap πŸŽ€
  • DUNE_CACHE_CHECK_PROBABILITY β€” makes Dune check whether builds are reproducible by re-executing randomly chosen rules and comparing what they produce to what's stored in the Dune cache. Heads up though: the more you crank up the probability, the slower your build gets 😭. Default probability is zero, meaning literally no rules get checked.
  • DUNE_CACHE_STORAGE_MODE β€” how the Dune cache stores stuff. Pick one of auto, hardlink or copy. Default is hardlink 🫢
  • DUNE_CROSS_TARGET β€” cross-compile using this toolchain. that's it, that's the vibe 🌈
  • DUNE_DEBUG_PACKAGE_LOGS β€” always prints the standard logs when building packages. for when you need to see everything πŸ‘‘
  • DUNE_DIFF_COMMAND β€” the shell command used to diff files. Set it to - if you want the diff printing to just... stop 🚫 (valid, honestly)
  • DUNE_DISABLE_PROMOTION β€” disables all promotion rules. every single one. gone πŸ’€
  • DUNE_INSTRUMENT_WITH β€” enables instrumentation by BACKENDS. BACKENDS here is a comma-separated list of library names, and every one of those libraries has to declare an instrumentation backend. no freeloaders 🧚
  • DUNE_JOBS β€” caps how many commands run at the same time at JOBS. JOBS has to be a positive integer, or auto to auto-detect your core count β€” and auto is the default πŸ’–
  • DUNE_PROFILE β€” the build profile. dev if you don't specify anything, or release if -p is set. two moods, pick one ⭐
  • DUNE_ROOT β€” use this directory as the workspace root instead of letting Dune guess. Important though: this does not change how targets given on the command line get interpreted. It's only meant for scripts, iykyk πŸ™ˆ
  • DUNE_SANDBOX β€” the sandboxing mode to use by default. (peep --sandbox for the deets πŸ–οΈ)
  • DUNE_STORE_ORIG_SOURCE_DIR β€” stores the original source location in the dune-package metadata. archival queen πŸ“¦
  • DUNE_TARGET_EXEC β€” a wrapper command for running target binaries when you're cross-compiling. Format: TOOLCHAIN=CMD (like, for example, 'windows=wine') 🍷
  • DUNE_WORKSPACE β€” use this specific workspace file instead of making Dune go look for one. decisive. obsessed πŸ’œ

πŸ‘€ SEE ALSO πŸ‘€

  • dune(1) β€” go read that one too bestie, it's the whole ecosystem πŸ¦‹

aaaand that's the whole page, fr fr πŸŽ€ this was Dune 3.24.1, the DUNE-SHUTDOWN(1) manual page β€” thanks for reading all the way to the bottom, you're literally the best, slay πŸ’…βœ¨πŸ’–

πŸ“¦ where this page comes from