DUNE-EXTERNAL-LIB-DEPS(1)
π DUNE-EXTERNAL-LIB-DEPS π
okay so bestie, this is a page from the Dune Manual β it's DUNE-EXTERNAL-LIB-DEPS(1) and honestly? she's a ghost. a legend. a memory. let's get into it π«Ά
β¨ NAME β¨
dune-external-lib-deps β literally just got moved to dune describe external-lib-deps. that's it. that's the name. moving on π
πΈ SYNOPSIS πΈ
dune external-lib-deps [OPTION]β¦ [TARGET]β¦
π¦ DESCRIPTION π¦
so back in the day, this subcommand would print out an approximate set of external libraries you'd need to build a given set of targets β and it did that without actually running the build. iconic behavior, honestly. no cap.
but likeβ¦ the approximation got worse over time π and the maintenance cost went up π, so the Dune girlies decided to remove it entirely. she's gone. periodt.
π OPTIONS π
--action-stderr-on-success=VALβ same vibe as--action-stdout-on-success, except it's about standard error instead of standard output. a good default for big ol' mono-repositories is--action-stdout-on-success=swallowplus--action-stderr-on-success=must-be-empty. that combo guarantees a successful build has a "clean", empty output. chef's kiss β¨--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, if the action printed anything to standard output, Dune counts it as a failure. the default isprint.--build-infoβ show build information. that's the whole thing π--display-separate-messagesβ separate error messages with a blank line. breathing room, we love to see it.- **
--error-reporting=VAL(absent=deterministic)** β controls *when* build errors get reported.earlyreports errors as soon as they're discovered.deterministicreports 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. (yelling at you, then yelling at you again, respectfully.) -f,--forceβ force actions associated with aliases to be re-executed, even if their dependencies haven't changed at all. no changes? don't care. running anyway π- *
--file-watcher=VAL(absent=automatic)** β the mechanism used to detect changes in the source.automaticmakes Dune run an external program to detect changes.manual` means *you notify Dune that files have changed, manually. --missingβ unused. yeah. nothing. she's just sitting there π--passive-watch-modeβ similar to[--watch], but it only starts a build when instructed externally by an RPC.- **
--sandbox=VAL(absent DUNE_SANDBOX env)** β set the sandboxing mode. some actions require a certain sandboxing mode, so they'll straight up ignore this setting. the allowed values are:none,symlink,copy,hardlink`. --sexpβ unused. also just vibing. no thoughts, head empty π--stop-on-first-errorβ stop the build the second an error is encountered. no chill, no second chances.--unstable-by-dirβ unused. third one. she's also just here π-w,--watchβ instead of terminating the build after completion, wait around continuously for file changes. main character who refuses to leave the party.--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 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 should probably not care about this option; it's mostly useful for Dune developers who want Dune's digest-cache tests to be more reproducible. (iykyk π§)
π COMMON OPTIONS π
these options are common to all commands, bestie. every single one.
--always-show-command-lineβ always show the full command lines of programs executed by Dune.--auto-promoteβ automatically promote files. this is similar to runningdune promoteafter the build.- **
--build-dir=FILE(absent DUNE_BUILD_DIR env)** β specify the build directory. it's_build` if unspecified. - **
--cache=VAL(absent DUNE_CACHE env)** β enable or disable the Dune cache. one ofdisabled,enabled-except-user-rulesorenabled. default isenabled-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: the higher the probability of these checks, the slower your build gets. the default probability is zero, meaning no rules are checked.- **
--cache-storage-mode=VAL(absent DUNE_CACHE_STORAGE_MODE env)** β Dune cache storage mode, one ofauto,hardlinkorcopy. default ishardlink`. --config-file=FILEβ load this configuration file instead of the default one.--debug-backtracesβ always print exception backtraces. every last one.--debug-dependency-pathβ if there's an error, print the dependency path all the way from the targets on the command line to the rule that failed. receipts, fully traced.--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 todune build`. - **
--diff-command=VAL(absent DUNE_DIFF_COMMAND env)** β the shell command to use for diffing files. use-` to disable printing the diff. --disable-promotion(absent DUNE_DISABLE_PROMOTION env)` β disable all promotion rules.--display=MODEβ control Dune's display mode. seedune-config(5)for more details. valid values for this option areprogress,verbose,short,quietortui.--dump-gc-stats=FILEβ dump the garbage collector stats to a file once 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 isdumb` 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.- **
--instrument-with=BACKENDS(absent DUNE_INSTRUMENT_WITH env)** β enable instrumentation byBACKENDS.BACKENDS` is a comma-separated list of library names, and each one of them must declare an instrumentation backend. - **
-j JOBS(absent DUNE_JOBS env)** β run no more thanJOBScommands simultaneously.JOBSmust be a positive integer, orauto` 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 subcommand output, to prevent interleaving when multiple commands run in parallel. but that can be a whole problem when you're debugging long-running tests. with--no-buffer, commands get direct access to the terminal. heads up though: 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 you should also use--verbosetoo, so commands get printed before they're executed. stack the flags, bestie.--no-configβ do not load the configuration file.--no-print-directoryβ suppress "Entering directory" messages. bye π--only-packages=PACKAGESβ ignore stanzas that refer to a package that isn't inPACKAGES.PACKAGESis a comma-separated list of package names. note that this has the exact 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>.opam` files, so that only what's necessary gets built when your project has multiple packages, and so you get reproducible builds. --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 instancedevorrelease. the default isdev`. - **
--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 it in your<package>.opamfiles β except if you already use-p, since-pimplies this option.- **
--require-dune-project-file[=VAL](default=true)** β fail if adune-project` file is missing. --root=DIR(absent DUNE_ROOT env)` β use 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(absent DUNE_STORE_ORIG_SOURCE_DIR env)** β store the original source location indune-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--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 excludes matching directories fromdune build --watch. the option--watch-exclusionscan be repeated to add multiple exclusions, and semicolons can also be used as a separator. if no exclusions are provided, a standard set of exclusions is used β but 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--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.
π MORE HELP π
for help on a single command, hit:
dune COMMAND --help
β EXIT STATUS β
dune external-lib-deps exits with:
0β on success π1β if an error happened π130β if it was interrupted by a signal π
πΈ ENVIRONMENT πΈ
These little env vars are the vibe-setters for external-lib-deps, bestie. Set them and the command does its thing your way π
DUNE_BUILD_DIRβ tells Dune where the build directory should live. If you don't say anything, it's_build, no thoughts head empty πDUNE_CACHEβ turn the Dune cache on or off. Pick one ofdisabled,enabled-except-user-rulesorenabled. The default isenabled-except-user-rulesβ¨DUNE_CACHE_CHECK_PROBABILITYβ this one checks build reproducibility by re-running randomly chosen rules and comparing the results with what's sitting in the Dune cache π§ Heads up though: cranking up the probability of these checks slows your build down. The default probability is zero, meaning literally no rules get checked, periodt.DUNE_CACHE_STORAGE_MODEβ how the Dune cache stores stuff. Pick 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. No hiding, we're being transparent π«ΆDUNE_DIFF_COMMANDβ the shell command used to diff files. Use-to disable printing the diff entirely πDUNE_DISABLE_PROMOTIONβ disables all the promotion rules. All of them. Every single one πDUNE_INSTRUMENT_WITHβ enables instrumentation by BACKENDS. BACKENDS is a comma-separated list of library names, and each one of those libraries has to declare an instrumentation backend π₯DUNE_JOBSβ run no more than JOBS commands at the same time. JOBS has to be a positive integer, orautoto auto-detect the number of cores (which is the default, iconic behaviour honestly) πDUNE_PROFILEβ the build profile. It'sdevif you don't specify anything, orreleaseif-pis set πDUNE_ROOTβ use this directory as the workspace root instead of letting Dune guess it. Quick note though: this option doesn't change how targets given on the command line are interpreted. It's only intended for scripts, iykyk βDUNE_SANDBOXβ the sandboxing mode to use by default. (peep--sandbox) π¦DUNE_STORE_ORIG_SOURCE_DIRβ store the original source location indune-packagemetadata π¦DUNE_TARGET_EXECβ a wrapper command for running target binaries when you're cross-compiling. Format isTOOLCHAIN=CMD(like, for example,'windows=wine') πDUNE_WORKSPACEβ use this specific workspace file instead of making Dune go looking for one π
π BUGS π
Found something cursed? Check the bug reports at https://github.com/ocaml/dune/issues and tell the maintainers, they wanna know fr fr π
π SEE ALSO π
And that's the whole page, bestie, you ate it up π
β¨ This was Dune 3.24.1's write-up of DUNE-EXTERNAL-LIB-DEPS(1) β go forth, check those external lib deps, and slay ππ¦πΈ
π¦ 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