DUNE-UPGRADE(1)
β¨ DUNE-UPGRADE(1) β¨
okay bestie so this is dune-upgrade from the Dune Manual, section 1 of the manual pages. it's giving "glow up your whole project" energy and honestly? iconic. π¦
π NAME π
dune-upgrade β upgrade projects across major Dune versions. like a little glow-up for your repo, no cap.
πΈ SYNOPSIS πΈ
dune upgrade [OPTION]β¦
β¨ DESCRIPTION β¨
so what this does: dune upgrade upgrades all the projects in the workspace to the latest major version of Dune. every single one. it's a whole-workspace makeover, periodt. π
π OPTIONS π
--action-stderr-on-success=VALβ same vibe as--action-stdout-on-successbut for standard error instead of standard output. lowkey a great default for big mono-repositories is--action-stdout-on-success=swallowplus--action-stderr-on-success=must-be-empty. that combo means a successful build has a "clean", empty output. chef's kiss. π§--action-stdout-on-success=VALβ decides how we handle the standard output of actions when they succeed. the possible values are:printβ just print it right into Dune's outputswallowβ completely ignore it, like it never happened πmust-be-emptyβ enforce that the action printed nothing. with this one, Dune will consider the action failed if it printed anything to its standard output.
the default is print.
--build-infoβ show build information. receipts, basically. π§Ύ--display-separate-messagesβ separate error messages with a blank line. breathing room for your problems β¨--error-reporting=VAL(absent=deterministic) β controls when build errors get reported:earlyβ reports errors as soon as they are discovereddeterministicβ reports errors at the end of the build, in a deterministic ordertwiceβ reports each error twice: once as soon as it's discovered, and then again at the end of the build, in a deterministic order. double the drama, double the fun π
-f,--forceβ force actions associated to aliases to be re-executed even if their dependencies haven't changed. rude? maybe. effective? yes. π₯--file-watcher=VAL(absent=automatic) β the mechanism for detecting changes in the source:automaticβ makes dune run an external program to detect changesmanualβ you notify dune that files have changed, manually, yourself
--passive-watch-modeβ similar to--watch, but it only starts a build when instructed externally by an RPC. it's the chill, wait-to-be-asked version. π--sandbox=VAL(absentDUNE_SANDBOXenv) β set the sandboxing mode. some actions require a certain sandboxing mode, so they'll just ignore this setting (they're like that). the allowed values are:none,symlink,copy,hardlink.--stop-on-first-errorβ stop the build the moment an error is encountered. no mercy. π-w,--watchβ instead of terminating the build after completion, wait continuously for file changes. it stays. it's committed. π«Ά--wait-for-filesystem-clockβ okay 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 should probably not care about this option; it's mostly useful for Dune developers to make Dune tests of the digest cache more reproducible. iykyk. β
π COMMON OPTIONS π
these options are common to all commands, so they're the group-chat regulars. no cap.
--always-show-command-lineβ always show the full command lines of programs executed by dune. full transparency, we love to see it π--auto-promoteβ automatically promote files. this is similar to runningdune promoteafter the build.--build-dir=FILE(absentDUNE_BUILD_DIRenv) β specified build directory._buildif unspecified.--cache=VAL(absentDUNE_CACHEenv) β enable or disable Dune cache. one ofdisabled,enabled-except-user-rulesorenabled. 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 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. zero thoughts, head empty π--cache-storage-mode=VAL(absentDUNE_CACHE_STORAGE_MODEenv) β 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. the full lore, never edited. π--debug-dependency-pathβ in case of error, print the dependency path from the targets on the command line to the rule that failed. it shows you exactly who did this. π--debug-package-logs(absentDUNE_DEBUG_PACKAGE_LOGSenv) β always print the standard logs when building packages.--default-target=TARGET(absent=@@default) β set the default target that is used when none is specified todune build.--diff-command=VAL(absentDUNE_DIFF_COMMANDenv) β shell command to use to diff files. use-to disable printing the diff.--disable-promotion(absentDUNE_DISABLE_PROMOTIONenv) β disable all promotion rules.--display=MODEβ control the display mode of Dune. 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 after the build is complete. data dump, literally π--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 ones with(only ...). the variable%{ignoring_promoted_rules}in dune files reflects whether this option was passed or not.--instrument-with=BACKENDS(absentDUNE_INSTRUMENT_WITHenv) β enable instrumentation byBACKENDS.BACKENDSis a comma-separated list of library names, each one of which 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 (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 are executed in parallel. however, this can be an issue when debugging long running tests. with--no-buffer, commands have 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 in conjunction with-j 1, to avoid interleaving. additionally you should use--verboseas well, to make sure that commands are printed before they are being executed. bestie this one's highkey a whole procedure, read it twice π--no-configβ do not load the configuration file.--no-print-directoryβ suppress "Entering directory" messages. quiet luxury π--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 is mostly meant for releases. during development, it is likely that what you 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.--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, as-pimplies this option.--require-dune-project-file[=VAL](default=true) β fail if adune-projectfile is missing. no dune-project, no service π--root=DIR(absentDUNE_ROOTenv) β 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.--store-orig-source-dir(absentDUNE_STORE_ORIG_SOURCE_DIRenv) β store 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 are 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. semicolons can be also used as a separator. 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--workspace=FILE(absentDUNE_WORKSPACEenv) β use this specific workspace file instead of looking it up.-x VAL(absentDUNE_CROSS_TARGETenv) β cross-compile using this toolchain.
π«Ά MORE HELP π«Ά
use `dune COMMAND --help' for help on a single command. one command at a time, bestie, we can't do everything at once π
β EXIT STATUS β
dune upgrade exits with:
0β on success. slay. π1β if an error happened. unfortunate. π130β if it was interrupted by a signal.
πΈ ENVIRONMENT πΈ
okay bestie, so upgrade reads a bunch of environment variables and they lowkey run the whole show. here's every single one, no skips π
DUNE_BUILD_DIRβ where the build directory lives. if you just leave it vibing, it's_build.DUNE_CACHEβ turns the Dune cache on or off. you gotta pick one ofdisabled,enabled-except-user-rulesorenabled. the default isenabled-except-user-rules.DUNE_CACHE_CHECK_PROBABILITYβ this one re-runs rules that were picked at random and compares the results against what's sitting in the Dune cache, so you can check whether your builds are actually reproducible. β οΈ heads up: cranking up the probability slows your build down, no cap. default probability is zero, meaning no rules get checked at all.DUNE_CACHE_STORAGE_MODEβ the storage mode for the Dune cache, 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β the shell command used to diff files. pass-to disable printing the diff entirely.DUNE_DISABLE_PROMOTIONβ kills all promotion rules. all of them. πDUNE_INSTRUMENT_WITHβ enables instrumentation by BACKENDS. BACKENDS is a comma-separated list of library names, and every single one of them has to declare an instrumentation backend.DUNE_JOBSβ never run 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, slay).DUNE_PROFILEβ the build profile.devif it's unspecified, orreleaseif-pis set.DUNE_ROOTβ use this directory as the workspace root instead of letting Dune guess it. π note: this doesn't change how targets given on the command line get interpreted β it's only meant for scripts.DUNE_SANDBOXβ the sandboxing mode used by default. (peep--sandboxfor the deets)DUNE_STORE_ORIG_SOURCE_DIRβ stores the original source location indune-packagemetadata.DUNE_TARGET_EXECβ a wrapper command for running target binaries when you're cross-compiling. format:TOOLCHAIN=CMD(like, for example,'windows=wine').DUNE_WORKSPACEβ use this specific workspace file instead of looking one up.
π BUGS π
found something cursed? go check the bug reports at https://github.com/ocaml/dune/issues π«Ά
π SEE ALSO π
and that's the whole page bestie, you ate that π
β¨ this one's from Dune 3.24.1, and it's the DUNE-UPGRADE(1) manual β go forth and upgrade responsibly, mwah ππ¦
π¦ 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