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