DUNE-UNINSTALL(1)

πŸ’– dune-uninstall πŸ’–

okay bestie, real talk β€” this page lives in the Dune Manual collection, and like, it's dune-uninstall(1). We're in part 1 of 2, so buckle up πŸŽ€

πŸ¦‹ NAME πŸ¦‹

dune-uninstall β€” uninstalls packages that are defined in the workspace. that's the whole vibe. bye bye install files, no cap.


🌸 SYNOPSIS 🌸

so the installation directories used are defined by priority β€” like, they get picked in this order, and whoever shows up first wins:

  • directories set on the command line of dune install, or the corresponding environment variables
  • directories set in the dune binary. They are set up before the compilation of dune, with ./configure
  • inferred from the environment variable OPAM_SWITCH_PREFIX, if it's present

✨ OPTIONS ✨

like, there are SO many of these. every single one is here though, no skipping πŸ’…

  • --action-stderr-on-success=VAL β€” literally the same energy as --action-stdout-on-success but for standard error instead of standard output. A totally iconic default for large mono-repositories is --action-stdout-on-success=swallow --action-stderr-on-success=must-be-empty. This makes sure that a successful build has a "clean", empty output. chef's kiss 🧚
  • --action-stdout-on-success=VAL β€” tells Dune how to deal with the standard output of actions when they actually succeed. The possible values are: print, which just prints it to Dune's output, swallow, which completely ignores it, and must-be-empty, which enforces that the action printed nothing. With must-be-empty, Dune will consider the action failed if it printed anything to its standard output. The default is print.
  • --bindir=PATH β€” manually override the directory where public binaries get installed. Only an absolute path is accepted, periodt.
  • --build-info β€” shows build information. that's it, that's the whole thing πŸ‘‘
  • --context=CONTEXT β€” picks which context to install from. By default it installs files from all defined contexts.
  • --create-install-files β€” does not directly install; instead it creates install files in the root directory and creates substituted files if needed in destdir (_destdir by default). it's giving "prep work" energy.
  • --datadir=PATH β€” manually override the directory where files from the share section get installed. Only an absolute path is accepted.
  • --destdir=PATH (absent DESTDIR env) β€” this directory gets prepended to all installed paths. like a little prefix bestie 🫢
  • --display-separate-messages β€” separates error messages with a blank line. breathing room, we love to see it.
  • --docdir=PATH β€” manually override the directory where documentation files get installed. Only an absolute path is accepted.
  • --dry-run β€” only displays the file operations that would be performed. window shopping, essentially πŸ›οΈ
  • --error-reporting=VAL (absent=deterministic) β€” controls when build errors get 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.
  • --etcdir=PATH β€” manually override the directory where configuration files get installed. Only an absolute path is accepted.
  • -f, --force β€” forces actions associated with aliases to be re-executed even if their dependencies haven't changed. no lazy shortcuts, we're doing it again πŸ’…
  • --file-watcher=VAL (absent=automatic) β€” the mechanism used to detect changes in the source. Automatic makes dune run an external program to detect changes. Manual means you notify dune that files have changed manually.
  • --libdir=PATH β€” directory where library files get copied, either relative to prefix or absolute. If --prefix is specified, the default is $prefix/lib. Only an absolute path is accepted.
  • --libexecdir=PATH β€” manually override the directory where executable library files get installed. Only an absolute path is accepted.
  • --mandir=PATH β€” manually override the directory where man pages get installed. Only an absolute path is accepted. (yes, the very page you're reading rn, that kind of thing πŸŽ€)
  • --passive-watch-mode β€” similar to [--watch], but it only starts a build when it's instructed externally by an RPC. it waits to be asked, main character behaviour.
  • --prefix=PREFIX (absent DUNE_INSTALL_PREFIX env) β€” directory where files get copied. For instance, binaries are copied into $prefix/bin, library files into $prefix/lib, etc...
  • --relocatable β€” makes the binaries relocatable, meaning the installation directory can be moved. The installation directory must be specified with --prefix.
  • --sandbox=VAL (absent DUNE_SANDBOX env) β€” sets the sandboxing mode. Some actions require a certain sandboxing mode, so they will just ignore this setting. The allowed values are: none, symlink, copy, hardlink.
  • --sbindir=PATH β€” manually override the directory where files from the sbin section get installed. Only an absolute path is accepted.
  • --sections=VAL β€” the sections that should be installed. tell it what you want, it delivers πŸ’–
  • --stop-on-first-error β€” stops the build as soon as an error is encountered. no, we are not continuing, we are DONE.
  • -w, --watch β€” instead of terminating the build after completion, it waits continuously for file changes. it's a lurker fr fr πŸ‘€
  • --wait-for-filesystem-clock β€” Dune digests file contents for better incrementality, and those 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.

πŸ’– COMMON OPTIONS πŸ’–

okay bestie these ones are like... the shared wardrobe. every command in the house gets to wear them 🫢

  • --always-show-command-line β€” no hiding: dune shows you the FULL command lines of the programs it runs. all of them. periodt πŸ’…
  • --auto-promote β€” promotes files for you automatically. it's giving "ran dune promote right after the build" energy ✨
  • --build-dir=FILE (absent β†’ DUNE_BUILD_DIR env) β€” pick your build directory. default is _build if you don't say anything πŸŽ€
  • --cache=VAL (absent β†’ DUNE_CACHE env) β€” turn the Dune cache on or off. 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) β€” checks whether your builds are reproducible by re-running randomly chosen rules and comparing what comes out with what Dune cache already stored. heads up: bumping the probability makes your build slower 😭. default is zero, aka no rules get checked, aka we are not investigating today.
  • --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 config file instead of the default one. main character config ✨
  • --debug-backtraces β€” always print exception backtraces. no more mystery crashes, we're reading the receipts πŸ“œ
  • --debug-dependency-path β€” if something errors out, print the dependency path from the targets on the command line all the way down to the rule that failed. detective mode πŸ”
  • --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. use - to turn off diff printing entirely πŸ™ˆ
  • --disable-promotion (absent β†’ DUNE_DISABLE_PROMOTION env) β€” disables all promotion rules πŸ’€
  • --display=MODE β€” controls Dune's display mode. check dune-config(5) for the deets. valid values are progress, verbose, short, quiet or tui. πŸ¦‹
  • --dump-gc-stats=FILE β€” dumps the garbage collector stats into a file once the build finishes. data girlies rise 🌈
  • --help[=FMT] (default=auto) β€” shows this help in format FMT. 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.
  • --ignore-promoted-rules β€” ignores rules with (mode promote), except the ones with (only ...). the variable %{ignoring_promoted_rules} in dune files tells you whether this option was passed or not.
  • --instrument-with=BACKENDS (absent β†’ DUNE_INSTRUMENT_WITH env) β€” turns on instrumentation via BACKENDS. BACKENDS is a comma-separated list of library names, and every single one of them must declare an instrumentation backend, no exceptions bestie πŸŽ€
  • -j JOBS (absent β†’ DUNE_JOBS env) β€” run no more than JOBS commands at the same time. JOBS must be a positive integer, or auto to auto-detect the number of cores (which is the default, and honestly is what you want). πŸ’…
  • --no-buffer β€” don't buffer the output of commands executed by dune. by default dune buffers subcommand output so things don't interleave when multiple commands run in parallel β€” but that lowkey becomes a problem when you're debugging long-running tests. with --no-buffer, commands get direct access to the terminal. note that this means their output won't be captured in the log file. you should pair this with -j 1 so nothing interleaves, and also use --verbose so commands are printed before they run. three-step combo, slay πŸ”₯
  • --no-config β€” don't load the configuration file πŸ™…β€β™€οΈ
  • --no-print-directory β€” suppresses those "Entering directory" messages.
  • --only-packages=PACKAGES β€” ignore stanzas that refer to a package not in PACKAGES. PACKAGES is a comma-separated list of package names. note this does the exact same thing as deleting those stanzas from your dune files. it's mostly meant for releases β€” during development, what you probably actually want is to build a particular <package>.install target. iykyk ✨
  • -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 only what's necessary gets built when your project has multiple packages, AND so you get reproducible builds. non-negotiable bestie 🫢
  • --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, like dev or release. default is dev. 🌸
  • --promote-install-files[=VAL] (default=true) β€” promotes any generated <package>.install files into the source tree.
  • --release β€” puts 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 for release builds β€” for example, you must use it in your <package>.opam files. except if you already use -p, because -p implies this option. πŸ‘‘
  • --require-dune-project-file[=VAL] (default=true) β€” fails if a dune-project file is missing.
  • --root=DIR (absent β†’ DUNE_ROOT env) β€” use this directory as the workspace root instead of guessing it. note that this doesn't change how targets given on the command line are interpreted. it is only intended for scripts. πŸ€–
  • --store-orig-source-dir (absent β†’ DUNE_STORE_ORIG_SOURCE_DIR env) β€” stores the original source location in dune-package metadata. keeping the receipts 🧾
  • --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 β€” changes how the log of build results is displayed to the console between rebuilds while in --watch mode. supported modes: preserve, clear-on-rebuild, clear-on-rebuild-and-flush-history.
  • --trace-file=FILE β€” outputs trace data in catapult format (compatible with chrome://tracing).
  • --verbose β€” same as --display verbose. talkative era πŸ’¬
  • --version β€” shows version information.
  • --watch-exclusions=REGEX β€” adds a POSIX regular expression that excludes matching directories from dune build --watch. you can repeat --watch-exclusions to add multiple exclusions, and semicolons also work as a separator. if you give no exclusions, a standard set gets used β€” BUT if you use one or more --watch-exclusions, none of the standard exclusions apply anymore. 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 hunting it down.
  • -x VAL (absent β†’ DUNE_CROSS_TARGET env) β€” cross-compile using this toolchain. 🌈

🌟 MORE HELP 🌟

want help on just one command? run dune COMMAND --help. one command, one lil help session, so cozy πŸ’–


✨ EXIT STATUS ✨

dune uninstall bounces out with:

  • 0 β€” on success. we ate. πŸ‘‘
  • 1 β€” if an error happened. πŸ’€
  • 130 β€” if it was interrupted by a signal. rude tbh 😀

🌸 ENVIRONMENT 🌸

these environment variables affect how uninstall runs bestie:

  • DESTDIR β€” see option --destdir.
  • DUNE_BUILD_DIR β€” specified build directory. _build if unspecified
  • DUNE_CACHE β€” enable or disable 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 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.
  • 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 use to diff files. use - to disable printing the diff.
  • DUNE_DISABLE_PROMOTION β€” disable all promotion rules
  • DUNE_INSTALL_PREFIX β€” see option --prefix.
  • 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 is 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? check bug reports at https://github.com/ocaml/dune/issues. go tell the devs, they wanna know bestie 🫢


πŸ¦‹ SEE ALSO πŸ¦‹


and that's the whole thing, babes πŸ’– that was Dune 3.24.1, and this page is dated DUNE-UNINSTALL(1). go uninstall something (deliberately, pls), ily, bye πŸŽ€βœ¨

πŸ“¦ where this page comes from