yesodweb / yesodweb.com-content

Content for the www.yesodweb.com site
http://www.yesodweb.com/
Other
67 stars 112 forks source link

Unable to install yesod dev libraries #216

Open wizzardx opened 6 years ago

wizzardx commented 6 years ago

Hi there. I'm a relative beginner to haskell and stack, and am starting to go by the Yesod book for v1.6.

I have a fresh stack install. version 1.7.1

At the moment, latest LTS is 12.7

Over in this chapter:

https://www.yesodweb.com/book/haskell

There is this text:

Once you have your toolchain set up correctly, you’ll need to install a number of Haskell libraries. For the vast majority of the book, the following command will install all the libraries you need:

stack build yesod persistent-sqlite yesod-static esqueleto

That gives me this error output:

Populated index cache.    

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

In the dependencies for esqueleto-2.5.3:
    persistent-2.8.2 from stack configuration does not match >=2.5 && <2.8  (latest matching version is 2.7.3.1)
needed since esqueleto is a build target.

Some different approaches to resolving this:

  * Set 'allow-newer: true' to ignore all version constraints and build anyway.

  * 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 /home/david/.stack/global-project/stack.yaml:

- persistent-2.7.3.1

Plan construction failed.

Following along with the recommended actions, I end up with this file:

/home/david/.stack/global-project/stack.yaml

With these lines:

packages: []
resolver: lts-12.7
extra-deps:
- persistent-2.7.3.1
- conduit-1.2.13.1
- resourcet-1.1.11

And stack gives me this error when attempting to run the 'stack build' command:

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

In the dependencies for conduit-extra-1.3.0:
    conduit-1.2.13.1 from stack configuration does not match >=1.3 && <1.4  (latest matching version is 1.3.0.3)
needed due to yesod-1.6.0 -> conduit-extra-1.3.0

In the dependencies for yesod-1.6.0:
    conduit-1.2.13.1 from stack configuration does not match >=1.3  (latest matching version is 1.3.0.3)
needed since yesod is a build target.

In the dependencies for yesod-core-1.6.6:
    conduit-1.2.13.1 from stack configuration does not match >=1.3  (latest matching version is 1.3.0.3)
    resourcet-1.1.11 from stack configuration does not match >=1.2  (latest matching version is 1.2.1)
needed due to yesod-1.6.0 -> yesod-core-1.6.6

In the dependencies for yesod-static-1.6.0:
    conduit-1.2.13.1 from stack configuration does not match >=1.3  (latest matching version is 1.3.0.3)
needed since yesod-static is a build target.

Some different approaches to resolving this:

  * Set 'allow-newer: true' to ignore all version constraints and build anyway.

  * 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 /home/david/.stack/global-project/stack.yaml:

- conduit-1.3.0.3
- resourcet-1.2.1

Plan construction failed.

conduit and resourcet are already in my global-project/stack.yaml, so if I follow the given advice, stack gives me this error:

The same package name is used in multiple local packages

conduit used in:
- PLIndex "conduit-1.3.0.3"
- PLIndex "conduit-1.2.13.1"

resourcet used in:
- PLIndex "resourcet-1.2.1"
- PLIndex "resourcet-1.1.11"
psibi commented 6 years ago

Can you follow the instruction from the quick start page instead: https://www.yesodweb.com/page/quickstart

We probably need to update the content to make it better.

wizzardx commented 6 years ago

Yes, that worked for me when I tried it. Thanks.

Would really like to go through the book as-is though.

Is there a confirmed book and LTS version combination that should work well together?

psibi commented 6 years ago

The latest LTS version should just work fine. If something doesn't work - just open a issue here (or better send a PR!) and we can improve them.

wizzardx commented 6 years ago

Thanks appreciated :-)

Though, I'm thinking of something that's more appropriate as a syllabus (eg: yesod book has been printed, so students of that that in a classroom setting should ideally be able to follow along without too much trouble).

In this case however, I was able to get further by leaving out the 'esqueleto' part of 'stack build'

I'll open issues for things I find as I work through the book.