Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
021a7cd7
Commit
021a7cd7
authored
Dec 17, 2013
by
Mikhail Glushenkov
Browse files
Document '--allow-newer'.
The user guide really could really use an overhaul...
parent
6a9ef738
Changes
1
Hide whitespace changes
Inline
Side-by-side
Cabal/doc/installing-packages.markdown
View file @
021a7cd7
...
...
@@ -678,6 +678,46 @@ followingcommand line options.
for libraries it is also saved in the package registration
information and used when compiling modules that use the library.
`--allow-newer`
[=_pkgs_]
: Selectively relax upper bounds in dependencies without editing the
package description.
If you want to install a package A that depends on B >= 1.0 && < 2.0, but
you have the version 2.0 of B installed, you can compile A against B 2.0 by
using `cabal install --allow-newer=B A`. This works for the whole package
index: if A also depends on C that in turn depends on B < 2.0, C's
dependency on B will be also relaxed.
Example:
~~~~~~~~~~~~~~~~
$ cd foo
$ cabal configure
Resolving dependencies...
cabal: Could not resolve dependencies:
[...]
$ cabal configure --allow-newer
Resolving dependencies...
Configuring foo...
~~~~~~~~~~~~~~~~
Additional examples:
~~~~~~~~~~~~~~~~
# Relax upper bounds in all dependencies.
$ cabal install --allow-newer foo
# Relax upper bounds only in dependencies on bar, baz and quux.
$ cabal install --allow-newer=bar,baz,quux foo
# Relax the upper bound on bar and force bar==2.1.
$ cabal install --allow-newer=bar --constraint="bar==2.1" foo
~~~~~~~~~~~~~~~~
It's also possible to enable `--allow-newer` permanently by setting
`allow-newer: True` in the `~/.cabal/config` file.
In the simple build infrastructure, an additional option is recognized:
`--scratchdir=`
_dir_
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment