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