OPAM-ADMIN-UPDATE-EXTRAFILES(1)

πŸ‘‘ OPAM-ADMIN-UPDATE-EXTRAFILES(1) πŸ‘‘

okay so before anything else: this is from the Opam admin Manual, it's the page for opam admin update-extrafiles, and it is long, so we're doing this in parts. This is part 1. Buckle in, bestie πŸŽ€


✨ NAME ✨

opam admin-update-extrafiles β€” adds extra-files to an opam repository. that's the whole vibe. short, sweet, does exactly what it says on the tin πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

so the way you actually call this is:

opam admin update-extrafiles [--hash=HASH_ALGO] [--packages=PACKAGES]
[OPTION]…

like yes, there's an [OPTION]… at the end, there are so many options, we'll get to them, breathe πŸ’…


🌸 DESCRIPTION 🌸

so picture this: the command scans through package definitions, and then adds the extrafiles field as requested. that's it. that's the job. it goes looking, it writes the field, it moves on. main character energy, honestly πŸ¦‹


πŸŽ€ OPTIONS πŸŽ€

these are the ones that belong to this command specifically, not the shared girlies:

  • --hash=HASH_ALGO β€” the hash, or hashes, that are gonna be added. plural hashes, because why be normal πŸ“
  • -p PACKAGES, --packages=PACKAGES β€” only add extra files for the packages you name here. so if you only care about some of them, this is your girl ✨

🌈 COMMON OPTIONS 🌈

