DUNE-DESCRIBE(1)

πŸ’« dune-describe β€” the Dune Manual page, bestie edition πŸ’«

okay so. DUNE-DESCRIBE(1)? It lives in the Dune Manual. And basically it's your group chat with the workspace itself. Let's get into it 🫢


✨ NAME ✨

dune-describe β€” Describe the workspace. that's it. that's the whole job. and honestly? iconic.


πŸŽ€ SYNOPSIS πŸŽ€

dune describe [COMMAND] …

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the vibe: this command tells you what's up in your current workspace, and it can do it in human form or machine form. Choose your fighter πŸ’…

By default, it spits out a human readable description of the current workspace. Key word: human. This output is aimed at humans and it is NOT suitable for machine processing. Specifically, it is not versioned β€” so if you're out here trying to parse it from a program, hard no bestie 😭

If you want to interpret the output of this command from a program, you must use the --format option to specify a machine readable format, plus the --lang option to get a stable output. Both. Not one. Both. periodt πŸ’–


πŸ‘‘ COMMANDS πŸ‘‘

  • aliases [OPTION]… [DIR]… β€” Print aliases in a given directory. It works similarly to ls. lowkey serving the same energy πŸ‘‘
  • contexts [OPTION]… β€” List the build contexts available in the workspace. all of them. every single one 🫢
  • depexts [OPTION]… β€” Print the list of all the available depexts. yes, all of them, no cap ✨
  • env [OPTION]… [PATH] β€” Print the environment of a directory. give it a PATH and it'll tell you the env, bestie 🌸
  • external-lib-deps [OPTION]… β€” Print out external libraries needed to build the project. heads up though: it's an approximated set of libraries. approx. not exact. don't come for me πŸ’€
  • installed-libraries [OPTION]… β€” Print out libraries installed on the system. the ones already on your machine, living their best life 🧚
  • location [OPTION]… PROG β€” Print the path to the executable using the same resolution logic as [dune exec]. same brain, same logic, same answer πŸ’…
  • opam-files [OPTION]… β€” Print information about the opam files that have been discovered. the ones Dune found. like a little scavenger hunt πŸ”₯
  • package-entries [OPTION]… β€” prints information about the entries per package. per package!! πŸ“¦
  • pkg COMMAND … β€” Subcommands related to package management. it's the package management corner of the house 🏠
  • pp [OPTION]… FILE β€” Build a given FILE and print the preprocessed output. build it, then show you the preprocessed glow-up ⭐
  • rules [OPTION]… [TARGET]… β€” Dump rules. all the rules. dumped. πŸ’–
  • targets [OPTION]… [DIR]… β€” Print targets in a given directory. Works similarly to ls. same energy as aliases, real ones know πŸ™ˆ
  • tests [OPTION]… β€” Print out the tests defined in the project. ⚠️ but the output format of this command is experimental and is subject to change without warning. like. don't build your whole pipeline on it. it's giving chaos πŸ“
  • workspace [OPTION]… [DIRS]… β€” Print a description of the workspace's structure. And if some directories DIRS are provided, then only those directories of the workspace are considered. narrowing the scope, we love to see it ✨

🌸 ARGUMENTS 🌸

  • DIRS β€” prints a description of the workspace's structure. If some directories DIRS are provided, then only those directories of the workspace are considered. yes it says the same thing as workspace up there. that's just how it is bestie πŸ€·β™€οΈ

πŸ’… OPTIONS πŸ’…

  • --action-stderr-on-success=VAL β€” Same as --action-stdout-on-success but for standard error instead of standard output. And listen: 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 girl aesthetic, but for builds ✨
  • --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. those are the three (3) options, no more no less πŸŽ€
  • --build-info β€” Show build information. the receipts 🧾
  • --context=CONTEXT (absent=default) β€” Build context to use. if you don't say anything, it assumes default πŸ’œ
  • --display-separate-messages β€” Separate error messages with a blank line. breathing room for your errors, honestly a mental health win 🌈
  • --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. pick your trauma timing bestie πŸ’€
  • -f, --force β€” Force actions associated to aliases to be re-executed even if their dependencies haven't changed. yes even then. forceful. we respect it πŸ”₯
  • --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. you either let the machine watch, or you tell it yourself πŸ‘€
  • --format=FORMAT (absent=sexp) β€” FORMAT must be either sexp or csexp. those are the only two. don't try anything else 🚫
  • --lang=VERSION (absent=0.1) β€” Behave the same as this version of Dune. it's a whole time machine vibe πŸ•°οΈ
  • --no-recursive β€” Do not traverse subdirectories. Only consider the provided directories, or the workspace root when none are given. stay in your lane, literally 🌸
  • --passive-watch-mode β€” Similar to [--watch], but only start a build when instructed externally by an RPC. passive. waiting. main character energy that only moves when summoned πŸ‘‘
  • --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. four (4) values, and also heyyyy it reads the DUNE_SANDBOX env var if you don't pass it πŸ’–
  • --sanitize-for-tests β€” Sanitize the absolute paths in workspace items, and the associated UIDs, so that the output is reproducible. for reproducible output, as a treat 🧚
  • --stop-on-first-error β€” Stop the build as soon as an error is encountered. no mercy. first error, we're out 😀
  • -w, --watch β€” Instead of terminating build after completion, wait continuously for file changes. it just. keeps going. forever. watching. πŸŒ™
  • --wait-for-filesystem-clock β€” okay so: 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. And like β€” 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. it's an iykyk situation fr fr πŸ™ˆ
  • --with-deps β€” Whether the dependencies between modules should be printed. the module tea β˜•
  • --with-pps β€” Whether the dependencies towards ppx-rewriters (that are called at compile time) should be taken into account. ppx-rewriters, compile time, all of it, accounted for πŸ¦‹

