How can I tell Cabal which dependency to use?
Asked Answered
Q

1

6

I'm trying to get Cabal to install the haskell-src-meta package, and I'm having difficulty with the template-haskell dependency. The dependencies for haskell-src-meta include both

template-haskell >=2.7 && <2.9,
template-haskell >=2.4 && <2.7,

It so happens that template-haskell versions 2.7 and later will not install on my system, but template-haskell 2.5.0.0 will install.

When I'm asking Cabal to install haskell-src-meta, how do I tell it to use template-haskell == 2.5.0.0?


Here is the full information for cabal info haskell-src-meta on my system:

* haskell-src-meta (library)
    Synopsis:      Parse source to template-haskell abstract syntax.
    Latest version available: 0.5.1
    Latest version installed: [ Not installed ]
    Homepage:      [ Not specified ]
    Bug reports:   https://github.com/benmachine/haskell-src-meta/issues
    Description:   The translation from haskell-src-exts abstract syntax to
                   template-haskell abstract syntax isn't 100% complete yet.
    Category:      Language
    License:       BSD3
    Author:        Matt Morrow
    Maintainer:    Ben Millwood <[email protected]>
    Source repo:   git://github.com/benmachine/haskell-src-meta.git
    Flags:         new-th
    Dependencies:  base >=4.2 && <4.6, haskell-src-exts >=1.8 && <1.12,
                   pretty >=1.0 && <1.2, syb >=0.1 && <0.4, th-lift ==0.5.*,
                   template-haskell >=2.7 && <2.9,
                   template-haskell >=2.4 && <2.7, uniplate >=1.3 && <1.7
    Cached:        No
    Modules:
        Language.Haskell.Meta
        Language.Haskell.Meta.Parse
        Language.Haskell.Meta.Parse.Careful
        Language.Haskell.Meta.Syntax.Translate
        Language.Haskell.Meta.Utils
        Language.Haskell.TH.Instances.Lift
Quinlan answered 11/3, 2012 at 17:51 Comment(0)
C
9
cabal install --constraint="template-haskell == 2.5.0.0" haskell-src-meta
Crake answered 11/3, 2012 at 18:23 Comment(2)
Brilliant! Works perfectly. How could I have discovered this? I crawled all over the User's Guide, without success...Quinlan
I know it's messy, but cabal install --help has a number of useful items. Cabal, for all its little issues, has a decent amount of documentation under ∀ COMMAND. cabal COMMAND --helpJalap

© 2022 - 2024 — McMap. All rights reserved.