Library version choosing of cabal sandbox build

Roman Cheplyaka roma at ro-che.info
Tue Jul 15 12:33:47 UTC 2014


* Daniel Trstenjak <daniel.trstenjak at gmail.com> [2014-07-15 13:15:23+0200]
> 
> Hi Johan,
> 
> > Cabal is allowed to use any version that fullfills the required bounds. It uses
> > a heuristic the tends to prefer
> > 
> >  * installed
> >  * newest
> >  * other
> > 
> > in that order.
> > 
> > If you want to make sure the newest version is used temporarily you can pass
> > --constraint="foo-1.2.3.4" to cabal install. If you want to make this change
> > more permanent you can set an exact version in a cabal.config file in the same
> > directory as the .cabal file.
> 
> So there's no flag to always use the newest one, right?
> 
> In my use case it would be a bit cumbersome to first find these libraries
> and then to list all of them by hand.
> 
> The concrete use case is to test your project with the newest available library versions.

You should create a fresh sandbox per build, then.

This is both sufficient (nothing is installed => no reason to prefer an older
version) and necessary (when in a sandbox, cabal won't let you have two
different versions of the library installed).

Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://www.haskell.org/pipermail/cabal-devel/attachments/20140715/a81c832f/attachment.sig>


More information about the cabal-devel mailing list