zohl / servant-auth-cookie

Authentication via encrypted cookies
BSD 3-Clause "New" or "Revised" License
23 stars 23 forks source link

stack setup and build failed. #20

Open wpoosanguansit opened 8 years ago

wpoosanguansit commented 8 years ago

Hi I am trying out the code and I ran into a problem installing and setting up: The errors are as follow:

servant-auth-cookie git:(master) stack setup stack will use a sandboxed GHC it installed For more information on paths, see 'stack path' and 'stack exec env' To use this GHC and packages outside of a project, consider using: stack ghc, stack ghci, stack runghc, or stack exec ➜ servant-auth-cookie git:(master) stack runghc

^C ➜ servant-auth-cookie git:(master) stack build

While constructing the build plan, the following exceptions were encountered:

In the dependencies for servant-auth-cookie-0.4: http-api-data-0.2.3 must match ==0.3. (latest applicable is 0.3.1) servant-0.7.1 must match ==0.9. (latest applicable is 0.9.0.1)

Plan construction failed.

servant-auth-cookie git:(master) cabal run example Package has never been configured. Configuring with default flags. If this fails, please run configure manually. Resolving dependencies... Warning: solver failed to find a solution: Could not resolve dependencies: trying: servant-auth-cookie-0.4 (user goal) next goal: wai (dependency of servant-auth-cookie-0.4) Dependency tree exhaustively searched. Trying configure anyway. Configuring servant-auth-cookie-0.4... cabal: Encountered missing dependencies: cereal ==0.5., cookie >=0.4.1 && <0.5, cryptonite >=0.14 && <=0.20, data-default -any, exceptions ==0.8., http-types ==0.9., memory >=0.11 && <0.14, servant >=0.5 && <0.10, servant-server >=0.5 && <0.10, tagged ==0.8., wai >=3.0 && <3.3 ➜ servant-auth-cookie git:(master) stack setup stack will use a sandboxed GHC it installed For more information on paths, see 'stack path' and 'stack exec env' To use this GHC and packages outside of a project, consider using: stack ghc, stack ghci, stack runghc, or stack exec ➜ servant-auth-cookie git:(master)

Is there any other setup needed to have the code running? Thanks for your help.

zohl commented 8 years ago

Hello,

first of all my apologies for a late response!

At the moment there is a problem with clashing dependencies of servant-0.9 and the other packages. I'll take a closer look at it during the week. If it's not critical to use the most recent version of servant, you can turn off servant9 flag:

stack build --flag servant-auth-cookie:-servant9 
zohl commented 8 years ago

Alright, I was mistaken, the packages are ok.

The problem was in incompatible default values of stack's resolver and servant9 flag. This was fixed, so you can build the package by simply typing stack build.

To use newer version of servant you have to turn on servant9 flag and specify different resolver. Something like this will do the trick:

stack build --resolver nightly-2016-11-13 --flag servant-auth-cookie:servant9

(There is no servant-0.9 in lts yet.)

zohl commented 8 years ago

One more update: I reverted default value of the flag as it caused conflicts in the nightly stack. So to use package with default resolver you should turn off the flag:

stack build --flag servant-auth-cookie:-servant9 

Or to use package with nighly resolver:

stack build --resolver nightly-2016-11-13