qfpl / applied-fp-course

Applied Functional Programming Course - Move from exercises to a working app!

Home Page:http://qfpl.io/projects/professional-fp-courses/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cabal initialise issue

aleith opened this issue · comments

As logged here

When I followed the setup instructions in the ReadMe.md:
$ cd path/to/applied-fp-course
$ cabal sandbox init
$ cabal install --only-dependencies --enable-tests. < 3rd instruction generated errors
$ cabal build
$ $EDITOR README.md

Terminal session:

Alastairs-15-MBP:applied-fp-course aleith$ cabal install --only-dependencies --enable-tests
cabal: No sandbox exists at /Users/aleith/dev/applied-fp-course/.cabal-sandbox

Alastairs-15-MBP:applied-fp-course aleith$ cabal sandbox init
Writing a default package environment file to
/Users/aleith/dev/haskell/QFPL-course/applied-fp-course/cabal.sandbox.config
Using an existing sandbox located at
/Users/aleith/dev/haskell/QFPL-course/applied-fp-course/.cabal-sandbox
Alastairs-15-MBP:applied-fp-course aleith$ cabal install --only-dependencies --enable-tests
clang: error: unknown argument: '-no-pie'
`gcc' failed in phase `C Compiler'. (Exit code: 1)

Alastairs-15-MBP:applied-fp-course aleith$ cabal build
Resolving dependencies...
Warning: solver failed to find a solution:
Could not resolve dependencies:
[__0] trying: applied-fp-course-0.1.0.0 (user goal)
[__1] unknown package: warp (dependency of applied-fp-course)
[__1] fail (backjumping, conflict set: applied-fp-course, warp)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: applied-fp-course, warp
Trying configure anyway.
Configuring applied-fp-course-0.1.0.0...
cabal: Encountered missing dependencies:
aeson ==1.,
http-types >=0.9 && <0.13,
optparse-applicative >=0.13 && <0.15,
semigroups ==0.18.
,
sqlite-simple ==0.4.,
sqlite-simple-errors ==0.6.
,
wai ==3.2.,
warp ==3.2.

No experience with (the) cabal so not sure if it's up or down and why I need it. Will try to get started on the course regardless, but this is confusing for a new user (near-novice coder) looking at Haskell only b/c it's supposed to be the future of code.

Heya, thanks for the issue. As per this link (haskell/haskell-platform#304) , it's not a problem with the course itself. But you've read that already. :)

What version of GHC & Cabal are you using?

$ cabal --version
$ ghc --version

We have the course automatically building on a CI system to ensure we support multiple versions of GHC & Cabal to try to avoid these issues. So we should have you fixed up and ready to roll quickly.

Answers:
cabal-install version 2.2.0.0
compiled using version 2.2.0.1 of the Cabal library
The Glorious Glasgow Haskell Compilation System, version 8.4.3

Reminds me I need to get back into the course for next Perth FP meet up, we are working through it and week 2 is close!

I found an old imprint of Bird_Wadler. Introduction to Functional Programming online and finding it very helpful to get the basics into my thick head.

Awesome!! So your cabal version supports the new-* commands for configuring, building, and testing Haskell Cabal projects. If you go back to the main README (https://github.com/qfpl/applied-fp-course#setup-build-tools) and after the instructions you refer to in your issue there are some more that are for Cabal versions >= 2.0.

$ cd path/to/applied-fp-course
$ cabal new-configure --enable-tests
$ cabal new-build <levelN>-exe
$ $EDITOR src/<LevelN>/README.md

I'll restructure that so it's a bit more obvious, but give that a try and let me know how it goes.

As a reminder, we have a few different channels available for asking questions @ https://qfpl.io/contact . Especially if there is a group working through the course, we might be able to arrange for something a bit more hands on, depending on numbers etc. :)

Good luck and come find us in IRC!