okay so these are common to all commands, not just this one. every single one of them, in order, no skips, no cap:

  • --best-effort β€” don't fail just because all the requested packages can't be installed: try to install as many as possible instead. but heads up β€” not all external solvers support this (recent versions of aspcud or mccs should, tho). this is equivalent to setting the $OPAMBESTEFFORT environment variable πŸ’œ
  • --cli=MAJOR.MINOR (absent=2.6) β€” use the command-line interface syntax and semantics of MAJOR.MINOR. this is for any persistent use of opam (scripts, blog posts, etc.) β€” any version of opam in the same MAJOR series will behave as for the specified MINOR release. and here's the tea: the flag wasn't even available in opam 2.0, so if you wanna select the 2.0 CLI, set the OPAMCLI environment variable to 2.0 instead of using this parameter. iykyk 😭
  • --color=WHEN β€” colorize the output. WHEN must be one of always, never or auto. give me the rainbow or give me nothing 🌈
  • --confirm-level=LEVEL β€” confirmation level, and LEVEL must be one of ask, no, yes or unsafe-yes. can be specified more than once. if --yes or --no are also given, the value of the last --confirm-level is taken into account. this is equivalent to setting $OPAMCONFIRMLEVEL ✨
  • --criteria=CRITERIA β€” specify user preferences for dependency solving for this run. overrides $OPAMCRITERIA, $OPAMFIXUPCRITERIA and $OPAMUPGRADECRITERIA. for the details on the supported language, and the external solvers available, see http://opam.ocaml.org/doc/External_solvers.html. a general guide to using solver preferences can be found at http://www.dicosmo.org/Articles/usercriteria.pdf πŸ“š
  • --cudf=FILENAME β€” debug option: save the CUDF requests sent to the solver to FILENAME-<n>.cudf where <n> is the n-th call to the solver during the opam run πŸ›
  • --debug β€” print debug message to stderr. this is equivalent to setting $OPAMDEBUG to "true" πŸ’€
  • --debug-level=LEVEL β€” like --debug, but it lets you specify the debug level (--debug sets it to 1). equivalent to setting $OPAMDEBUG to a positive integer πŸ”₯
  • --git-version β€” print the git version of opam, if set (i.e. you are using a development version), and exit πŸ‘‘
  • --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-pin-depends β€” ignore extra pins required by packages that get pinned, either manually through opam pin or through opam install DIR. this is equivalent to setting IGNOREPINDEPENDS=true πŸ™ˆ
  • --json=FILENAME β€” save the results of the opam run in a computer-readable file. if the filename contains the character %, it will be replaced by an index that doesn't overwrite an existing file. similar to setting the $OPAMJSON variable πŸ’Ύ
  • --no β€” answer no to all opam yes/no questions without prompting. see also --confirm-level. this is equivalent to setting $OPAMNO to "true" 🚫
  • --no-aspcud β€” removed in 2.1. she's gone, bestie, don't reach for her πŸ’€
  • --no-auto-upgrade β€” when configuring or updating a repository that is written for an earlier opam version (1.2), opam internally converts it to the current format. this disables that behaviour. note that repositories should define their format version in a repo file at their root, or they will be assumed to be in the older format. it is, in any case, preferable to upgrade the repositories manually using opam admin upgrade [--mirror URL] when possible 🌱
  • -q, --quiet β€” disables --verbose. the shush button 🀫
  • --root=ROOT β€” use ROOT as the current root path. this is equivalent to setting $OPAMROOT to ROOT 🏠
  • --safe, --readonly β€” make sure nothing will be automatically updated or rewritten. useful for calling from completion scripts, for example. will fail whenever such an operation is needed; also avoids waiting for locks, skips interactive questions and overrides the $OPAMDEBUG variable. this is equivalent to set environment variable $OPAMSAFE πŸ”’
  • --solver=CMD β€” specify the CUDF solver to use for resolving package installation problems. this is either a predefined solver β€” this version of opam supports builtin-mccs+lp(), builtin-mccs+glpk, builtin-dummy-z3-solver, builtin-0install, aspcud, mccs, aspcud-old, packup β€” or a custom command that should contain the variables %{input}%, %{output}%, %{criteria}%, and optionally %{timeout}%. this is equivalent to setting $OPAMEXTERNALSOLVER 🧚
  • --strict β€” fail whenever an error is found in a package definition or a configuration file. the default is to continue silently if possible. (so by default she's chill. with --strict she is NOT chill.) 😀
  • --switch=SWITCH β€” use SWITCH as the current compiler switch. this is equivalent to setting $OPAMSWITCH to SWITCH πŸ”€
  • --use-internal-solver β€” disable any external solver, and use the built-in one (this requires that opam has been compiled with a built-in solver). this is equivalent to setting $OPAMNOASPCUD or $OPAMUSEINTERNALSOLVER πŸ› οΈ
  • -v, --verbose β€” be more verbose. one -v shows all package commands, repeat to also display commands called internally (e.g. tar, curl, patch etc.) repeating n times is equivalent to setting $OPAMVERBOSE to "n" πŸ“’
  • --version β€” show version information 🏷️
  • -w, --working-dir β€” whenever updating packages that are bound to a local, version-controlled directory, update to the current working state of their source instead of the last committed state, or the ref they are pointing to. as source directory is copied as it is, if it isn't clean it may result on a opam build failure. this only affects packages explicitly listed on the command-line. it can also be set with $OPAMWORKINGDIR ⚠️
  • -y, --yes β€” answer yes to all opam yes/no questions without prompting. see also --confirm-level. this is equivalent to setting $OPAMYES to "true" βœ…

okay that's the options situation handled, and there's still more page coming πŸ¦‹ don't go anywhere πŸ’–

✨ ENVIRONMENT ✨

okay bestie so opam is very into environment variables, and here's the whole roster of them 🫢. Quick rule first tho: any variable that's a boolean? set it to "0", "no", "false" or just the empty string to turn it off, and to "1", "yes" or "true" to turn it on. slay.

  • OPAMALLPARENS β€” surrounds all filters with parenthesis. cute and tidy πŸ’…
  • OPAMASSUMEDEPEXTS β€” see the option --assume-depexts.
  • OPAMAUTOANSWER β€” internal use only. not for you, bestie πŸ™ˆ
  • OPAMAUTOREMOVE β€” see the remove option --auto-remove.
  • OPAMBESTEFFORT β€” see the option --best-effort.
  • OPAMBESTEFFORTPREFIXCRITERIA β€” sets the string that must be prepended to the criteria when the --best-effort option is set, and it's expected to maximise the opam-query property in the solution.
  • OPAMBUILDDOC β€” Removed in 2.1. rip πŸ’€
  • OPAMBUILDTEST β€” Removed in 2.1. also rip πŸ’€
  • OPAMCLI β€” see the option --cli.
  • OPAMCOLOR β€” when set to always or never, it sets a default value for the --color option.
  • OPAMCONFIRMLEVEL β€” see the option --confirm-level. heads up: OPAMCONFIRMLEVEL has priority over OPAMYES and OPAMNO.
  • OPAMCRITERIA β€” specifies user preferences for dependency solving. the default value depends on the solver version, so run config report to know the current setting. see also the option --criteria.
  • OPAMCUDFFILE β€” saves the cudf graph to file-actions-explicit.dot.
  • OPAMCUDFTRIM β€” controls the filtering of unrelated packages during CUDF preprocessing.
  • OPAMCURL β€” can be used to select a given curl program. see OPAMFETCH for more options.
  • OPAMDEBUG β€” see the options --debug and --debug-level.
  • OPAMDEBUGSECTIONS β€” if set, it limits debug messages to that space-separated list of sections. sections can optionally have a specific debug level (like CLIENT:2 or CLIENT CUDF:2), but otherwise use --debug-level.
  • OPAMDIGDEPTH β€” defines how aggressive the lookup for conflicts during CUDF preprocessing is.
  • OPAMDOWNLOADJOBS β€” sets the maximum number of simultaneous downloads.
  • OPAMDROPWORKINGDIR β€” overrides packages previously updated with --working-dir on update. without this variable set, opam would keep them unchanged unless they were explicitly named on the command-line.
  • OPAMDRYRUN β€” see the option --dry-run.
  • OPAMEDITOR β€” sets the editor to use for opam file editing, and it overrides $EDITOR and $VISUAL.
  • OPAMERRLOGLEN β€” sets the number of log lines printed when a sub-process fails. 0 prints all of them.
  • OPAMEXTERNALSOLVER β€” see the option --solver.
  • OPAMFAKE β€” see the option --fake.
  • OPAMFETCH β€” specifies how to download files: either wget, curl, or a custom command where the variables %{url}%, %{out}%, %{retry}%, %{compress}% and %{checksum}% will be replaced. this overrides the download-command value from the main config file.
  • OPAMFIXUPCRITERIA β€” same as OPAMUPGRADECRITERIA, but specific to fixup and reinstall.
  • OPAMIGNOREAVAILABLE β€” see the install option --ignore-available-on.
  • OPAMIGNORECONSTRAINTS β€” see the install option --ignore-constraints-on.
  • OPAMIGNOREPINDEPENDS β€” see the option --ignore-pin-depends.
  • OPAMINPLACEBUILD β€” see the option --inplace-build.
  • OPAMJOBS β€” sets the maximum number of parallel workers to run.
  • OPAMJSON β€” logs json output to the given file (use the character % to index the files).
  • OPAMKEEPBUILDDIR β€” see the install option --keep-build-dir.
  • OPAMKEEPLOGS β€” tells opam to not remove some temporary command logs and some backups. this skips some finalisers and may also help to get more reliable backtraces.
  • OPAMLOCKED β€” a combination of the --locked and --lock-suffix options.
  • OPAMLOGS β€” logdir sets the log directory, and the default is a temporary directory in /tmp.
  • OPAMMAKECMD β€” sets the system make command to use.
  • OPAMMERGEOUT β€” merges process outputs, so stderr goes on stdout.
  • OPAMNO β€” answers no to any question asked, see the options --no and --confirm-level. OPAMNO is ignored if either OPAMCONFIRMLEVEL or OPAMYES is set.
  • OPAMNOAGGREGATE β€” with opam admin check, don't aggregate packages.
  • OPAMNOASPCUD β€” Deprecated.
  • OPAMNOAUTOUPGRADE β€” disables the automatic internal upgrade of repositories in an earlier format to the current one, on update or init.
  • OPAMNOCHECKSUMS β€” enables the option --no-checksums when available.
  • OPAMNODEPEXTS β€” disables system dependencies handling, see the option --no-depexts.
  • OPAMNOENVNOTICE β€” Internal.
  • OPAMNOSELFUPGRADE β€” see the option --no-self-upgrade.
  • OPAMPINKINDAUTO β€” sets whether version control systems should be detected when pinning to a local path. enabled by default since 1.3.0 ✨.
  • OPAMPRECISETRACKING β€” fine grain tracking of directories.
  • OPAMPREPRO β€” set this to false to disable CUDF preprocessing. less efficient, but it might help when you're debugging a solver issue.
  • OPAMREPOSITORYTARRING β€” internally stores all non-vcs repositories as tar.gz files (by default, http repositories are stored as archive). this can be much faster on filesystems that don't cope well with scanning large trees. all operations are done in-memory, so there's no I/O for scanning the repository. obsessed πŸ”₯
  • OPAMREQUIRECHECKSUMS β€” enables the option --require-checksums when available (e.g. for opam install).
  • OPAMRETRIES β€” sets the number of tries before failing downloads.
  • OPAMREUSEBUILDDIR β€” see the option --reuse-build-dir.
  • OPAMROOT β€” see the option --root. this is automatically set by opam env --root=DIR --set-root.
  • OPAMROOTISOK β€” don't complain when running as root.
  • OPAMSAFE β€” see the option --safe.
  • OPAMSHOW β€” see the option --show.
  • OPAMSKIPUPDATE β€” see the option --skip-updates.
  • OPAMSKIPVERSIONCHECKS β€” bypasses some version checks. Unsafe, for compatibility testing only ⚠️.
  • OPAMSOLVERALLOWSUBOPTIMAL β€” (default true) allows some solvers to still return a solution when they reach timeout; while the solution remains assured to be consistent, there's no guarantee in this case that it fits the expected optimisation criteria. if true, opam will continue with a warning; if false, a timeout is an error. currently only the builtin-z3 backend handles this degraded case.
  • OPAMSOLVERTIMEOUT β€” change the time allowance of the solver. default is 60.0, and set it to 0 for unlimited. note that not all solvers may support this option.
  • OPAMSOLVERTOLERANCE β€” changes the tolerance towards the solver choosing an unoptimized solution (i.e. it might pull outdated packages πŸ‘€). typical values range from 0.0 (best solution known to the solver) to 1.0 (unoptimized solution). default is 0.0. this option is useful in case the solver can't find a solution in a reasonable time (see $OPAMSOLVERTIMEOUT). note that not all solvers may support this option.
  • OPAMSTATS β€” Removed in 2.4. gone gone πŸ’€
  • OPAMSTATUSLINE β€” displays a dynamic status line showing what's currently going on on the terminal. (one of always, never or auto)
  • OPAMSTRICT β€” fail on inconsistencies (file reading, switch import, etc.).
  • OPAMSWITCH β€” see the option --switch. automatically set by opam env --switch=SWITCH --set-switch.
  • OPAMUNLOCKBASE β€” see the install option --unlock-base.
  • OPAMUPGRADECRITERIA β€” specifies user preferences for dependency solving when performing an upgrade. overrides OPAMCRITERIA in upgrades if both are set. see also the option --criteria.
  • OPAMUSEINTERNALSOLVER β€” see the option --use-internal-solver.
  • OPAMUSEOPENSSL β€” Removed in 2.2. bye πŸ’€
  • OPAMUTF8 β€” use UTF8 characters in output (one of always, never or auto). by default it's auto, which is determined from the locale.
  • OPAMUTF8MSGS β€” use extended UTF8 characters (camels πŸͺ) in opam messages. implies OPAMUTF8. this is set by default on macOS only.
  • OPAMVALIDATIONHOOK β€” if set, uses the %{hook}% command to validate an opam repository update.
  • OPAMVERBOSE β€” see the option --verbose.
  • OPAMVERBOSEON β€” see the option --verbose-on.
  • OPAMVERSIONLAGPOWER β€” do not use. like literally don't 🚫
  • OPAMWITHDEVSETUP β€” see the install option --with-dev-setup.
  • OPAMWITHDOC β€” see the install option --with-doc.
  • OPAMWITHTEST β€” see the install option --with-test.
  • OPAMWORKINGDIR β€” see the option --working-dir.
  • OPAMYES β€” see the options --yes and --confirm-level. OPAMYES has priority over OPAMNO and is ignored if OPAMCONFIRMLEVEL is set.
  • OPAMVAR_var β€” overrides the contents of the variable var when substituting %{var}% strings in opam files.
  • OPAMVAR_package_var β€” overrides the contents of the variable package:var when substituting %{package:var}% strings in opam files.

🌈 CLI VERSION 🌈

okay so listen, this part is lowkey the most important glow-up in opam's whole story ✨. all scripts and programmatic invocations of opam should use --cli so that they keep working seamlessly with future versions of the opam client. and it's not just for scripts either β€” blog posts and other documentation benefit too, because it stops information from going stale. main character energy for your docs, fr fr πŸ“.

although opam only supports roots (~/.opam/) for the current version, it does provide backwards compatibility for its command-line interface. bestie is looking out for you 🫢.

since CLI version support was only added in opam 2.1, you use OPAMCLI to select 2.0 support (as opam 2.0 will just ignore it), and --cli=2.1 for 2.1 (or later) versions β€” because an environment variable controlling the parsing of syntax is brittle. to this end, opam displays a warning if OPAMCLI specifies a valid version other than 2.0, and also if --cli=2.0 is specified. so yeah, you'll know πŸ‘€.

the command-line version is selected by using the --cli option or the OPAMCLI environment variable. --cli may be specified morethan once, where the last instance takes precedence. OPAMCLI is only inspected if --cli is not given.


πŸ’€ EXIT STATUS πŸ’€

Okay bestie, listen up β€” this part is important because exit codes are how scripts know if you're slaying or spiraling. πŸ™ˆ

EXCEPTION ALERT: the exec command is not like the others. It returns 127 if the command wasn't found or couldn't be executed, and otherwise it just returns the command's own exit value. No cap, that's the one exception to everything below.
  • 0 β€” Success! Or true for boolean queries. We love a win. ✨
  • 1 β€” False. Comes back when a boolean return value is expected, like when you run with --check, or for queries like opam lint.
  • 2 β€” Bad command-line arguments, or args that point at an invalid context (e.g. a file that isn't following the expected format). Rookie move, respectfully. 🫢
  • 5 β€” Not found. You asked for something (package, version, repository, etc.) and it literally could not be found. It's giving missing.
  • 10 β€” Aborted. The operation needed confirmation and you didn't give it. You ghosted it. πŸ‘»
  • 15 β€” Could not acquire the locks required for the operation. Someone else has the vibe checked out, bestie.
  • 20 β€” There is no solution to the user request. Like, this can happen when you ask to install two incompatible packages. The math isn't mathing. πŸ’€
  • 30 β€” Error in package definition, or other metadata files. Using --strict raises this error more often. (Strict mode is that friend who notices everything.)
  • 31 β€” Package script error. Some package operations were unsuccessful. Could be an error in the packages, could be an incompatibility with your system. This can be a partial error β€” so not everything died, just some of it. 😭
  • 40 β€” Sync error. Could not fetch some remotes from the network. Also can be a partial error. Wifi said no. πŸ“‘
  • 50 β€” Configuration error. Opam or your system configuration doesn't allow this operation and it needs fixing. It's not you, it's the setup.
  • 60 β€” Solver failure. The solver failed to return a sound answer. Could be a broken external solver, or an error in solver configuration. Not its fault, but also not your problem to fix at 3am.
  • 99 β€” Internal error. Something went wrong, likely due to a bug in opam itself. Not you. Never you. Report it. πŸ›
  • 130 β€” User interrupt. SIGINT was received, generally because the user pressed Ctrl+C. You did this. We all do this.
  • 0 β€” on success.
  • 123 β€” on indiscriminate errors reported on standard error.
  • 124 β€” on command line parsing errors.
  • 125 β€” on unexpected internal errors (bugs).

πŸ“š FURTHER DOCUMENTATION πŸ“š

See https://opam.ocaml.org/doc.

That's the lore drop. Go read it. πŸ¦‹


πŸ‘‘ AUTHORS πŸ‘‘

These are the icons who built this. Show some respect, bestie. πŸ’…

  • David Allsopp <david@tarides.com>
  • Vincent Bernardoff <vb@luminar.eu.org>
  • Raja Boujbel <raja.boujbel@ocamlpro.com>
  • Kate Deplaix <kit-ty-kate@exn.st>
  • Roberto Di Cosmo <roberto@dicosmo.org>
  • Thomas Gazagnaire <thomas@gazagnaire.org>
  • Louis Gesbert <louis.gesbert@ocamlpro.com>
  • Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
  • Anil Madhavapeddy <anil@recoil.org>
  • Guillem Rieu <guillem.rieu@ocamlpro.com>
  • Ralf Treinen <ralf.treinen@pps.jussieu.fr>
  • Frederic Tuong <tuong@users.gforge.inria.fr>

🌈 SEE ALSO 🌈

  • opam admin(1) β€” the main character. Go read that one too, fr fr.

πŸ› BUGS πŸ›

Check bug reports at https://github.com/ocaml/opam/issues.

Found something cursed? Say it with your chest, in the issue tracker. ✨


And that's a wrap on the whole page, mwah πŸ’– β€” this was Opam admin 2.6.1, page OPAM ADMIN-U…E-EXTRAFILES(1), and now you're officially educated. Go forth and update those extra-files, diva. πŸŽ€πŸ«Ά

πŸ“¦ where this page comes from