🫢 okay that's part one bestie, but there's more coming β€” don't go anywhere πŸ’–

πŸ’– COMMON OPTIONS πŸ’–

Okay bestie, these are the universal ones. Like, these work on every command, not just describe. Slay. πŸŽ€

  • --always-show-command-line β€” literally always show the full command lines of the programs dune runs. no hiding. 🫢
  • --auto-promote β€” auto-promote your files. it's basically the same as running dune promote right after the build. lowkey magic.
  • --build-dir=FILE (absent β†’ falls back to the DUNE_BUILD_DIR env var) β€” the build directory you want. if you don't say anything it's _build. classic. ✨
  • --cache=VAL (absent β†’ DUNE_CACHE env) β€” turn the Dune cache on or off. options are disabled, enabled-except-user-rules or enabled. the default? enabled-except-user-rules. she's the main character fr.
  • --cache-check-probability=VAL (absent β†’ DUNE_CACHE_CHECK_PROBABILITY env) β€” check whether builds are reproducible by re-running randomly chosen rules and comparing their results to what's stored in the Dune cache. ⚠️ note: the more you crank up this probability, the slower your build gets. default probability is zero, meaning nobody gets checked. zero thoughts, head empty.
  • --cache-storage-mode=VAL (absent β†’ DUNE_CACHE_STORAGE_MODE env) β€” the Dune cache storage mode. one of auto, hardlink or copy. default is hardlink. πŸ’…
  • --config-file=FILE β€” load this config file instead of the default one. not like other configs.
  • --debug-backtraces β€” always print exception backtraces. for when you simply must know. 😭
  • --debug-dependency-path β€” if something errors, print the dependency path all the way from the targets on the command line to the rule that failed. it's giving detective energy πŸ”
  • --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 you don't specify one to dune build.
  • --diff-command=VAL (absent β†’ DUNE_DIFF_COMMAND env) β€” the shell command used to diff files. pass - to disable printing the diff entirely. πŸ™ˆ
  • --disable-promotion (absent β†’ DUNE_DISABLE_PROMOTION env) β€” disable all promotion rules. nobody's promoting anything today, bestie.
  • --display=MODE β€” control how Dune displays stuff. check dune-config(5) for the details. valid values are progress, verbose, short, quiet or tui. pick your vibe 🌈
  • --dump-gc-stats=FILE β€” dump the garbage collector stats to a file once the build is done. numbers, but make it fashion. ✨
  • --help[=FMT] (default=auto) β€” show this help in format FMT. FMT has to be one of auto, pager, groff or plain. with auto, the format is pager or plain whenever the TERM env var is dumb or not set at all. she adapts. πŸ’…
  • --ignore-promoted-rules β€” ignore rules that have (mode promote), except the ones with (only ...). the variable %{ignoring_promoted_rules} in dune files reflects whether you passed this option or not. yep, she's watching. πŸ‘‘
  • --instrument-with=BACKENDS (absent β†’ DUNE_INSTRUMENT_WITH env) β€” enable 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 backend, no entry. 🚫
  • -j JOBS (absent β†’ DUNE_JOBS env) β€” run no more than JOBS commands at the same time. JOBS has to be a positive integer, or auto to auto-detect the number of cores (which is the default). auto-detect is so her. 🧚
  • --no-buffer β€” do not buffer the output of commands executed by dune. by default dune buffers subcommand output so nothing interleaves when multiple commands run in parallel. but that can be a whole issue when you're debugging long-running tests. with --no-buffer, the commands get direct access to the terminal. ⚠️ heads up though: as a result their output won't be captured in the log file. you should use this option together with -j 1 to avoid interleaving, and you should also use --verbose as well, to make sure commands are printed before they get executed. team work makes the dream work 🫢
  • --no-config β€” don't load the configuration file. periodt.
  • --no-print-directory β€” suppress the Entering directory messages. quiet queen. 🀫
  • --only-packages=PACKAGES β€” ignore any stanzas that refer to a package that's not in PACKAGES. PACKAGES is a comma-separated list of package names. note this does the exact same thing as deleting the relevant stanzas out of your dune files. it's mostly meant for releases. during development, what you probably actually 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, so that you only build what's necessary when your project has multiple packages, and so you get reproducible builds. yes, must. we don't make the rules (we do, actually, but still). πŸ’…
  • --pkg=VAL β€” enable or disable package management. the default behaviour depends on whether a lock directory exists. suspenseful.
  • --profile=VAL (absent β†’ DUNE_PROFILE env) β€” pick the build profile, like dev or release. default is dev. 🌸
  • --promote-install-files[=VAL] (default=true) β€” promote any generated <package>.install files into the source tree.
  • --release β€” put dune into reproducible release mode. it's 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 for release builds β€” for instance, you must use it in your <package>.opam files. except if you already use -p, since -p implies this option anyway. don't double up, bestie. πŸ”₯
  • --require-dune-project-file[=VAL] (default=true) β€” fail if a dune-project file is missing. no file, no build. sorry. 😭
  • --root=DIR (absent β†’ DUNE_ROOT env) β€” use this directory as the workspace root instead of guessing it. ⚠️ note that this option does not change how targets given on the command line are interpreted. it's only meant for scripts. iykyk.
  • --store-orig-source-dir (absent β†’ DUNE_STORE_ORIG_SOURCE_DIR env) β€” store the original source location in the dune-package metadata. receipts, kept. 🧾
  • --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 gets displayed on the console between rebuilds while you're in --watch mode. supported modes: preserve, clear-on-rebuild, clear-on-rebuild-and-flush-history.
  • --trace-file=FILE β€” output trace data in catapult format (compatible with chrome://tracing). fancy. ✨
  • --verbose β€” same as --display verbose. two ways, one vibe.
  • --version β€” show version information.
  • --watch-exclusions=REGEX β€” adds a POSIX regular expression that excludes matching directories from dune build --watch. you can repeat the --watch-exclusions option to add multiple exclusions, and semicolons work as a separator too. ⚠️ here's the tea: if you provide no exclusions, a standard set gets used. but if you use one or more --watch-exclusions, none of the standard exclusions are used anymore. it's all or nothing, bestie. 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 one up.
  • -x VAL (absent β†’ DUNE_CROSS_TARGET env) β€” cross-compile using this toolchain. 🌈

πŸ’œ MORE HELP πŸ’œ

Need help with just one command? girly just run:

dune COMMAND --help

that's it. that's the whole tip. πŸŽ€


⭐ EXIT STATUS ⭐

dune describe exits with:

  1. 0 β€” on success. we love a happy ending. πŸ₯³
  2. 1 β€” if an error happened. 😭
  3. 130 β€” if it was interrupted by a signal. rip, she got interrupted mid-sentence. πŸ’€

πŸ¦‹ ENVIRONMENT πŸ¦‹

these environment variables affect how describe runs, bestie. memorize them, or at least bookmark this. πŸ“Œ

  • DUNE_BUILD_DIR β€” specified build directory. _build if unspecified.
  • DUNE_CACHE β€” enable or disable the Dune cache (one of disabled, enabled-except-user-rules or enabled). default is enabled-except-user-rules.
  • DUNE_CACHE_CHECK_PROBABILITY β€” check build reproducibility by re-executing randomly chosen rules and comparing their results with the ones stored in the Dune cache. ⚠️ note: cranking this up slows your build down. the default probability is zero, i.e., no rules get checked.
  • DUNE_CACHE_STORAGE_MODE β€” Dune cache storage mode (one of auto, hardlink or copy). default is hardlink.
  • DUNE_CROSS_TARGET β€” cross-compile using this toolchain.
  • DUNE_DEBUG_PACKAGE_LOGS β€” always print the standard logs when building packages.
  • DUNE_DIFF_COMMAND β€” shell command to diff files. use - to disable printing the diff.
  • 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_JOBS β€” run no more than JOBS commands simultaneously. JOBS must be a positive integer or auto to auto-detect the number of cores (the default).
  • DUNE_PROFILE β€” build profile. dev if unspecified, or release if -p is set. πŸ’…
  • DUNE_ROOT β€” 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's only intended for scripts.
  • DUNE_SANDBOX β€” sandboxing mode to use by default. (see --sandbox)
  • DUNE_STORE_ORIG_SOURCE_DIR β€” store original source location in dune-package metadata.
  • DUNE_TARGET_EXEC β€” wrapper command for running target binaries when cross-compiling. format: TOOLCHAIN=CMD (e.g., windows=wine).
  • DUNE_WORKSPACE β€” use this specific workspace file instead of looking it up.

🫢 BUGS 🫢

found a bug? not cute. check bug reports at https://github.com/ocaml/dune/issues β€” the devs are literally so on it, fr fr. πŸ›βœ¨


πŸ‘‘ SEE ALSO πŸ‘‘

  • dune(1) β€” the main character herself.

<div align="center">

πŸ’–βœ¨ aaaand that's the whole page βœ¨πŸ’–

sending you off with love from Dune 3.24.1, page DUNE-DESCRIBE(1) β€” go build something iconic, bestie. you got this. periodt. πŸ’…πŸ¦‹πŸŒΈ

</div>

πŸ“¦ where this page comes from