OPAM-ADMIN-LINT(1)
π OPAM ADMIN-LINT π
okay bestie, welcome to OPAM ADMIN-LINT β straight out of the Opam admin Manual β¨ this is the one that runs opam lint all over a whole repo and spills ALL the tea. let's get into it π«Ά
πΈ NAME πΈ
opam admin-lint β runs opam lint and reports on a whole repository π
no cap, the entire thing.
β¨ SYNOPSIS β¨
opam admin lint [OPTION]β¦ [INT]β¦
π¦ DESCRIPTION π¦
so basically? this command gathers linting results on all files in a repository π it goes through everything and collects the receipts.
and you get to pick which warnings and errors to show or hide β the selection is yours, main character π
π ARGUMENTS π
INTβ show only these warnings, bestie. that's it, that's the whole vibe.
π OPTIONS π
-i INT,--ignore-packages=INTβ ignore any packages having one of these warnings or errors π like, we're not looking at those today.-l,--listβ only list package names, without warning details π just the names, no extra commentary.-s,--shortβ print only packages and warning/error numbers, without explanations β¨ short and sweet, exactly the energy.-W,--warn-errorβ return failure on any warnings, not only on errors π yeah, it's strict-strict.-x INT,--exclude=INTβ exclude the given warnings or errors π« out of sight, out of mind.
π COMMON OPTIONS π
these options are common to all commands. universal icons only π«
--best-effortβ don't fail if all requested packages can't be installed: try to install as many as possible π«Ά note that not all external solvers may support this option (recent versions ofaspcudormccsshould). this is equivalent to setting the$OPAMBESTEFFORTenvironment variable.--cli=MAJOR.MINOR(absent=2.6) β use the command-line interface syntax and semantics ofMAJOR.MINORβ intended 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. the flag was not available in opam 2.0, so to select the 2.0 CLI, set theOPAMCLIenvironment variable to2.0instead of using this parameter.--color=WHENβ colorize the output πWHENmust be one ofalways,neverorauto.--confirm-level=LEVELβ confirmation level,LEVELmust be one ofask,no,yesorunsafe-yes. can be specified more than once. if--yesor--noare also given, the value of the last--confirm-levelis taken into account. this is equivalent to setting$OPAMCONFIRMLEVEL.--criteria=CRITERIAβ specify user preferences for dependency solving for this run π§ overrides$OPAMCRITERIA,$OPAMFIXUPCRITERIAand$OPAMUPGRADECRITERIA. for 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 toFILENAME-<n>.cudfwhere<n>is the n-th call to the solver during the opam run π--debugβ print debug message to stderr. this is equivalent to setting$OPAMDEBUGto"true"π--debug-level=LEVELβ like--debug, but allows specifying the debug level (--debugsets it to1). equivalent to setting$OPAMDEBUGto 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 formatFMT. the valueFMTmust be one ofauto,pager,grofforplain. withauto, the format ispagerorplainwhenever theTERMenv var isdumbor undefined.--ignore-pin-dependsβ ignore extra pins required by packages that get pinned, either manually throughopam pinor throughopam install DIRπ this is equivalent to settingIGNOREPINDEPENDS=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$OPAMJSONvariable.--noβ answer no to all opam yes/no questions without prompting π ββοΈ see also--confirm-level. this is equivalent to setting$OPAMNOto"true".--no-aspcudβ removed in 2.1 β°οΈ (gone, bestie, she's not coming back)--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 this behaviour. note that repositories should define their format version in arepofile 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 usingopam admin upgrade [--mirror URL]when possible π οΈ-q,--quietβ disables--verboseπ€«--root=ROOTβ useROOTas the current root path. this is equivalent to setting$OPAMROOTtoROOTπ³--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$OPAMDEBUGvariable. 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 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}%. 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.--switch=SWITCHβ useSWITCHas the current compiler switch. this is equivalent to setting$OPAMSWITCHtoSWITCHπ--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$OPAMNOASPCUDor$OPAMUSEINTERNALSOLVER.-v,--verboseβ be more verbose π’ one-vshows all package commands, repeat to also display commands called internally (e.g.tar,curl,patchetc.). repeating n times is equivalent to setting$OPAMVERBOSEto"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$OPAMYESto"true".
π ok that's part 1 bestie, more incoming β don't go anywhere πΈ
π ENVIRONMENT π
Bestie, opam is so into environment variables, like it has a whole vibe board of them. Here's the full tea β β every single one.
Quick rule before we dive in: boolean variables need to be set to "0", "no", "false" or the empty string to disable them, and "1", "yes" or "true" to enable them. That's the whole vibe check right there. π
OPAMALLPARENSβ wraps every single filter in parentheses. Yes, all of them. Every last one. π«ΆOPAMASSUMEDEPEXTSβ peek at the option--assume-depexts.OPAMAUTOANSWERβ internal use only, bestie, not for us mere mortals. π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-effortoption is set, and it's expected to maximise theopam-queryproperty in the solution. Very specific, very slay. β¨OPAMBUILDDOCβ Removed in 2.1. Gone, bestie. πOPAMBUILDTESTβ Removed in 2.1. Also gone. πOPAMCLIβ see the option--cli.OPAMCOLORβ when set toalwaysornever, it sets a default value for the--coloroption.OPAMCONFIRMLEVELβ see the option--confirm-level. And heads up:OPAMCONFIRMLEVELhas priority overOPAMYESandOPAMNO. It's the main character here. πOPAMCRITERIAβ specifies your user preferences for dependency solving. The default value depends on the solver version, so runconfig reportto find out what the current setting actually is. See also the option--criteria.OPAMCUDFFILEβ saves the cudf graph to the filefile-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 the space-separated list of sections. Sections can optionally have a specific debug level (for example,CLIENT:2orCLIENT CUDF:2), but otherwise it uses--debug-level.OPAMDIGDEPTHβ defines how aggressive the lookup for conflicts during CUDF preprocessing is. Going feral, basically. π₯OPAMDOWNLOADJOBSβ sets the maximum number of simultaneous downloads.OPAMDROPWORKINGDIRβ overrides packages previously updated with--working-diron update. 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 foropamfile editing. It overrides$EDITORand$VISUAL.OPAMERRLOGLENβ sets the number of log lines printed when a sub-process fails. Set it to0to print all of them. All. Every line. π«£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. It overrides the'download-command'value from the main config file.OPAMFIXUPCRITERIAβ same asOPAMUPGRADECRITERIA, 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β 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. AlsoOPAMNOis ignored if eitherOPAMCONFIRMLEVELorOPAMYESis set. Know your place,OPAMNO. πOPAMNOAGGREGATEβ withopam admin check, don't aggregate packages.OPAMNOASPCUDβ Deprecated. Old news, bestie.OPAMNOAUTOUPGRADEβ disables automatic internal upgrade of repositories in an earlier format to the current one, on'update'or'init'.OPAMNOCHECKSUMSβ enables 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 to false to disable CUDF preprocessing. Less efficient, but might help with debugging solver issues.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. Chef's kiss efficiency. π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. Don't do it casually, bestie, I'm begging. π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; iffalse, a timeout is an error. Currently only the builtin-z3 backend handles this degraded case.OPAMSOLVERTIMEOUTβ change the time allowance of the solver. Default is60.0, set to0for 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 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 not all solvers may support this option.OPAMSTATSβ Removed in 2.4. RIP. πOPAMSTATUSLINEβ display a dynamic status line showing what's currently going on on the terminal. (one of 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 the install option--unlock-base.OPAMUPGRADECRITERIAβ specifies your 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. Bye. π¦OPAMUTF8β use UTF8 characters in output (one of one ofalways,neverorauto). By default it'sauto, 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 instruction. π«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--yesand--confirm-level.OPAMYEShas priority overOPAMNOand is ignored ifOPAMCONFIRMLEVELis set. It's giving "yes to everything" energy. π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 β
Okay this part is important, so listen up bestie. π«Ά
All scripts and programmatic invocations of opam should use --cli, so they keep working seamlessly with future versions of the opam client. And it's not just for scripts β blog posts and other documentation can benefit too, because it prevents information from becoming stale. Literally aging-proofing your docs. β¨
Although opam only supports roots (~/.opam/) for the current version, it does provide backwards compatibility for its command-line interface.
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, 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. So it's clapping back at you, gently. π
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. Last one wins, always. π
π EXIT STATUS π
okay bestie, listen up, because this part is IMPORTANT. β¨
real talk first: as an exception to literally everything below, theexeccommand returns127if the command was not found or couldn't be executed, and the command's exit value otherwise. that one's the odd one out, no cap. π
0β Success, or true for boolean queries. π1β False. Returned when a boolean return value is expected, e.g. when running with--check, or for queries likeopam lint.2β Bad command-line arguments, or command-line arguments pointing to an invalid context (e.g. file not following the expected format). the vibes were off from the start π5β Not found. You requested something (package, version, repository, etc.) that couldn't be found. it's giving "who??" π΅οΈ10β Aborted. The operation required confirmation, which wasn't given. you said no (or said nothing) π15β Could not acquire the locks required for the operation. π20β There is no solution to the user request. This can be caused by asking to install two incompatible packages, for example. they cannot both be the main character π30β Error in package definition, or other metadata files. 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. This can be a partial error.40β Sync error. Could not fetch some remotes from the network. This can be a partial error. the wifi said no π‘50β Configuration error. Opam or system configuration doesn't allow operation, and needs fixing. π οΈ60β Solver failure. The solver failed to return a sound answer. It can be due to a broken external solver, or an error in solver configuration. the solver is NOT slaying today π99β Internal error. Something went wrong, likely due to a bug in opam itself. π130β User interrupt.SIGINTwas received, generally due to the user pressing Ctrl+C. π
and then this lil trio right here, same energy, different fam:
0on success.123on indiscriminate errors reported on standard error.124on command line parsing errors.125on unexpected internal errors (bugs).
π FURTHER DOCUMENTATION π
See https://opam.ocaml.org/doc. β¨
π AUTHORS π
the legends themselves, in the order they're listed, periodt:
- 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>
all twelve of them ate and left no crumbs π«Ά
π SEE ALSO π
opam admin(1)β iykyk, go read that one next bestie π
π BUGS π
Check bug reports at https://github.com/ocaml/opam/issues. if something's broken it's probably already in there, ngl πΈ
and that's the whole page, bestie!! this was Opam admin version 2.6.1 and yes the man page goes by OPAM ADMIN-LINT(1) β iconic name, iconic page, go forth and lint responsibly π
β¨π¦
π¦ 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