agrafix / Spock

Another Haskell web framework for rapid development
https://www.spock.li
679 stars 56 forks source link

Spock quick start guide not working. #146

Closed ghost closed 6 years ago

ghost commented 6 years ago

https://www.spock.li/tutorials/getting-started

In the very beginning, after modifying the .cabal file, when I run stack build --fast --pedantic it doesn't work:

Warning: /var/www/Spock-example/Spock-example.cabal was modified manually. Ignoring /var/www/Spock-example/package.yaml in favor of the cabal file. If you want to use the
         package.yaml file instead of the cabal file, then please delete the cabal file.

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

In the dependencies for Spock-example-0.1.0.0:
    Spock must match >=0.11, but the stack configuration has no specified version  (latest matching version is 0.13.0.0)
needed since Spock-example is a build target.

Some different approaches to resolving this:

  * Consider trying 'stack solver', which uses the cabal-install solver to attempt to find some working build configuration. This can be convenient when dealing with many
    complicated constraint errors, but results may be unpredictable.

  * Recommended action: try adding the following to your extra-deps in /var/www/Spock-example/stack.yaml:

- Spock-0.13.0.0

Plan construction failed.

If I use "Spock-0.13.0.0" instead of "Spock >=0.11" I get:


Unable to parse cabal file /var/www/Spock-example/Spock-example.cabal

- 48:16: 
unexpected all digits in portion of unqualified component name

Spock-example
, base >=4.7 && <5
, Spock-0.13.0.0
, mtl
, text

Many other things I tried also did not worked here. I'm new to haskell. (hi!)

$ stack --version
Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2

$ cabal --version
cabal-install version 2.2.0.0
compiled using version 2.2.0.0 of the Cabal library 
agrafix commented 6 years ago

What does your stack.yaml file look like? The error message suggest adding Spock-0.13.0.0 there, not in your cabal file :)

err0r500 commented 6 years ago

Yeap, same problem here.

Changing in stack.yaml

- # extradeps: []
+ extra-deps:
+   - Spock-0.13.0.0
+   - Spock-core-0.13.0.0
+   - reroute-0.5.0.0

fixed the issue for me.

agrafix commented 6 years ago

I updated the guide

decapo01 commented 5 years ago

Not sure if i should open up a new issue for this but when i follow this guide stack asks me to add - stm-containers-1.1.0.2 then - stm-hamt-1.2.0.2 then - primitive-extras-0.7.1

then i get a build failure


17:1: error:
        Could not find module ‘STMContainers.Map’
        Perhaps you meant StmContainers.Map (from stm-containers-1.1.0.2)
        Use -v to see a list of the files searched for.
       |
    17 | import qualified STMContainers.Map as STMMap
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
$ stack --version
Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2

$ cabal-install version 1.24.0.2
compiled using version 1.24.2.0 of the Cabal library
decapo01 commented 5 years ago

To get this to work I downgraded the stm containers library. This is what my extra deps has in it.

- stm-containers-0.2.16
- focus-0.1.5.2