Stephen Paul Weber | 12 Jan 20:25 2013
Picon

Pin a package?

Is there a way to tell cabal to refuse to upgrade a package?  I'd like to 
pin my `bytestring` to the version that shipped with my GHC.

I just had a weird experience.  When I try to `cabal install iconv` (with my 
settings) it tried to downgrade my `bytestring`, when I download and do the 
configure+build by hand, it works, but when I try to install the local 
version it again begins to try to downgrade my bytestring.  If I just 
`register --inplace` it works fine.  Wut?

--

-- 
Stephen Paul Weber,  <at> singpolyma
See <http://singpolyma.net> for how I prefer to be contacted
edition right joseph
wagnerdm | 12 Jan 20:45 2013

Re: Pin a package?

Quoting Stephen Paul Weber <singpolyma <at> singpolyma.net>:

> Is there a way to tell cabal to refuse to upgrade a package?  I'd  
> like to pin my `bytestring` to the version that shipped with my GHC.

cabal install --constraint "bytestring installed"

~d
Shachaf Ben-Kiki | 12 Jan 20:45 2013
Picon

Re: Pin a package?

On Sat, Jan 12, 2013 at 11:25 AM, Stephen Paul Weber
<singpolyma <at> singpolyma.net> wrote:
> Is there a way to tell cabal to refuse to upgrade a package?  I'd like to
> pin my `bytestring` to the version that shipped with my GHC.
>
> I just had a weird experience.  When I try to `cabal install iconv` (with my
> settings) it tried to downgrade my `bytestring`, when I download and do the
> configure+build by hand, it works, but when I try to install the local
> version it again begins to try to downgrade my bytestring.  If I just
> `register --inplace` it works fine.  Wut?
>

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

    Shachaf
wagnerdm | 12 Jan 21:00 2013

Re: Pin a package?

Quoting Shachaf Ben-Kiki <shachaf <at> gmail.com>:

> 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  
version.

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

~d

Gmane