OPAM-INFO(1)

πŸ’– OPAM-INFO(1) πŸ’–

okay so this is the manual page for opam-info, which lives in the Opam Manual (yes, that's the manual name, that's the vibe) ✨ part 1 of 3, so don't go anywhere bestie, there's more coming 🫢


🌸 NAME 🌸

opam-info β€” it's an alias for show. that's it. that's the whole entire job description. no cap. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

opam info [OPTION]… [PACKAGES]…

πŸ¦‹ DESCRIPTION πŸ¦‹

so like, opam info is literally just another name for opam show. they're the same thing. the same girl, two outfits. πŸ‘‘

like, if you wanna know the actual details, go read opam show --help, because that's where the real tea is. πŸ“


✨ ARGUMENTS ✨

  • PACKAGES β€” a list of package names, and you can optionally throw a version or a constraint on them, e.g. pkg, pkg.1.0 or pkg>=0.5. OR it can be files / directory names that contain a package description, and for those you have to give the explicit directory (think ./foo.opam or .). fr fr. 🌈

πŸ’… OPTIONS πŸ’…

  • --all-versions β€” show info for all the packages that match PACKAGES, instead of being restrained to just one single package that matches the PACKAGES constraints. let her be free. πŸ¦‹
  • --empty-fields β€” show the fields that are empty too. and not me telling you this: it's implied whenever you pass --field. so it just comes along for the ride. πŸ’–
  • -f FIELDS, --field=FIELDS β€” only show the values of these specific fields, bestie. you can pick from: name, version, package, synopsis, synopsis-or-target, description, <field>, <field>:, installed-version, pin, source-hash, opam-file, all-installed-versions, available-versions, all-versions, repository, installed-files, vc-ref, depexts. you can separate multiple ones with commas, and if you do, the field titles get printed too. and you can query the raw value of any opam-file field by combining it with --raw. iykyk 😌
  • --file=FILE (absent=-) β€” removed in 2.1, use --just-file instead. she's gone, she's not coming back, rip πŸ’€
  • --just-file β€” load and display info from the given files (allowed PACKAGES here are file or directory paths), and it does not care about the repositories or the state of the package. this implies --raw unless --fields is used. only raw opam-file fields can be queried. and if you give no PACKAGES argument at all, it reads the opam file from stdin. main character energy, reading from stdin and all 🌟
  • --list-files β€” list the files that the package installed. equivalent to --field=installed-files, and heads up: it's only available for installed packages. no install, no list. πŸ™ˆ
  • --no-lint β€” don't output linting warnings or errors when reading from files. silence is golden ✨
  • --normalise β€” print the values of opam fields all normalised: no newlines, no implicit brackets. tidy. clean. iconic. πŸŽ€
  • --raw β€” print the raw opam file for this package. the whole thing, unfiltered. πŸ”₯
  • --sort β€” sort the opam fields. alphabetical slay πŸ’…
  • --where β€” print the location of the opam file used for this package. so you know where the drama is coming from. πŸ‘‘

🌈 COMMON OPTIONS 🌈

