OPAM-PIN(1)
π opam-pin β the pinning manual (page 1 of 5)
okay bestie, welcome to the opam-pin(1) section of the Opam Manual. yes it's a real manual, yes it's long, yes we're doing this together π
πΈ NAME πΈ
opam-pin β Pin a given package to a specific version or source.
β¨ SYNOPSIS β¨
opam pin [OPTION]β¦ [COMMAND] [ARG]β¦
π¦ DESCRIPTION π¦
so basically, this command is how you do local customisation of the packages inside a given switch. a pin can be super chill (just force a version, that's it, no notes) or it can be a whole thing: a local, editable version of the package definition. and get this β you can literally manifest a brand new package into existence just by pinning a package name that doesn't exist yet. main character energy fr π
every single customisation you could ever want is reachable through the edit subcommand, but the command line is out here making life easy for the most common case: changing the source URL of a package. because let's be honest, that's what everyone's actually doing. so like:
opam pin add PKG URL
modifies package PKG so it fetches its source from URL. and if there's a package definition chillin' inside the package's source tree, opam will use that locally. iconic.
if you pass - (or, y'know, just -), the package gets pinned without a source archive. and you can skip the package name entirely if the target is a directory that has one or more valid package definitions inside it. which is how you get to do stuff like running:
opam pin add .
straight from a source directory. convenient, right? π«Ά
if PACKAGE is written in the form name.version, opam will consider the pinned package to be at version version. β οΈ beware though: this has nothing to do with the version of the source that actually gets used for the package. they're separate things! see also the --with-version option if this is the part that's confusing you.
and the default subcommand? if there are no further arguments it's list, and otherwise it's add β but only if it's unambiguous.
π COMMANDS π
with no argument, it defaults to list.
listβ Lists pinned packages. If the source is a remote repository, it displays the hash representing its state. π«scan DIRβ Lists available packages to pin in directory.add [PACKAGE] TARGETβ Pins packagePACKAGEtoTARGET, which may be a version, a path, or a URL.PACKAGEcan be omitted ifTARGETcontains one or more package descriptions.TARGETcan be replaced by--dev-repoif a package by that name is already known, or--currentif the package is already installed. IfTARGETis-, the package is pinned as a virtual package, without any source. opam will infer the kind of pinning from the format (and contents, if local) ofTARGET, so use--kindor an explicit URL to disable that behaviour. Pins to version control systems may target a specific branch or commit using#branch, e.g.git://host/me/pkg#testing. IfPACKAGEis not a known package name, a new package by that name will be locally created. For source pinnings, the package version may be specified by using the formatNAME.VERSIONforPACKAGE, in the source opam file, or withedit. π₯remove PACKAGES...|TARGETβ Unpins packagesPACKAGES, restoring their definition from the repository, if any. With aTARGET, unpins everything that is currently pinned to that target. bye felicia πedit NAMEβ Opens an editor giving you the opportunity to change the package definition that opam will locally use for packageNAME, including its version and source URL. Using the formatNAME.VERSIONwill update the version in the opam file in advance of editing, without changing the actual target. The chosen editor is determined from environment variablesOPAMEDITOR,VISUALorEDITOR, in order. π
π OPTIONS π
--allβ When unpinning, removes all pins in the given switch.--currentβ When pinning, use the currently installed version and metadata of the package: this will avoid reinstallations due to upstream metadata changes, and may also be used to keep a package that was removed upstream.--dev-repoβ Pin to the upstream package source for the latest development version-e,--editβ Withopam pin add, edit the opam file as withopam pin editafter pinning.-k KIND,--kind=KINDβ Sets the kind of pinning. Must be one ofversion,path,http,git,darcs,hg,noneorauto. If unset orauto, is inferred from the format of the target, defaulting to the appropriate version control if one is detected in the given directory, or topathotherwise.OPAMPINKINDAUTOcan be set to"0"to disable automatic detection of version control. Usenoneto pin without a target (for virtual packages).-n,--no-actionβ Just record the new pinning status, and don't prompt for (re)installation or removal of affected packages.--normaliseβ Print list of available package to pin in formatname.version^url, that is comprehensible byopam pin add. Available only with thescansubcommand. An example of use is:
opam pin scan . --normalise | grep foo | xargs opam pin add
--recursiveβ Allow recursive lookups of*.opamfiles. Cf.--subpathalso. π-s,--shortβ Output raw lists of names, one per line, skipping any details.--subpath=PATHβ*.opamfiles are retrieved from the given sub directory instead of top directory. Sources are then taken from the targeted sub directory, internally only this subdirectory is copied/fetched. It can be combined with--recursiveto have a recursive lookup on the subpath.--with-version=VERSIONβ Set the pinning version toVERSIONfor namedPACKAGESor packages retrieved fromTARGET. It has priority over any other version specification (opam file version field,name.versargument)). When pinning to a version, the package source from that version is used, but declared as beingVERSIONto opam. Using--with-versionis equivalent to using--editand adjusting the version in the package definition file. π
that's part 1 bestie, don't go anywhere β there's more π
β¨ PACKAGE BUILD OPTIONS β¨
ok so this is where the real β¨buildβ¨ energy lives, bestie. every flag that changes how opam builds stuff lives right here, and ngl there's a lot of them so buckle up π
--assume-depextsβ skips the whole install step for any system packages you're missing, and just. tries to compile the opam packages anyway π. if the install actually works out, opam won't nag you about those system packages ever again. only applies if external dependency handling is turned on in the first place, so if it's off this does literally nothing.-b,--keep-build-dirβ keeps the build directories around after packages compile, instead of yeeting them ποΈ. this is giving exactly the same energy as setting$OPAMKEEPBUILDDIRto"true".--build-docβ removed in 2.1 π use--with-docinstead.--build-testβ removed in 2.1 π use--with-testinstead.-d,--with-docβ builds the package documentation π. lowkey important: this only affects packages listed on the command-line, not their whole dependency tree. same vibe as setting$OPAMWITHDOC(or the deprecated$OPAMBUILDDOC) to"true".--dry-runβ simulates the command without actually changing anything π§ͺ. a little preview, a lil dress rehearsal. you can also set this with the environment variable$OPAMDEBUG.--fakeβ registers the actions into the opam database without actually performing them.
β οΈ WARNING: this option is dangerous and likely to break your opam environment. π like, actually. you probably want --dry-run instead. you've been warned, bestie, don't come crying to me π«Ά
--ignore-available-on[=PACKAGES](default=``) β forces opam to mark the listed packages as available β . great for testing compatibility, but expect builds to break when you use this, fr fr. heads up: version constraints of the packages' dependencies are unaffected by this.--ignore-constraints-on[=PACKAGES](default=``) β makes opam ignore version constraints on all the dependencies of the listed packages π . same deal, cute for compatibility testing but expect the builds to crumble. note that the availability of the packages, plus version constraints on optional dependencies and conflicts, are all unaffected. equivalent to setting$OPAMIGNORECONSTRAINTS.--inplace-buildβ when you're compiling a package whose source is bound to a local directory, this processes the build and install actions directly in that directory instead of in a clean copy that opam handles π . only affects packages explicitly listed on the command-line. equivalent to setting$OPAMINPLACEBUILDto"true".-j JOBS,--jobs=JOBSβ sets the max number of concurrent jobs to use β‘. the default is calculated from your number of cores (math girlie behavior π ). you can also set this with the$OPAMJOBSenvironment variable.--lock-suffix=SUFFIX(absent=locked) β sets the locked files suffix to SUFFIX π.--lockedβ in commands that use opam files found from pinned sources, if there's a variant of the file with an added.lockedextension hanging around (likefoo.opam.lockedsitting next tofoo.opam), that one gets used instead π. this is typically useful for offering a more specific set of dependencies and reproducing similar build contexts β hence the name, iykyk. thelockoption can generate such files, based on the versions of dependencies currently installed on your host. equivalent to setting the$OPAMLOCKEDenvironment variable. note that this option doesn't generally affect already pinned packages.-m MAKE,--make=MAKEβ removed in 2.1 π useopam config set[-global] make MAKEinstead.--no-checksumsβ doesn't verify the checksum of downloaded archives π«π. equivalent to setting$OPAMNOCHECKSUMSto"true".--no-depextsβ temporarily disables handling of external dependencies βΈοΈ. use this if a package isn't available on your system package manager but you installed the required dependency by hand, like a DIY queen π οΈ. implies--assume-depexts, and stores the exceptions upon success as well.--require-checksumsβ rejects the installation of packages that don't provide a checksum for the upstream archives π«π¦. equivalent to setting$OPAMREQUIRECHECKSUMSto"true".--reuse-build-dirβ reuses existing build directories (the ones you kept with--keep-build-dir) instead of compiling from a fresh clone of the source β»οΈ. this can be faster, but can also lead to failures if the packages' build systems don't handle dependency upgrades well π. equivalent to setting$OPAMREUSEBUILDDIRto"true".--show-actionsβ calls the solver and displays the actions, without performing any changes π. equivalent to setting$OPAMSHOW.--skip-updatesβ when running an install, upgrade or reinstall on source-pinned packages, they're normally updated from their origin first. this flag disables that behaviour and keeps them at their version in cache ποΈ. equivalent to setting$OPAMSKIPUPDATE.-t,--with-testβ builds and runs the package unit-tests π§ͺβ¨. only affects packages listed on the command-line. equivalent to setting$OPAMWITHTEST(or the deprecated$OPAMBUILDTEST) to"true".--unlock-baseβ removed in 2.1 π use--update-invariantinstead.--update-invariantβ allows changes to the packages set as switch base (typically, the main compiler) π. use with caution, this is main-character-takes-risks energy. equivalent to setting the$OPAMUNLOCKBASEenvironment variable.--verbose-on=PACKAGESβ be more verbose on specific packages π£οΈ. equivalent to setting$OPAMVERBOSE.--with-dev-setupβ includes development tools only dependencies π§°.
β¨ COMMON OPTIONS β¨
okay bestie these ones hit every single command, no matter what you're running. they're the universal vibes π
--best-effortβ the "we tried our best and that's enough" flag π«Ά don't fail the whole thing if not every package you asked for can be installed β just install as many as you possibly can. heads up though: not every external solver supports this (recent versions of aspcud or mccs should, so slay). it's the same as setting the$OPAMBESTEFFORTenvironment variable.--cli=MAJOR.MINOR(absent=2.6) β makes opam use the command-line interface syntax and semantics ofMAJOR.MINOR. this is for literally any persistent opam usage (scripts, blog posts, etc.) β any opam in the sameMAJORseries will behave like theMINORrelease you picked. ngl there's a lil catch: this flag didn't exist back in opam 2.0, so to select the 2.0 CLI you gotta set theOPAMCLIenvironment variable to2.0instead of using this parameter. iykyk π--color=WHENβ colorize the output πWHENhas to be one ofalways,neverorauto.--confirm-level=LEVELβ sets the confirmation level.LEVELmust be one ofask,no,yesorunsafe-yes. you can hand this over more than once. if--yesor--noare also given, then the value of the last--confirm-levelis what counts. this is equivalent to setting$OPAMCONFIRMLEVEL.--criteria=CRITERIAβ specify your user preferences for dependency solving for this run only β¨ it overrides$OPAMCRITERIA,$OPAMFIXUPCRITERIAand$OPAMUPGRADECRITERIA. for the deets on the supported language and the external solvers that exist, go peephttp://opam.ocaml.org/doc/External_solvers.html. and there's a whole general guide to using solver preferences athttp://www.dicosmo.org/Articles/usercriteria.pdfπ--cudf=FILENAMEβ debug girlies rise π this saves the CUDF requests sent to the solver intoFILENAME-<n>.cudf, where<n>is the n-th call to the solver during the opam run.--debugβ print debug messages to stderr. equivalent to setting$OPAMDEBUGto"true".--debug-level=LEVELβ like--debugbut you get to specify the debug level (--debugjust sets it to1). equivalent to setting$OPAMDEBUGto a positive integer.--git-versionβ print the git version of opam, if it's set (i.e. you're running a development version), and bounce π¦--help[=FMT](default=auto) β show this very help in formatFMT.FMTmust be one ofauto,pager,grofforplain. withauto, the format becomespagerorplainwhenever theTERMenv var is dumb or undefined.--ignore-pin-dependsβ ignore the extra pins that get required by packages that get pinned β whether that's manually throughopam pinor throughopam install DIR. this is equivalent to settingIGNOREPINDEPENDS=true.--json=FILENAMEβ save the results of the opam run into 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$OPAMJSONvariable.--noβ answer no to every single opam yes/no question, no prompting, periodt. see also--confirm-level. equivalent to setting$OPAMNOto"true".--no-aspcudβ removed in 2.1. that's it, that's the whole note π--no-auto-upgradeβ when opam configures or updates a repository written for an earlier opam version (1.2), it internally converts it to the current format. this flag disables that behaviour. note: repositories should define their format version in arepofile at their root, otherwise they'll be assumed to be in the older format. and honestly it's preferable in any case to upgrade the repositories manually usingopam admin upgrade [--mirror URL]when you can πΈ--no-self-upgradeβ opam will replace itself with a newer binary found atOPAMROOT/opam, if one's present. this disables that behaviour. no glow-up for opam today, bestie π ββοΈ-q,--quietβ disables--verbose.--root=ROOTβ useROOTas the current root path. equivalent to setting$OPAMROOTtoROOT.--safe,--readonlyβ make absolutely sure nothing gets 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$OPAMDEBUGvariable. equivalent to setting the$OPAMSAFEenvironment variable.--solver=CMDβ specify the CUDF solver used for resolving package installation problems π§© this is either a predefined solver β and this version of opam supportsbuiltin-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}%. equivalent to setting$OPAMEXTERNALSOLVER.--strictβ fail whenever an error is found in a package definition or a configuration file. the default is to keep going silently if it possibly can, so this is the chaotic-strict mode fr fr.--switch=SWITCHβ useSWITCHas the current compiler switch. equivalent to setting$OPAMSWITCHtoSWITCH.--use-internal-solverβ disable any external solver and use the built-in one instead (this requires that opam was compiled with a built-in solver). equivalent to setting$OPAMNOASPCUDor$OPAMUSEINTERNALSOLVER.-v,--verboseβ be more verbose π£οΈ one-vshows all package commands, repeat it to also display commands called internally (e.g.tar,curl,patchetc.). repeating it n times is equivalent to setting$OPAMVERBOSEto"n".--versionβ show version information. iconic.-w,--working-dirβ whenever opam updates packages 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 listen: since the source directory is copied as it is, if it isn't clean it may result in an 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, no cap. see also--confirm-level. equivalent to setting$OPAMYESto"true".
π ENVIRONMENT π
okay bestie, so opam literally vibes with a whole bunch of environment variables and you will be tested on them (jk, but likeβ¦ know them). Quick rule before we dive in: for the boolean ones, set them to "0", "no", "false" or the empty string to turn them off, and to "1", "yes" or "true" to turn them on. π
OPAMALLPARENSβ wraps all those filters in parenthesis. cute little hug for your filters. π«ΆOPAMASSUMEDEPEXTSβ see the option--assume-depexts.OPAMAUTOANSWERβ internal use only, don't touch, not your business bestie πOPAMAUTOREMOVEβ see theremoveoption--auto-remove.OPAMBESTEFFORTβ see the option--best-effort.OPAMBESTEFFORTPREFIXCRITERIAβ sets the string that has to be prepended to the criteria when--best-effortis set, and it's expected to maximise theopam-queryproperty in the solution. very specific homework.OPAMBUILDDOCβ removed in 2.1. rip πͺ¦OPAMBUILDTESTβ removed in 2.1. also rip πͺ¦OPAMCLIβ see the option--cli.OPAMCOLORβ when set toalwaysornever, it sets a default value for the--coloroption.OPAMCONFIRMLEVELβ see the option--confirm-level. and listen:OPAMCONFIRMLEVELhas priority overOPAMYESandOPAMNO.OPAMCRITERIAβ specifies user preferences for dependency solving. the default value depends on the solver version, so runconfig reportif you wanna know the current setting. see also the 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. seeOPAMFETCHfor more options.OPAMDEBUGβ see the options--debugand--debug-level.OPAMDEBUGSECTIONSβ if set, limits debug messages to a space-separated list of sections. sections can optionally have a specific debug level (for example,CLIENT:2orCLIENT CUDF:2), but otherwise use--debug-level.OPAMDIGDEPTHβ defines how aggressive the lookup for conflicts is during CUDF preprocessing.OPAMDOWNLOADJOBSβ sets the maximum number of simultaneous downloads.OPAMDROPWORKINGDIRβ overrides packages previously updated with--working-dironupdate. without this variable set, opam would keep them unchanged unless they're 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$EDITORand$VISUAL. it said what it said πOPAMERRLOGLENβ sets the number of log lines printed when a sub-process fails.0prints all of them.OPAMEXTERNALSOLVERβ see the option--solver.OPAMFAKEβ see the option--fake.OPAMFETCHβ specifies how to download files: eitherwget,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 asOPAMUPGRADECRITERIA, but specific to fixup and reinstall.OPAMIGNOREAVAILABLEβ see theinstalloption--ignore-available-on.OPAMIGNORECONSTRAINTSβ see theinstalloption--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β log json output to the given file (use the character%to index the files).OPAMKEEPBUILDDIRβ see theinstalloption--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 the--lockedand--lock-suffixoptions.OPAMLOGSβ logdir, sets the 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 the options--noand--confirm-level.OPAMNOis ignored if eitherOPAMCONFIRMLEVELorOPAMYESis set.OPAMNOAGGREGATEβ withopam admin check, don't aggregate packages.OPAMNOASPCUDβ deprecated. π«OPAMNOAUTOUPGRADEβ disables automatic internal upgrade of repositories in an earlier format to the current one, on'update'or'init'.OPAMNOCHECKSUMSβ enables the option--no-checksumswhen 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 tofalseto disable CUDF preprocessing. less efficient, but it might help debugging solver issues. (debugging arc β¨)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.OPAMREQUIRECHECKSUMSβ enables the option--require-checksumswhen available (e.g. foropam 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 byopam 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β (defaulttrue) 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. iftrue, opam will continue with a warning, iffalsea timeout is an error. currently only thebuiltin-z3backend handles this degraded case.OPAMSOLVERTIMEOUTβ change the time allowance of the solver. default is60.0, set to0for unlimited. note that all solvers may not support this option.OPAMSOLVERTOLERANCEβ changes the tolerance towards the solver choosing an unoptimized solution (i.e. it might pull outdated packages). typical values range from0.0(best solution known to the solver) to1.0(unoptimized solution). default is0.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. another one gone πOPAMSTATUSLINEβ display a dynamic status line showing what's currently going on on the terminal. (one ofalways,neverorauto)OPAMSTRICTβ fail on inconsistencies (file reading, switch import, etc.).OPAMSWITCHβ see the option--switch. automatically set byopam env --switch=SWITCH --set-switch.OPAMUNLOCKBASEβ see theinstalloption--unlock-base.OPAMUPGRADECRITERIAβ specifies user preferences for dependency solving when performing an upgrade. overridesOPAMCRITERIAin upgrades if both are set. see also the option--criteria.OPAMUSEINTERNALSOLVERβ see the option--use-internal-solver.OPAMUSEOPENSSLβ removed in 2.2. πͺ¦OPAMUTF8β use UTF8 characters in output (one ofalways,neverorauto). by defaultauto, which is determined from the locale.OPAMUTF8MSGSβ use extended UTF8 characters (camels πͺ) in opam messages. impliesOPAMUTF8. 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. that's it, that's the whole vibe π ββοΈOPAMWITHDEVSETUPβ see theinstalloption--with-dev-setup.OPAMWITHDOCβ see theinstalloption--with-doc.OPAMWITHTESTβ see theinstalloption--with-test.OPAMWORKINGDIRβ see the option--working-dir.OPAMYESβ see the options--yesand--confirm-level.OPAMYEShas priority overOPAMNOand is ignored ifOPAMCONFIRMLEVELis set.OPAMVAR_varβ overrides the contents of the variable var when substituting%{var}%strings inopamfiles.OPAMVAR_package_varβ overrides the contents of the variable package:var when substituting%{package:var}%strings inopamfiles.
π CLI VERSION π
bestie, bestie, listen up, this one is important. all scripts and programmatic invocations of opam should use --cli so they work seamlessly with future versions of the opam client. that's not just a vibe thing β it's literally how you future-proof yourself. blog posts and other documentation benefit too, because it stops the information from going stale. π
although opam only supports roots (~/.opam/) for the current version, it does provide backwards compatibility for its command-line interface. slay.
since CLI version support was only added in opam 2.1, use OPAMCLI to select 2.0 support (because opam 2.0 will just ignore it), and --cli=2.1 for 2.1 (or later) versions, since 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.
the command-line version is selected by using the --cli option or the OPAMCLI environment variable. --cli may be specified more than once, where the last instance takes precedence. OPAMCLI is only inspected if --cli is not given.
ngl the "last one wins" thing is giving main character energy β the final --cli you type is the one that counts π
π EXIT STATUS π
okay bestie this part is IMPORTANT so pay attention, because exit codes are how opam talks to your shell without using words β¨
EXCEPTION ALERT π¨ β theexeccommand is the rebel here. It returns127if the command was not found or couldn't be executed, and otherwise it returns the command's own exit value. Everybody else plays by the rules below,execsaid "not me" π
0β Success, or true for boolean queries. the good ending π«Ά1β False. This one shows up when a boolean return value is expected β like when you're running with--check, or for queries such asopam lintβ¨2β Bad command-line arguments, OR command-line arguments that point to an invalid context (for example a file that doesn't follow the expected format). basically you handed it something cursed π5β Not found. You asked for something β a package, a version, a repository, etc. β and it simply wasn't there π¦10β Aborted. The operation needed confirmation and you didn't give it. no consent, no op π₯15β Could not acquire the locks required for the operation. the locks said "occupied" π20β There is no solution to the user request. This can happen when you ask to install two incompatible packages, for example. girl math that doesn't math πΈ30β Error in package definition, or other metadata files. Heads up: using--strictraises this error more often π31β Package script error. Some package operations were unsuccessful. This may be an error in the packages, or an incompatibility with your system. And plot twist β this can be a partial error β40β Sync error. Could not fetch some remotes from the network. Also potentially a partial error π50β Configuration error. Opam or system configuration doesn't allow the operation and needs fixing. something's gotta change fr fr π60β Solver failure. The solver failed to return a sound answer. Could be a broken external solver, or an error in solver configuration π§99β Internal error. Something went wrong, likely due to a bug in opam itself. not us, it's literally opam π130β User interrupt.SIGINTwas received, generally because the user pressed Ctrl+C. you did this π
and rounding out the list, a lil bonus set π
0β on success π₯123β on indiscriminate errors reported on standard error124β on command line parsing errors125β on unexpected internal errors (bugs) π
π FURTHER DOCUMENTATION π
Need more? The docs live at https://opam.ocaml.org/doc β go get your enrichment bestie, it's giving academic excellence π
π AUTHORS π
the icons who built this thing, show them some respect π
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 π
π BUGS π
Found something broken? Check the bug reports at https://github.com/ocaml/opam/issues. don't suffer in silence, bestie, file it π
and that's a wrap on OPAM-PIN(1) π β this is from Opam 2.6.1 (hi queen, current version energy β¨) and the page's own footer stamp is dated, so go check the manpage for the exact date if you need it, i'm not about to make up a number fr fr π ily, go pin something iconic πβ¨π¦
π¦ where this page comes from
- arch rolling: opam 2.6.1-1 Β· LGPL-2.1-only
- fedora 44: opam 2.6.1-1.fc44 Β· LGPL-2.1-only WITH OCaml-LGPL-linking-exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms