DUNE-INSTALL(1)
π DUNE-INSTALL(1) π
okay bestie, sit down, we're installing stuff β¨ this is the Dune manual page for dune-install, and it's lowkey a banger.
πΈ NAME πΈ
dune-install β install packages defined in the workspace π«Ά
π SYNOPSIS π
So the way installation directories work is by priority, queen. Here's the order, top to bottom:
- directories set on the command line of
dune install, or the corresponding environment variables π - directories set in the
dunebinary. These get set up before the compilation ofdunewith./configure - inferred from the environment variable
OPAM_SWITCH_PREFIXif it's present
β¨ OPTIONS β¨
okay this is the main character section, let's go π
--action-stderr-on-success=VALβ literally the same thing as--action-stdout-on-successbut for standard error instead of standard output. And ngl, a really good default for big mono-repositories is:
--action-stdout-on-success=swallow
--action-stderr-on-success=must-be-empty
which makes sure a successful build has a "clean" empty output. ate. β¨
--action-stdout-on-success=VALβ tells Dune how to handle an action's standard output when the action succeeds. The possible values are:print(just print it to Dune's output),swallow(completely ignore it), andmust-be-empty(enforce that the action printed nothing). Withmust-be-empty, Dune will consider that the action failed if it printed something to its standard output π. The default isprint.--bindir=PATHβ manually override the directory where public binaries get installed. Only absolute path accepted, periodt. π--build-infoβ show build information π--context=CONTEXTβ pick which context to install from. By default it installs files from all defined contexts.--create-install-filesβ don't install directly, bestie, instead create install files in the root directory and create substituted files if needed in destdir (_destdirby default). π¦--datadir=PATHβ manually override the directory where files from thesharesection get installed. Only absolute path accepted. β¨--destdir=PATH(absentDESTDIRenv) β this directory gets prepended to all installed paths.--display-separate-messagesβ separate error messages with a blank line.--docdir=PATHβ manually override the directory where documentation files get installed. Only absolute path accepted. π--dry-runβ only display the file operations that would be performed. like a little window shopping moment ποΈ--error-reporting=VAL(absent=deterministic) β controls when the build errors get reported, girl.earlyreports errors as soon as they're discovereddeterministicreports errors at the end of the build, in a deterministic ordertwicereports 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 absolute path accepted. π-f,--forceβ force actions associated to aliases to be re-executed even if their dependencies haven't changed. no cap.--file-watcher=VAL(absent=automatic) β the mechanism for detecting changes in the source.automaticmakesdunerun an external program to detect changes.manualmeans you notifydunethat files have changed manually. π--libdir=PATHβ directory where library files are copied, relative to prefix or absolute. If--prefixis specified, the default is$prefix/lib. Only absolute path accepted.--libexecdir=PATHβ manually override the directory where executable library files get installed. Only absolute path accepted.--mandir=PATHβ manually override the directory where man pages get installed. Only absolute path accepted. (yes, this exact page you're reading right now, being a baddie π )--passive-watch-modeβ similar to[--watch], but it only starts a build when instructed externally by an RPC. it's giving "I'll build when I'm asked to build" π--prefix=PREFIX(absentDUNE_INSTALL_PREFIXenv) β the directory where files get copied. For instance, binaries get 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) β set the sandboxing mode. Some actions require a certain sandboxing mode, so they will ignore this setting π. The allowed values are:none,symlink,copy,hardlink.--sbindir=PATHβ manually override the directory where files from thesbinsection get installed. Only absolute path accepted. β¨--sections=VALβ sections that should be installed.--stop-on-first-errorβ stop the build as soon as an error is encountered. no patience, only urgency π-w,--watchβ instead of terminating the build after completion, wait continuously for file changes. main character energy fr fr π--wait-for-filesystem-clockβ Dune digests file contents for better incrementality, and 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 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. π
and that's part one, bestie β more is coming so don't you dare close the tab π
πΈ COMMON OPTIONS πΈ
Okay bestie, these ones are the shared options β like the communal snacks of the dune world. Every command gets them, no gatekeeping. π
--always-show-command-lineβ literally always show the full command lines of programs that dune runs. Every single one. No hiding. π--auto-promoteβ promote files automatically, which is basically the same thing as runningdune promoteafter the build. Iconic laziness, honestly. β¨--build-dir=FILE(absentDUNE_BUILD_DIRenv) β says which build directory to use. If you don't say anything, it's_build. Default behaviour, no thoughts. πΈ--cache=VAL(absentDUNE_CACHEenv) β turns the Dune cache on or off.VALmust be one ofdisabled,enabled-except-user-rulesorenabled. The default isenabled-except-user-rules. π§--cache-check-probability=VAL(absentDUNE_CACHE_CHECK_PROBABILITYenv) β checks whether builds are reproducible by re-running randomly chosen rules and comparing the results against what's in the Dune cache. β οΈ Heads up: raising this probability makes your build slower, bestie. The default probability is zero, which means literally no rules get checked. Chill by default.--cache-storage-mode=VAL(absentDUNE_CACHE_STORAGE_MODEenv) β picks the Dune cache storage mode, one ofauto,hardlinkorcopy. Default ishardlink. π«Ά--config-file=FILEβ loads this configuration file instead of the default one. Main character config. π--debug-backtracesβ always print exception backtraces. All of them. We love a paper trail. π--debug-dependency-pathβ when there's an error, it prints the dependency path all the way from the targets on the command line to the rule that failed. Detective mode activated. π--debug-package-logs(absentDUNE_DEBUG_PACKAGE_LOGSenv) β always print the standard logs while building packages. π--default-target=TARGET(absent=@@default) β sets the default target used when you don't specify one todune build. If you don't set it, it's@@default. π―--diff-command=VAL(absentDUNE_DIFF_COMMANDenv) β the shell command used to diff files. Pass-to disable printing the diff entirely. π«--disable-promotion(absentDUNE_DISABLE_PROMOTIONenv) β disables all promotion rules. Zero promotion. None. Nada. π--display=MODEβ controls dune's display mode. Peepdune-config(5)for the full tea β. Valid values for this option areprogress,verbose,short,quietortui.--dump-gc-stats=FILEβ dumps the garbage collector stats into a file once the build finishes. π--help[=FMT](default=auto) β shows this help in the formatFMT.FMThas to be one ofauto,pager,grofforplain. Withauto, the format becomespagerorplainwhenever theTERMenv var isdumbor not set at all. β¨--ignore-promoted-rulesβ ignores rules with(mode promote), except the ones that have(only ...). The variable%{ignoring_promoted_rules}inside dune files shows whether you passed this option or not. π¦--instrument-with=BACKENDS(absentDUNE_INSTRUMENT_WITHenv) β turns on instrumentation viaBACKENDS.BACKENDSis a comma-separated list of library names, and every single one of them has to declare an instrumentation backend. No exceptions, bestie. π-j JOBS(absentDUNE_JOBSenv) β run no more thanJOBScommands at the same time.JOBShas to be a positive integer, orautoto auto-detect the number of cores (which is the default). π--no-bufferβ don't buffer the output of commands that dune executes. By default dune does buffer subcommand output to stop things from interleaving when multiple commands run in parallel. But ngl, that can be a real problem when you're debugging long running tests. With--no-buffer, commands get direct access to the terminal. β οΈ Because of that, their output won't be captured in the log file. You should use this option together with-j 1to avoid interleaving, and also use--verboseso you can be sure commands get printed before they're executed.--no-configβ do not load the configuration file. Periodt. π«--no-print-directoryβ suppresses the"Entering directory"messages. Quiet-ish queen. π€«--only-packages=PACKAGESβ ignores stanzas that refer to a package not inPACKAGES.PACKAGESis a comma-separated list of package names. Heads up: this does the exact same thing as deleting those stanzas from your dune files, and it's mostly meant for releases. During development, what you probably want instead is to build a particular<package>.installtarget. π-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. Required is required, bestie.--pkg=VALβ enables or disables package management. The default behaviour depends on whether a lock directory exists. π--profile=VAL(absentDUNE_PROFILEenv) β selects the build profile, for instancedevorrelease. The 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. 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 option for release builds β for instance, 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. No file, no build. π--root=DIR(absentDUNE_ROOTenv) β uses 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 intended for scripts. π€--store-orig-source-dir(absentDUNE_STORE_ORIG_SOURCE_DIRenv) β stores the original source location indune-packagemetadata. π--target-exec=TOOLCHAIN=CMD(absentDUNE_TARGET_EXECenv) β a wrapper command for running target binaries while cross-compiling. Format:TOOLCHAIN=CMD(e.g.,'windows=wine'). π·--terminal-persistence=MODEβ changes how the log of build results shows up on the console between rebuilds while you're 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. That's it, that's the whole thing. π£οΈ--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 can also be used as a separator. If you provide no exclusions, then a standard set of exclusions gets used. However, if you use one or more--watch-exclusions, then none of the standard exclusions are used. The standard exclusions are:^_opam,/_opam,^_esy,/_esy,^\.#.*,/\.#.*,~$,^#[^#]*#$,/#[^#]*#$,^4913$,/4913$,/.git,/.hg,:/windows. πΈ--workspace=FILE(absentDUNE_WORKSPACEenv) β uses this specific workspace file instead of looking one up. π-x VAL(absentDUNE_CROSS_TARGETenv) β cross-compiles using this toolchain. π
π«Ά MORE HELP π«Ά
Wanna know about just one command? Use dune COMMAND --help for help on a single command. One command, one help page, no scrolling through the whole novel. π
π EXIT STATUS π
dune install exits with:
0β on success. We ate. π1β if an error happened. Sad girl hours. π130β if it was interrupted by a signal. Rude. π
π ENVIRONMENT π
These environment variables affect the execution of install. Bestie, they're like the options' little siblings β same energy, different doorway. πͺβ¨
DESTDIRβ see option--destdir.DUNE_BUILD_DIRβ specified build directory._buildif unspecified.DUNE_CACHEβ enable or disable Dune cache (one ofdisabled,enabled-except-user-rulesorenabled). Default isenabled-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 ishardlink.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 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 something cursed? Check bug reports at https://github.com/ocaml/dune/issues. Go snitch, bestie, it's how things get fixed. π
π SEE ALSO π
That's the whole page, babes. You read all of it and you understood it β main character energy, no cap. π¦
This whole thing is from Dune 3.24.1, and yeah, it's the DUNE-INSTALL(1) page, sliced fresh for you. Now go build something iconic. π
β¨π
π¦ 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