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-successbut 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, andmust-be-empty, which enforces that the action printed nothing. Withmust-be-empty, Dune will consider the action failed if it printed anything to its standard output. The default isprint.--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 (_destdirby 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(absentDESTDIRenv) β 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.earlyreports errors as soon as they are discovered.deterministicreports errors at the end of the build in a deterministic order.twicereports 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.Automaticmakes dune run an external program to detect changes.Manualmeans you notify dune that files have changed manually.--libdir=PATHβ directory where library files get copied, either relative to prefix or absolute. If--prefixis 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(absentDUNE_INSTALL_PREFIXenv) β 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(absentDUNE_SANDBOXenv) β 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 "randune promoteright after the build" energy β¨--build-dir=FILE(absent βDUNE_BUILD_DIRenv) β pick your build directory. default is_buildif you don't say anything π--cache=VAL(absent βDUNE_CACHEenv) β turn the Dune cache on or off. one ofdisabled,enabled-except-user-rulesorenabled. default is `enabled-except-user-rules'. πΈ--cache-check-probability=VAL(absent βDUNE_CACHE_CHECK_PROBABILITYenv) β 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_MODEenv) β Dune cache storage mode. one ofauto,hardlinkorcopy. 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_LOGSenv) β always print the standard logs when building packages--default-target=TARGET(absent=@@default) β set the default target used when you don't specify one todune build.--diff-command=VAL(absent βDUNE_DIFF_COMMANDenv) β the shell command used to diff files. use-to turn off diff printing entirely π--disable-promotion(absent βDUNE_DISABLE_PROMOTIONenv) β disables all promotion rules π--display=MODEβ controls Dune's display mode. checkdune-config(5)for the deets. valid values areprogress,verbose,short,quietortui. π¦--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 formatFMT.FMTmust be one ofauto,pager,grofforplain. withauto, the format ispagerorplainwhenever theTERMenv var isdumbor 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_WITHenv) β turns on instrumentation viaBACKENDS.BACKENDSis 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_JOBSenv) β run no more thanJOBScommands at the same time.JOBSmust be a positive integer, orautoto 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 1so nothing interleaves, and also use--verboseso 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 inPACKAGES.PACKAGESis 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>.installtarget. 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>.opamfiles, 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_PROFILEenv) β select the build profile, likedevorrelease. default isdev. πΈ--promote-install-files[=VAL](default=true) β promotes any generated<package>.installfiles 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>.opamfiles. except if you already use-p, because-pimplies this option. π--require-dune-project-file[=VAL](default=true) β fails if adune-projectfile is missing.--root=DIR(absent βDUNE_ROOTenv) β 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_DIRenv) β stores the original source location indune-packagemetadata. keeping the receipts π§Ύ--target-exec=TOOLCHAIN=CMD(absent βDUNE_TARGET_EXECenv) β 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--watchmode. supported modes:preserve,clear-on-rebuild,clear-on-rebuild-and-flush-history.--trace-file=FILEβ outputs trace data in catapult format (compatible withchrome://tracing).--verboseβ same as--display verbose. talkative era π¬--versionβ shows version information.--watch-exclusions=REGEXβ adds a POSIX regular expression that excludes matching directories fromdune build --watch. you can repeat--watch-exclusionsto 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_WORKSPACEenv) β use this specific workspace file instead of hunting it down.-x VAL(absent βDUNE_CROSS_TARGETenv) β 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._buildif unspecifiedDUNE_CACHEβ enable or disable Dune cache (one ofdisabled,enabled-except-user-rulesorenabled). 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 ofauto,hardlinkorcopy). default is `hardlink'.DUNE_CROSS_TARGETβ cross-compile using this toolchain.DUNE_DEBUG_PACKAGE_LOGSβ always print the standard logs when building packagesDUNE_DIFF_COMMANDβ shell command to use to diff files. use-to disable printing the diff.DUNE_DISABLE_PROMOTIONβ disable all promotion rulesDUNE_INSTALL_PREFIXβ see option--prefix.DUNE_INSTRUMENT_WITHβ enable instrumentation byBACKENDS.BACKENDSis a comma-separated list of library names, each one of which must declare an instrumentation backend.DUNE_JOBSβ run no more thanJOBScommands simultaneously.JOBSmust be a positive integer orautoto auto-detect the number of cores (the default).DUNE_PROFILEβ build profile.devif unspecified orreleaseif-pis 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 indune-packagemetadata.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
- ubuntu stonking: ocaml-dune 3.24.1-4 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms