[Haskell-cafe] Cabal Config constraints vs. constraint

6 views
Skip to first unread message

Christopher Reichert

unread,
Dec 22, 2014, 1:40:46 PM12/22/14
to haskel...@haskell.org

Hey everyone,

I am trying to add a list of version constraints to my global cabal
config (~/.cabal/config) using the `constraints` keyword. However, after
adding the list to the end of the ~/.cabal/config file and running
`cabal update`, I noticed this warning:

$ cabal update
Warning: /home/test/.cabal/config: Unrecognized field constraints on
line 176
Downloading the latest package list from hackage.haskell.org


I did find this issue annotated as a FIXME in the cabal source:
https://github.com/haskell/cabal/blob/64761550bb617ee5d9449512bd3e500489cfd491/cabal-install/Distribution/Client/Sandbox/PackageEnvironment.hs#L408


It appears as though `constraints` are currently only supported in
cabal.config (and maybe cabal.sandbox.config)


Do individual constraints (e.g. `constraint:`) have the same effect as a
list of constraints?


Does the `constraint` setting work in both global (~/.cabal/config) and
local cabal.config the exact same way (especially if I have a long list
of them)

Is there any reason I would use individual constraints over a list of
constraints?


My assumption is that they work the same way in both ~/.cabal/config &&
cabal.config.


I'm considering patching the cabal source to support the `constraints`
setting in the ~/.cabal/config file. Is there any reason this might have
been passed up front?



More discussion here: https://github.com/fpco/stackage-server/issues/67


Any help or advice would be greatly appreciated. Thanks,

-Christopher



--
Christopher Reichert
irc: creichert
gpg: C81D 18C8 862A 3618 1376 FFA5 6BFC A992 9955 929B
signature.asc

Brandon Allbery

unread,
Dec 22, 2014, 1:48:23 PM12/22/14
to Christopher Reichert, haskell-cafe
On Mon, Dec 22, 2014 at 1:40 PM, Christopher Reichert <creic...@gmail.com> wrote:
Do individual constraints (e.g. `constraint:`) have the same effect as a
list of constraints?

Yes; also in cabal files, where that ability is used with conditionals. I habitually add 'constraint: foo installed' for all global packages to a new installation's ~/.cabal/config.

--
brandon s allbery kf8nh                               sine nomine associates
allb...@gmail.com                                  ball...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
Reply all
Reply to author
Forward
0 new messages