简体   繁体   中英

Stack doesn't install correct version of Haskell base library

I am fairly new to Haskell. I am trying to build a project downloaded from GitHub using stack. When I try to run stack solver , I get this output:

cabal: Could not resolve dependencies:
trying: deeplearning-hs-0.1.0.2 (user goal)
next goal: base (dependency of deeplearning-hs-0.1.0.2)
rejecting: base-4.8.1.0/installed-075... (conflict: deeplearning-hs =>
base>=4.6 && <4.7)
rejecting: base-4.8.1.0 (global constraint requires installed instance)
rejecting: base-4.8.0.0, 4.7.0.2, 4.7.0.1, 4.7.0.0, 4.6.0.1, 4.6.0.0, 4.5.1.0,
4.5.0.0, 4.4.1.0, 4.4.0.0, 4.3.1.0, 4.3.0.0, 4.2.0.2, 4.2.0.1, 4.2.0.0,
4.1.0.0, 4.0.0.0, 3.0.3.2, 3.0.3.1 (global constraint requires ==4.8.1.0)
Dependency tree exhaustively searched.

The issue seems to be this "global constraint" but I'm not sure where that's coming from. I have looked through my global .cabal files and they are pretty generic--they don't seem to specify the versions of anything.

base is a library bundled with GHC (the compiler). For each GHC version, there is one base version.

To install deeplearning-hs , seems you need to satisfy base == 4.6.* constraint, ie have GHC version 7.6. Unfortunately you cannot install GHC older then 7.8 with stack AFAIK.

You can play with it locally if you change base >=4.6 && <4.7 bounds to base >= 4.6 && <4.8 , ie allow base coming with GHC 7.8 for example. Note, you shouldn't remove dependencies, you should try to relax the constraints (ie version bounds). I tried locally, and the package seems to compile with GHC 7.8. It doesn't compile with GHC 7.10 as Foldable-Traversal-Proposal affects this package.

IMHO best way is to contact the maintainer and ask for upgrade, or even better submit a pull request, as source seems to be on GitHub ( which I did ).

PS I relaxed the bounds on Hackage , so you can install it with GHC 7.8 without worries now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM