DUNE-INSTALLED-LIBRARIES(1)
π dune-installed-libraries β bestie, let's read the manual
okay so real talk: this is the DUNE-INSTALLED-LIBRARIES(1) page, straight out of the Dune Manual (that's the manual name, bestie, it's on the tin). She's long, so buckle up π«Ά
β¨ NAME β¨
dune-installed-libraries β print out libraries installed on the system. that's it, that's the whole job π
πΈ SYNOPSIS πΈ
dune installed-libraries [OPTION]β¦
π OPTIONS π
--action-stderr-on-success=VALβ literally the exact same energy as--action-stdout-on-success, except it's about standard error instead of standard output. and ngl, a really good default for big ol' mono-repositories is--action-stdout-on-success=swallowplus--action-stderr-on-success=must-be-empty. why? because it guarantees a successful build has a "clean", empty output. iconic β¨--action-stdout-on-success=VALβ tells Dune what to do with the standard output of actions when they succeed. the possible values are:printto just print it out into Dune's own output,swallowto completely ignore it, andmust-be-emptyto enforce that the action printed absolutely nothing. withmust-be-empty, if the thing printed something to standard output, Dune considers the action failed π. the default isprint.--build-infoβ show build information. that's it π§--display-separate-messagesβ separate error messages with a blank line, so your eyes don't suffer. π--error-reporting=VAL(absent=deterministic) β controls when the build errors get reported. here's the tea:earlyreports errors the second they're discovered.deterministicreports errors at the end of the build, in a deterministic order.twicereports each error twice β once the moment it's discovered, and then again at the end of the build, in a deterministic order. yeah, twice. she said what she said π-f,--forceβ force the actions tied to aliases to be re-executed even if their dependencies haven't changed. stubborn but make it fashion β¨--file-watcher=VAL(absent=automatic) β the mechanism used to detect changes in the source.automaticmakes dune run an external program to sniff out changes.manualmeans you have to notify dune yourself that files have changed. π¦--not-available,--naβ list the libraries that are not available and explain why. investigative journalism, honestly π--passive-watch-modeβ similar to[--watch], but it only starts a build when instructed externally by an RPC. she waits to be asked, queen behavior π--sandbox=VAL(absentDUNE_SANDBOXenv) β set the sandboxing mode. heads up though: some actions require a certain sandboxing mode, so they'll flat-out ignore this setting. the allowed values are:none,symlink,copy,hardlink.--stop-on-first-errorβ the build stops the very second an error shows up. no second chances, no forgiveness π€-w,--watchβ instead of terminating the build after completion, justβ¦ wait. continuously. for file changes. forever bestie π--wait-for-filesystem-clockβ so Dune digests file contents for better incrementality, and those digests are themselves cached. in some cases Dune needs to drop some digest cache entries so things stay reliable. this option makes Dune wait for the file system clock to advance, so it doesn't need to drop anything. you probably should not care about this option at all β it's mostly useful for Dune developers, to make Dune tests of the digest cache more reproducible. π
π COMMON OPTIONS π
--always-show-command-lineβ always show the full command lines of the programs executed by dune. no mystery, full transparency β¨--auto-promoteβ automatically promote files. basically the same as runningdune promoteafter the build. π«Ά--build-dir=FILE(absentDUNE_BUILD_DIRenv) β the specified build directory. it's_buildif unspecified.--cache=VAL(absentDUNE_CACHEenv) β enable or disable the Dune cache. one ofdisabled,enabled-except-user-rulesorenabled. the default isenabled-except-user-rules.--cache-check-probability=VAL(absentDUNE_CACHE_CHECK_PROBABILITYenv) β check build reproducibility by re-executing randomly chosen rules and comparing their results with those stored in the 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. π--cache-storage-mode=VAL(absentDUNE_CACHE_STORAGE_MODEenv) β Dune cache storage mode, one ofauto,hardlinkorcopy. the default ishardlink.--config-file=FILEβ load this configuration file instead of the default one. main character energy, choosing your own config π--debug-backtracesβ always print exception backtraces. for when you want the full dramatic monologue π--debug-dependency-pathβ if there's an error, print the dependency path from the targets on the command line all the way to the rule that failed. forensic vibes π΅οΈ--debug-package-logs(absentDUNE_DEBUG_PACKAGE_LOGSenv) β always print the standard logs when building packages.--default-target=TARGET(absent=@@default) β set the default target used when none is specified todune build.--diff-command=VAL(absentDUNE_DIFF_COMMANDenv) β the shell command used to diff files. use-to disable printing the diff entirely.--disable-promotion(absentDUNE_DISABLE_PROMOTIONenv) β disable all promotion rules. all of them. periodt π«--display=MODEβ control the display mode of Dune. seedune-config(5)for more details, bestie. the valid values for this option areprogress,verbose,short,quietortui. β¨--dump-gc-stats=FILEβ dump the garbage collector stats to a file after the build is complete.--help[=FMT](default=auto) β show this help in formatFMT. the valueFMTmust be one ofauto,pager,grofforplain. withauto, the format ispagerorplainwhenever theTERMenv var isdumbor undefined. π--ignore-promoted-rulesβ ignore rules with(mode promote), except the ones with(only ...). the variable%{ignoring_promoted_rules}in dune files reflects whether this option was passed or not. iykyk π₯--instrument-with=BACKENDS(absentDUNE_INSTRUMENT_WITHenv) β enable instrumentation byBACKENDS.BACKENDSis a comma-separated list of library names, and every single one of them must declare an instrumentation backend.-j JOBS(absentDUNE_JOBSenv) β run no more thanJOBScommands simultaneously.JOBSmust be a positive integer, orautoto auto-detect the number of cores (which is the default). π--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 run in parallel. however! this can be an issue when you're debugging long running tests. with--no-buffer, commands get 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 together with-j 1to avoid interleaving, and additionally you should use--verboseas well, to make sure commands are printed before they're executed. that's a lot of caveats, but it's giving thorough π--no-configβ do not load the configuration file.--no-print-directoryβ suppress theEntering directorymessages. we get it, we're entering π--only-packages=PACKAGESβ ignore stanzas referring to a package that is not inPACKAGES.PACKAGESis a comma-separated list of package names. note that this has the same effect as deleting the relevant stanzas from dune files. 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, in order to build only what's necessary when your project contains multiple packages, as well as getting reproducible builds. yes, must. π«Ά--pkg=VALβ enable or disable package management. the default behaviour depends on whether a lock directory exists. π--profile=VAL(absentDUNE_PROFILEenv) β select the build profile, for instancedevorrelease. the default isdev.--promote-install-files[=VAL](default=true) β promote any generated<package>.installfiles 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>.opamfiles. except if you already use-p, since-pimplies this option. whew, that was a mouthful but slay π--require-dune-project-file[=VAL](default=true) β fail if adune-projectfile is missing. no file, no vibes π--root=DIR(absentDUNE_ROOTenv) β use this directory as the 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. π§--store-orig-source-dir(absentDUNE_STORE_ORIG_SOURCE_DIRenv) β store the original source location indune-packagemetadata.--target-exec=TOOLCHAIN=CMD(absentDUNE_TARGET_EXECenv) β 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 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β output trace data in catapult format (compatible withchrome://tracing).--verboseβ same as--display verbose.--versionβ show version information.--watch-exclusions=REGEXβ adds a POSIX regular expression that will exclude matching directories fromdune build --watch. the option--watch-exclusionscan be repeated to add multiple exclusions, and semicolons can also be used as a separator. important: if no exclusions are provided, then a standard set of exclusions is used; however, if one or more--watch-exclusionsare used, none of the standard exclusions are used. the standard exclusions are:^_opam/_opam^_esy/_esy^\.#.*/\.#.*~$^#[^#]*#$/#[^#]*#$^4913$/4913$/.git/.hg:/windows. copy those exactly, bestie, don't be ad-libbing π--workspace=FILE(absentDUNE_WORKSPACEenv) β use this specific workspace file instead of looking it up.-x VAL(absentDUNE_CROSS_TARGETenv) β cross-compile using this toolchain.
π EXIT STATUS π
dune installed-libraries exits with:
0β on success. we love a win π1β if an error happened. π130β if it was interrupted by a signal. rude, but okay π
π± ENVIRONMENT π±
okay bestie, these are the environment variables that change how installed-libraries does its thing. set them in your shell and the vibes shift, fr fr.
DUNE_BUILD_DIRβ the build directory you want. if you don't say anything, it's_build. she'll just live there, no questions asked πDUNE_CACHEβ turn the Dune cache on or off. pick one ofdisabled,enabled-except-user-rules, orenabled. the default isenabled-except-user-rulesβ that's the little sweet spot she starts in.DUNE_CACHE_CHECK_PROBABILITYβ this one re-runs randomly chosen rules and compares the results against what's already chilling in the Dune cache, so you can check whether your build is reproducible. heads up bestie: crank this probability up and your build gets slower, that's just the trade. the default probability is zero, meaning no rules get checked at all. no cap.DUNE_CACHE_STORAGE_MODEβ how the Dune cache stores stuff. one ofauto,hardlinkorcopy. default ishardlink. iconic.DUNE_CROSS_TARGETβ cross-compile using this toolchain. go off π¦DUNE_DEBUG_PACKAGE_LOGSβ always print the standard logs when building packages. yes, always. she's nosy like that.DUNE_DIFF_COMMANDβ the shell command to use when diffing files. pass-if you want to β¨ disable β¨ printing the diff entirely.DUNE_DISABLE_PROMOTIONβ kills every single promotion rule. all of them. gone.DUNE_INSTRUMENT_WITHβ switch on instrumentation viaBACKENDS.BACKENDSis a comma-separated list of library names, and every single one of them has to declare an instrumentation backend. no backend declaration, no entry, that's the rule πDUNE_JOBSβ never run more than JOBS commands at the same time. JOBS has to be a positive integer, orautoto auto-detect how many cores you've got.autois the default btw.DUNE_PROFILEβ the build profile. it'sdevif you don't specify anything, orreleaseif-pis set. main character switches.DUNE_ROOTβ use this directory as the workspace root instead of letting Dune guess where it is. important though: this doesn't change how targets given on the command line get interpreted β it's only meant for scripts, okay? don't get it twisted.DUNE_SANDBOXβ the sandboxing mode to use by default. (peep--sandboxfor the deets)DUNE_STORE_ORIG_SOURCE_DIRβ store the original source location inside thedune-packagemetadata.DUNE_TARGET_EXECβ a wrapper command for running target binaries while cross-compiling. format isTOOLCHAIN=CMD, like for example'windows=wine'. cute and functional πDUNE_WORKSPACEβ use this specific workspace file instead of hunting one down.
π SEE ALSO π
aaand that's a wrap on DUNE-INSTALLED-LIBRARIES(1) π«Ά this whole page is serving Dune 3.24.1 energy, bestie, so if any of the numbers look different on your machine that's a version thing, not a you thing. go build something gorgeous. periodt πβ¨π
π¦ 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