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=swallow plus --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: print to just print it out into Dune's own output, swallow to completely ignore it, and must-be-empty to enforce that the action printed absolutely nothing. with must-be-empty, if the thing printed something to standard output, Dune considers the action failed 😭. the default is print.
  • --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: early reports errors the second they're discovered. deterministic reports errors at the end of the build, in a deterministic order. twice reports 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. automatic makes dune run an external program to sniff out changes. manual means 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 (absent DUNE_SANDBOX env) β€” 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 running dune promote after the build. 🫢
  • --build-dir=FILE (absent DUNE_BUILD_DIR env) β€” the specified build directory. it's _build if unspecified.
  • --cache=VAL (absent DUNE_CACHE env) β€” enable or disable the Dune cache. one of disabled, enabled-except-user-rules or enabled. the default is enabled-except-user-rules.
  • --cache-check-probability=VAL (absent DUNE_CACHE_CHECK_PROBABILITY env) β€” 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 (absent DUNE_CACHE_STORAGE_MODE env) β€” Dune cache storage mode, one of auto, hardlink or copy. the default is hardlink.
  • --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 (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 none is specified to dune build.
  • --diff-command=VAL (absent DUNE_DIFF_COMMAND env) β€” the shell command used to diff files. use - to disable printing the diff entirely.
  • --disable-promotion (absent DUNE_DISABLE_PROMOTION env) β€” disable all promotion rules. all of them. periodt 🚫
  • --display=MODE β€” control the display mode of Dune. see dune-config(5) for more details, bestie. the valid values for this option are progress, verbose, short, quiet or tui. ✨
  • --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 format FMT. the value 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 β€” 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 (absent DUNE_INSTRUMENT_WITH env) β€” enable instrumentation by BACKENDS. BACKENDS is a comma-separated list of library names, and every single one of them must declare an instrumentation backend.
  • -j JOBS (absent DUNE_JOBS env) β€” run no more than JOBS commands simultaneously. JOBS must be a positive integer, or auto to 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 1 to avoid interleaving, and additionally you should use --verbose as 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 the Entering directory messages. we get it, we're entering πŸ”‡
  • --only-packages=PACKAGES β€” ignore stanzas referring to a package that is not in PACKAGES. PACKAGES is 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>.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, 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 (absent DUNE_PROFILE env) β€” select the build profile, for instance dev or release. the default is dev.
  • --promote-install-files[=VAL] (default=true) β€” promote any generated <package>.install files 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>.opam files. except if you already use -p, since -p implies this option. whew, that was a mouthful but slay πŸ’…
  • --require-dune-project-file[=VAL] (default=true) β€” fail if a dune-project file is missing. no file, no vibes πŸ’€
  • --root=DIR (absent DUNE_ROOT env) β€” 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 (absent DUNE_STORE_ORIG_SOURCE_DIR env) β€” store the original source location in dune-package metadata.
  • --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 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 β€” output trace data in catapult format (compatible with chrome://tracing).
  • --verbose β€” same as --display verbose.
  • --version β€” show version information.
  • --watch-exclusions=REGEX β€” adds a POSIX regular expression that will exclude matching directories from dune build --watch. the option --watch-exclusions can 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-exclusions are 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 (absent DUNE_WORKSPACE env) β€” use this specific workspace file instead of looking it up.
  • -x VAL (absent DUNE_CROSS_TARGET env) β€” 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 of disabled, enabled-except-user-rules, or enabled. the default is enabled-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 of auto, hardlink or copy. default is hardlink. 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 via BACKENDS. BACKENDS is 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, or auto to auto-detect how many cores you've got. auto is the default btw.
  • DUNE_PROFILE β€” the build profile. it's dev if you don't specify anything, or release if -p is 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 --sandbox for the deets)
  • DUNE_STORE_ORIG_SOURCE_DIR β€” store the original source location inside the dune-package metadata.
  • DUNE_TARGET_EXEC β€” a wrapper command for running target binaries while cross-compiling. format is TOOLCHAIN=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