1opam-lint(1) Opam Manual opam-lint(1)
2
3
4
6 opam-lint - Checks and validate package description ('opam') files.
7
9 opam lint [OPTION]... [FILES]...
10
12 Given an opam file, performs several quality checks on it and outputs
13 recommendations, warnings or errors on stderr.
14
16 FILES
17 Name of the opam files to check, or directory containing them.
18 Current directory if unspecified
19
21 --normalise
22 Output a normalised version of the opam file to stdout
23
24 --package=PKG
25 Lint the current definition of the given package instead of
26 specifying an opam file directly.
27
28 -s, --short
29 Only print the warning/error numbers, space-separated, if any
30
31 -W WARNS, --warnings=WARNS
32 Select the warnings to show or hide. WARNS should be a
33 concatenation of +N, -N, +N..M, -N..M to respectively enable or
34 disable warning or error number N or all warnings with numbers
35 between N and M inclusive. All warnings are enabled by default,
36 unless WARNS starts with +, which disables all but the selected
37 ones.
38
40 These options are common to all commands.
41
42 --best-effort
43 Don't fail if all requested packages can't be installed: try to
44 install as many as possible. Note that not all external solvers may
45 support this option (recent versions of aspcud or mccs should).
46
47 --color=WHEN
48 Colorize the output. WHEN must be one of `always', `never' or
49 `auto'.
50
51 --criteria=CRITERIA
52 Specify user preferences for dependency solving for this run.
53 Overrides both $OPAMCRITERIA and $OPAMUPGRADECRITERIA. For details
54 on the supported language, and the external solvers available, see
55 http://opam.ocaml.org/doc/Specifying_Solver_Preferences.html. A
56 general guide to using solver preferences can be found at
57 http://www.dicosmo.org/Articles/usercriteria.pdf.
58
59 --cudf=FILENAME
60 Debug option: Save the CUDF requests sent to the solver to
61 FILENAME-<n>.cudf.
62
63 --debug
64 Print debug message to stderr. This is equivalent to setting
65 $OPAMDEBUG to "true".
66
67 --debug-level=LEVEL
68 Like --debug, but allows specifying the debug level (--debug sets
69 it to 1). Equivalent to setting $OPAMDEBUG to a positive integer.
70
71 --git-version
72 Print the git version of opam, if set (i.e. you are using a
73 development version), and exit.
74
75 --help[=FMT] (default=auto)
76 Show this help in format FMT. The value FMT must be one of `auto',
77 `pager', `groff' or `plain'. With `auto', the format is `pager` or
78 `plain' whenever the TERM env var is `dumb' or undefined.
79
80 --ignore-pin-depends
81 Ignore extra pins required by packages that get pinned, either
82 manually through opam pin or through opam install DIR. This is
83 equivalent to setting IGNOREPINDEPENDS=true.
84
85 --json=FILENAME
86 Save the results of the opam run in a computer-readable file. If
87 the filename contains the character `%', it will be replaced by an
88 index that doesn't overwrite an existing file. Similar to setting
89 the $OPAMJSON variable.
90
91 --no-auto-upgrade
92 When configuring or updating a repository that is written for an
93 earlier opam version (1.2), opam internally converts it to the
94 current format. This disables this behaviour. Note that
95 repositories should define their format version in a 'repo' file at
96 their root, or they will be assumed to be in the older format. It
97 is, in any case, preferable to upgrade the repositories manually
98 using opam admin upgrade [--mirror URL] when possible.
99
100 --no-self-upgrade
101 Opam will replace itself with a newer binary found at OPAMROOT/opam
102 if present. This disables this behaviour.
103
104 -q, --quiet
105 Disables --verbose.
106
107 --root=ROOT
108 Use ROOT as the current root path. This is equivalent to setting
109 $OPAMROOT to ROOT.
110
111 --safe, --readonly
112 Make sure nothing will be automatically updated or rewritten.
113 Useful for calling from completion scripts, for example. Will fail
114 whenever such an operation is needed ; also avoids waiting for
115 locks, skips interactive questions and overrides the $OPAMDEBUG
116 variable.
117
118 --solver=CMD
119 Specify the CUDF solver to use for resolving package installation
120 problems. This is either a predefined solver (this version of opam
121 supports builtin-mccs+lp(), builtin-mccs+glpk, aspcud, mccs,
122 aspcud-old, packup), or a custom command that should contain the
123 variables %{input}%, %{output}%, %{criteria}%, and optionally
124 %{timeout}%.
125
126 --strict
127 Fail whenever an error is found in a package definition or a
128 configuration file. The default is to continue silently if
129 possible.
130
131 --switch=SWITCH
132 Use SWITCH as the current compiler switch. This is equivalent to
133 setting $OPAMSWITCH to SWITCH.
134
135 --use-internal-solver, --no-aspcud
136 Disable any external solver, and use the built-in one (this
137 requires that opam has been compiled with a built-in solver).
138
139 -v, --verbose
140 Be more verbose. One -v shows all package commands, repeat to also
141 display commands called internally (e.g. tar, curl, patch etc.)
142 Repeating n times is equivalent to setting $OPAMVERBOSE to "n".
143
144 --version
145 Show version information.
146
147 -w, --working-dir
148 Whenever updating packages that are bound to a local,
149 version-controlled directory, update to the current working state
150 of their source instead of the last committed state, or the ref
151 they are pointing to. This only affects packages explicitly listed
152 on the command-line.
153
154 -y, --yes
155 Answer yes to all yes/no questions without prompting. This is
156 equivalent to setting $OPAMYES to "true".
157
159 Opam makes use of the environment variables listed here. Boolean
160 variables should be set to "0", "no", "false" or the empty string to
161 disable, "1", "yes" or "true" to enable.
162
163 OPAMCOLOR, when set to always or never, sets a default value for the
164 --color option.
165
166 OPAMCRITERIA specifies user preferences for dependency solving. The
167 default value depends on the solver version, use `config report` to
168 know the current setting. See also option --criteria
169
170 OPAMCURL can be used to select a given 'curl' program. See OPAMFETCH
171 for more options.
172
173 OPAMDEBUG see options `--debug' and `--debug-level'.
174
175 OPAMDOWNLOADJOBS sets the maximum number of simultaneous downloads.
176
177 OPAMERRLOGLEN sets the number of log lines printed when a sub-process
178 fails. 0 to print all.
179
180 OPAMEXTERNALSOLVER see option `--solver'.
181
182 OPAMFETCH specifies how to download files: either `wget', `curl' or a
183 custom command where variables %{url}%, %{out}%, %{retry}%,
184 %{compress}% and %{checksum}% will be replaced. Overrides the
185 'download-command' value from the main config file.
186
187 OPAMJOBS sets the maximum number of parallel workers to run.
188
189 OPAMJSON log json output to the given file (use character `%' to index
190 the files)
191
192 OPAMLOCK see option `--lock'.
193
194 OPAMNOAUTOUPGRADE disables automatic internal upgrade of repositories
195 in an earlier format to the current one, on 'update' or 'init'.
196
197 OPAMKEEPLOGS tells opam to not remove some temporary command logs and
198 some backups. This skips some finalisers and may also help to get more
199 reliable backtraces
200
201 OPAMLOCKRETRIES sets the number of tries after which OPAM gives up
202 acquiring its lock and fails. <= 0 means infinite wait.
203
204 OPAMNO answer no to any question asked.
205
206 OPAMNOASPCUD see option `--no-aspcud'.
207
208 OPAMNOSELFUPGRADE see option `--no-self-upgrade'.
209
210 OPAMPINKINDAUTO sets whether version control systems should be detected
211 when pinning to a local path. Enabled by default since 1.3.0.
212
213 OPAMREQUIRECHECKSUMS Enables option `--require-checksums' when
214 available (e.g. for `opam install`).
215
216 OPAMRETRY sets the number of tries before failing downloads.
217
218 OPAMROOT see option `--root'. This is automatically set by `opam env
219 --root=DIR --set-root'.
220
221 OPAMROOTISOK don't complain when running as root.
222
223 OPAMSAFE see option `--safe'
224
225 OPAMSKIPVERSIONCHECKS bypasses some version checks. Unsafe, for
226 compatibility testing only.
227
228 OPAMSOLVERTIMEOUT change the time allowance of the solver. Default is
229 60.0, set to 0 for unlimited. Note that all solvers may not support
230 this option.
231
232 OPAMSTATUSLINE display a dynamic status line showing what's currently
233 going on on the terminal. (one of one of `always', `never' or `auto')
234
235 OPAMSWITCH see option `--switch'. Automatically set by `opam env
236 --switch=SWITCH --set-switch'.
237
238 OPAMUPGRADECRITERIA specifies user preferences for dependency solving
239 when performing an upgrade. Overrides OPAMCRITERIA in upgrades if both
240 are set. See also option --criteria
241
242 OPAMUSEINTERNALSOLVER see option `--use-internal-solver'.
243
244 OPAMUTF8 use UTF8 characters in output (one of one of `always', `never'
245 or `auto'). By default `auto', which is determined from the locale).
246
247 OPAMUTF8MSGS use extended UTF8 characters (camels) in opam messages.
248 Implies OPAMUTF8. This is set by default on OSX only.
249
250 OPAMVAR_var overrides the contents of the variable var when
251 substituting `%{var}%` strings in `opam` files.
252
253 OPAMVAR_package_var overrides the contents of the variable package:var
254 when substituting `%{package:var}%` strings in `opam` files.
255
256 OPAMVERBOSE see option `--verbose'.
257
258 OPAMYES see option `--yes'.
259
261 As an exception to the following, the `exec' command returns 127 if the
262 command was not found or couldn't be executed, and the command's exit
263 value otherwise.
264
265 0 Success, or true for boolean queries.
266
267 1 False. Returned when a boolean return value is expected, e.g. when
268 running with --check, or for queries like opam lint.
269
270 2 Bad command-line arguments, or command-line arguments pointing to
271 an invalid context (e.g. file not following the expected format).
272
273 5 Not found. You requested something (package, version, repository,
274 etc.) that couldn't be found.
275
276 10 Aborted. The operation required confirmation, which wasn't given.
277
278 15 Could not acquire the locks required for the operation.
279
280 20 There is no solution to the user request. This can be caused by
281 asking to install two incompatible packages, for example.
282
283 30 Error in package definition, or other metadata files. Using
284 --strict raises this error more often.
285
286 31 Package script error. Some package operations were unsuccessful.
287 This may be an error in the packages or an incompatibility with
288 your system. This can be a partial error.
289
290 40 Sync error. Could not fetch some remotes from the network. This can
291 be a partial error.
292
293 50 Configuration error. Opam or system configuration doesn't allow
294 operation, and needs fixing.
295
296 60 Solver failure. The solver failed to return a sound answer. It can
297 be due to a broken external solver, or an error in solver
298 configuration.
299
300 99 Internal error. Something went wrong, likely due to a bug in opam
301 itself.
302
303 130 User interrupt. SIGINT was received, generally due to the user
304 pressing Ctrl-C.
305
307 See https://opam.ocaml.org/doc.
308
310 Vincent Bernardoff <vb@luminar.eu.org>
311 Raja Boujbel <raja.boujbel@ocamlpro.com>
312 Roberto Di Cosmo <roberto@dicosmo.org>
313 Thomas Gazagnaire <thomas@gazagnaire.org>
314 Louis Gesbert <louis.gesbert@ocamlpro.com>
315 Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
316 Anil Madhavapeddy <anil@recoil.org>
317 Guillem Rieu <guillem.rieu@ocamlpro.com>
318 Ralf Treinen <ralf.treinen@pps.jussieu.fr>
319 Frederic Tuong <tuong@users.gforge.inria.fr>
320
322 Check bug reports at https://github.com/ocaml/opam/issues.
323
324
325
326Opam 2.0.1 opam-lint(1)