these options are common to all commands, so like, they show up everywhere. periodt.

  • --best-effort β€” don't fail if all the requested packages can't be installed: just try to install as many as possible. note that not all external solvers may support this option (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 one's intended for any persistent use of opam (scripts, blog posts, etc.) β€” any version of opam in the same MAJOR series will behave as it did for the specified MINOR release. the flag wasn't available in opam 2.0, so to select the 2.0 CLI, set the OPAMCLI environment variable to 2.0 instead of using this parameter. okay nostalgia πŸ’œ
  • --color=WHEN β€” colorize the output. WHEN has to be one of always, never or auto. pick your aesthetic 🌸
  • --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 what counts. this is equivalent to setting $OPAMCONFIRMLEVEL. ⚠️ (unsafe-yes is literally named unsafe, bestie, tread carefully)
  • --criteria=CRITERIA β€” specify your user preferences for dependency solving for this run. it overrides $OPAMCRITERIA, $OPAMFIXUPCRITERIA and $OPAMUPGRADECRITERIA. for details on the supported language, and the external solvers available, see http://opam.ocaml.org/doc/External_solvers.html. and a general guide to using solver preferences lives 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. detective mode πŸ”
  • --debug β€” print debug messages to stderr. this is equivalent to setting $OPAMDEBUG to "true". πŸ™ˆ
  • --debug-level=LEVEL β€” like --debug, but you get to specify the debug level (--debug just sets it to 1). equivalent to setting $OPAMDEBUG to a positive integer. dial it up πŸ’…
  • --git-version β€” print the git version of opam, if it's set (i.e. you're 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. bestie behaviour fr 🫢
  • --ignore-pin-depends β€” ignore extra pins required by packages that get pinned, whether 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 gets replaced by an index that doesn't overwrite an existing file. similar to setting the $OPAMJSON variable. data girlie ✨
  • --no β€” answer no to all opam yes/no questions without prompting. see also --confirm-level. this is equivalent to setting $OPAMNO to "true". just say no 🚫
  • --no-aspcud β€” removed in 2.1. she's not here anymore bestie 😭
  • --no-auto-upgrade β€” when configuring or updating a repository that's 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'll 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. πŸ”§
  • --no-self-upgrade β€” opam will replace itself with a newer binary found at OPAMROOT/opam if present. this disables that behaviour. no glow-ups today πŸ’…
  • -q, --quiet β€” disables --verbose. shhh 🀫
  • --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. super useful for calling from completion scripts, for example. it will fail whenever such an operation is needed; it also avoids waiting for locks, skips interactive questions and overrides the $OPAMDEBUG variable. this is equivalent to set environment variable $OPAMSAFE. look but don't touch πŸ‘€
  • --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. solver slay 🧠
  • --strict β€” fail whenever an error is found in a package definition or a configuration file. the default is to continue silently if possible. glowing difference between the two ngl ✨
  • --switch=SWITCH β€” use SWITCH as the current compiler switch. this is equivalent to setting $OPAMSWITCH to SWITCH. flick the 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. homegrown solver energy 🏠
  • -v, --verbose β€” be more verbose. one -v shows all package commands, and you repeat it to also display commands called internally (e.g. tar, curl, patch etc.). repeating it n times is equivalent to setting $OPAMVERBOSE to "n". give me all the lore πŸ“’
  • --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're pointing to. and because the source directory is copied as it is, if it isn't clean it may result in a opam build failure. this only affects packages explicitly listed on the command-line. it can also be set with $OPAMWORKINGDIR. ⚠️ clean your dir first bestie
  • -y, --yes β€” answer yes to all opam yes/no questions without prompting. see also --confirm-level. this is equivalent to setting $OPAMYES to "true". yes queen πŸ’–

…and that's not even the whole page πŸ‘€ stay tuned πŸ’…

🌸 ENVIRONMENT 🌸

Okay bestie, buckle up, because opam is obsessed with environment variables and there are like a million of them. opam makes use of the environment variables listed here. πŸ’–

✨ Pro tip for the boolean ones: set them to "0", "no", "false" or just an empty string to disable them, and "1", "yes" or "true" to enable them. That's the whole vibe check. πŸŽ€
  • OPAMALLPARENS β€” surround all filters with parenthesis. Yes, all of them. 🫢
  • OPAMASSUMEDEPEXTS β€” see option `--assume-depexts'.
  • OPAMAUTOANSWER β€” internal use only. Don't touch, it's not for us. πŸ™ˆ
  • OPAMAUTOREMOVE β€” see remove option `--auto-remove'.
  • OPAMBESTEFFORT β€” see option `--best-effort'.
  • OPAMBESTEFFORTPREFIXCRITERIA β€” sets the string that must be prepended to the criteria when the --best-effort' option is set, and is expected to maximise the opam-query' property in the solution. Very demure, very mindful. πŸ’…
  • OPAMBUILDDOC β€” Removed in 2.1. RIP girl, you're gone. πŸ’€
  • OPAMBUILDTEST β€” Removed in 2.1. Also gone. πŸ’€
  • OPAMCLI β€” see option `--cli'.
  • OPAMCOLOR β€” when set to always or never, sets a default value for the --color option.
  • OPAMCONFIRMLEVEL β€” see option --confirm-level. Heads up bestie: OPAMCONFIRMLEVEL has priority over OPAMYES and OPAMNO. πŸ‘‘
  • OPAMCRITERIA β€” specifies user preferences for dependency solving. The default value depends on the solver version, so use config report' to find out what the current setting is. See also option --criteria`.
  • OPAMCUDFFILE β€” save 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 options --debug' and --debug-level'.
  • OPAMDEBUGSECTIONS β€” if set, limits debug messages to the space-separated list of sections. Sections can optionally have a specific debug level (for example, 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. No more chaotic parallel chaos than this number allows. ✨
  • OPAMDROPWORKINGDIR β€” overrides packages previously updated with --working-dir on update. Without this variable set, opam would keep them unchanged unless they're explicitly named on the command-line.
  • OPAMDRYRUN β€” see option `--dry-run'.
  • OPAMEDITOR β€” sets the editor to use for opam file editing, and it overrides $EDITOR and $VISUAL. Main character energy only. πŸ’…
  • OPAMERRLOGLEN β€” sets the number of log lines printed when a sub-process fails. 0 prints all of them. All. Of. Them. 😭
  • OPAMEXTERNALSOLVER β€” see option `--solver'.
  • OPAMFAKE β€” see 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. Overrides the 'download-command' value from the main config file.
  • OPAMFIXUPCRITERIA β€” same as OPAMUPGRADECRITERIA, but specific to fixup and reinstall. Same energy, different context. πŸ’œ
  • OPAMIGNOREAVAILABLE β€” see install option `--ignore-available-on'.
  • OPAMIGNORECONSTRAINTS β€” see install option `--ignore-constraints-on'.
  • OPAMIGNOREPINDEPENDS β€” see option `--ignore-pin-depends'.
  • OPAMINPLACEBUILD β€” see option `--inplace-build'.
  • OPAMJOBS β€” sets the maximum number of parallel workers to run. Go off, workers. πŸ”₯
  • OPAMJSON β€” log json output to the given file (use the character % to index the files).
  • OPAMKEEPBUILDDIR β€” see 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 β€” combination of --locked' and --lock-suffix' options.
  • OPAMLOGS β€” logdir sets log directory, default is a temporary directory in /tmp.
  • OPAMMAKECMD β€” set the system make command to use.
  • OPAMMERGEOUT β€” merge process outputs, stderr on stdout.
  • OPAMNO β€” answer no to any question asked, see options --no and --confirm-level. Careful though: OPAMNO is ignored if either OPAMCONFIRMLEVEL or OPAMYES is set. 🫣
  • OPAMNOAGGREGATE β€” with `opam admin check', don't aggregate packages.
  • OPAMNOASPCUD β€” Deprecated. Bestie, it's over. πŸ’€
  • OPAMNOAUTOUPGRADE β€” disables automatic internal upgrade of repositories in an earlier format to the current one, on 'update' or 'init'.
  • OPAMNOCHECKSUMS β€” enables option --no-checksums when available.
  • OPAMNODEPEXTS β€” disables system dependencies handling, see option `--no-depexts'.
  • OPAMNOENVNOTICE β€” Internal. 🀫
  • OPAMNOSELFUPGRADE β€” see 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 might help debugging solver issues. Sometimes the messier way is the way. πŸ›
  • OPAMREPOSITORYTARRING β€” internally store 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, no I/O for scanning the repository. Literally iconic. ✨
  • OPAMREQUIRECHECKSUMS β€” enables option --require-checksums' when available (e.g. for opam install').
  • OPAMRETRIES β€” sets the number of tries before failing downloads.
  • OPAMREUSEBUILDDIR β€” see option `--reuse-build-dir'.
  • OPAMROOT β€” see option --root'. This is automatically set by opam env --root=DIR --set-root'.
  • OPAMROOTISOK β€” don't complain when running as root. Yes ma'am, live your truth. πŸ‘‘
  • OPAMSAFE β€” see option `--safe'.
  • OPAMSHOW β€” see option `--show'.
  • OPAMSKIPUPDATE β€” see option `--skip-updates'.
  • OPAMSKIPVERSIONCHECKS β€” bypasses some version checks. Unsafe, for compatibility testing only. Do not do this casually, bestie, I'm serious. 🚨
  • OPAMSOLVERALLOWSUBOPTIMAL β€” (default true) allows some solvers to still return a solution when they reach timeout; while the solution remains assured to be consistent, there is 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, set to 0 for unlimited. Note that all solvers may not support this option.
  • OPAMSOLVERTOLERANCE β€” changes the tolerance towards the solver choosing an unoptimized solution (i.e. 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 all solvers may not support this option.
  • OPAMSTATS β€” Removed in 2.4. Gone but not forgotten. πŸ•ŠοΈ
  • OPAMSTATUSLINE β€” display a dynamic status line showing what's currently going on on the terminal. (one of one of always, never or auto β€” yeah it says "one of" twice, we love her for that πŸ’€)
  • OPAMSTRICT β€” fail on inconsistencies (file reading, switch import, etc.). No chaos allowed. βœ‹
  • OPAMSWITCH β€” see option --switch'. Automatically set by opam env --switch=SWITCH --set-switch'.
  • OPAMUNLOCKBASE β€” see 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 option --criteria.
  • OPAMUSEINTERNALSOLVER β€” see option `--use-internal-solver'.
  • OPAMUSEOPENSSL β€” Removed in 2.2. Another one bites the dust. πŸ’€
  • OPAMUTF8 β€” use UTF8 characters in output (one of one of always, never or auto). By default 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 option `--verbose'.
  • OPAMVERBOSEON β€” see option --verbose-on
  • OPAMVERSIONLAGPOWER β€” do not use. That's it. That's the whole description. πŸ™…
  • OPAMWITHDEVSETUP β€” see install option `--with-dev-setup'.
  • OPAMWITHDOC β€” see install option `--with-doc'.
  • OPAMWITHTEST β€” see install option `--with-test.
  • OPAMWORKINGDIR β€” see option `--working-dir'.
  • OPAMYES β€” see options --yes' and --confirm-level. **OPAMYEShas priority overOPAMNOand is ignored ifOPAMCONFIRMLEVEL` 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 πŸ¦‹

OK this section is short but it's important, so listen up bestie. πŸ‘‚

All scripts and programmatic invocations of opam should use `--cli' in order to ensure that they work seamlessly with future versions of the opam client. Plus, blog posts or other documentation can benefit too, because it prevents information from becoming stale. Future-proofing? We love to see it. πŸ‘‘

Although opam only supports roots (~/.opam/) for the current version, it does provide backwards compatibility for its command-line interface. Sweet of her tbh. 🫢

Since CLI version support was only added in opam 2.1, 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. She's calling you out, gently. πŸŽ€

The command-line version is selected by using the --cli' option or the OPAMCLIenvironment variable.--cli' may be specified more than once, where the last instance takes precedence. OPAMCLI is only inspected if `--cli' is not given. ✨

πŸ’₯ EXIT STATUS πŸ’₯

okay so this is the part where opam tells you why it's leaving, and bestie, the numbers MATTER. Remember: it's not just "it broke" β€” every number is a whole mood, and you gotta read the number to know what's up. πŸ”

🚨 ONE HUGE EXCEPTION THO: the exec command plays by its own rules. exec returns 127 if the command wasn't found or couldn't be executed, and otherwise it just gives you the command's own exit value. Not opam's. The command's. periodt.
  • 0 β€” Success ✨ or, for boolean queries, true.
  • 1 β€” False. It comes back when a boolean return value is expected, like when you're running with --check, or for queries such as opam lint.
  • 2 β€” Bad command-line arguments πŸ™ˆ β€” or command-line arguments that point at an invalid context (say, a file that doesn't follow the expected format).
  • 5 β€” Not found. You asked for something (a package, a version, a repository, whatever) and it genuinely isn't there. πŸ’€
  • 10 β€” Aborted. The operation needed confirmation, and confirmation was not given.
  • 15 β€” Couldn't get the locks required for the operation. πŸ”’
  • 20 β€” No solution to what you asked for. Like, imagine requesting two incompatible packages β€” yeah, that. 😭
  • 30 β€” Error in a package definition, or in other metadata files. Using --strict makes this one show up way more often.
  • 31 β€” Package script error. Some package operations were unsuccessful. Could be a problem in the packages themselves, or an incompatibility with your system. Heads up: this one can be a partial error.
  • 40 β€” Sync error. Some remotes couldn't be fetched from the network. Also can be a partial error. πŸ“‘
  • 50 β€” Configuration error. Opam or your system config doesn't allow the operation, and it needs fixing before you can move on.
  • 60 β€” Solver failure. The solver couldn't return a sound answer. Could be a broken external solver, or an error in the solver configuration. 🧠πŸ’₯
  • 99 β€” Internal error. Something went wrong, and it's most likely a bug in opam itself. not opam catching strays, it said it itself.
  • 130 β€” User interrupt. SIGINT was received, which is generally what happens when you press Ctrl+C. πŸ›‘

and then there's this other little batch of codes, also just vibing here:

  • 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 πŸ“š

the extra reading exists, bestie: https://opam.ocaml.org/doc</p> β€” go, read, slay. πŸ’…


πŸ‘‘ AUTHORS πŸ‘‘

okay so these are the actual legends who built this thing, give them their flowers fr fr 🫢🌸:

  • 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(1) β€” the main character herself, obviously iykyk πŸ’œβœ¨

πŸ› BUGS πŸ›

found something cursed? the bug reports live at https://github.com/ocaml/opam/issues β€” go check 'em there, don't suffer in silence babe πŸ’–


and that's a wrap on OPAM-INFO(1), brought to you by Opam 2.6.1 πŸŽ€ go forth, read your exit codes, and remember: the vibe check is eternal πŸ¦‹β­πŸ†

πŸ“¦ where this page comes from