Pin a package?

wagnerdm at wagnerdm at
Sat Jan 12 21:00:36 CET 2013

Quoting Shachaf Ben-Kiki <shachaf at>:

> You can put "constraint: bytestring == version" in ~/.cabal/config.
> Alternatively you can run one `cabal install --constraint "bytestring
> == version"` command.

Keep in mind the following subtle difference between this constraint  
and the "installed" constraint: this fixes a version, but doesn't fix  
a set of flags or dependencies' versions. So cabal may still rebuild  
bytestring if it discovers that changing either of these will make an  
otherwise failing constraint set succeed, whereas the "installed"  
constraint will force the package not to be rebuilt. On the other  
hand, if there are many versions of bytestring installed, the  
"installed" constraint does not fix any one of them as the exact  

It can make sense to use both "== version" constraints and "installed"  
constraints at once.


More information about the Glasgow-haskell-users mailing list