I'm learning Haskell and I keep running into dependency problems when trying to run any project that isn't a simple single file tutorial-like file(aka, a real project).
The one I'm currently fighting with is a tetris clone I thought would be fun and interesting to learn from. Description of game and code at github
I cloned the repo and ran cabal install and got
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: tetris-hs-0.1.0.0 (user goal)
next goal: base (dependency of tetris-hs-0.1.0.0)
rejecting: base-4.5.0.0/installed-40b... (conflict: tetris-hs => base>=4.6 && <4.8)
rejecting: base-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 installed instance)
I have no idea what this means, so I started searching for steps on setting up projects and landed on the cabal user guide. Started playing with variations of runhaskell Setup.hs configure --user and got a list of missing dependencies. When I try to install them with cabal install foo, sometimes it works, most of the time I get an error, ranging from things like, "Its already installed" to "There is no package named 'Foo'". One interesting one was after I installed netwire, I tried to install lens, and it replies, "cabal: The following packages are likely to be broken by the reinstalls:
netwire-5.0.0"
If I try to just run runhaskell Main.hs it says, "Could not find module `Graphics.GLUtil'" and if I try to install Graphics.GLUtil, Graphics, or GLUtil, it says that there is no package of that name.
I need a cabal for dummies book or something.
EDIT:
After updating ghc and cabal, I ran cabal install again and it started installing everything but after a few minutes it hit a bump and spit out this:
cabal: Error: some packages failed to install:
FTGL-2.0 failed during the configure step. The exception was:
ExitFailure 1
GLFW-b-1.4.6 depends on bindings-GLFW-3.0.3.3 which failed to install.
GLUtil-0.8.2 depends on vector-0.10.11.0 which failed to install.
JuicyPixels-3.1.7.1 depends on vector-0.10.11.0 which failed to install.
adjunctions-4.2 depends on distributive-0.4.4 which failed to install.
bifunctors-4.1.1.1 depends on distributive-0.4.4 which failed to install.
bindings-GLFW-3.0.3.3 failed during the configure step. The exception was:
ExitFailure 1
comonad-4.2.2 depends on distributive-0.4.4 which failed to install.
distributive-0.4.4 failed during the building phase. The exception was:
ExitFailure 1
free-4.9 depends on distributive-0.4.4 which failed to install.
graphics-drawingcombinators-1.5 depends on FTGL-2.0 which failed to install.
lens-4.4.0.2 depends on vector-0.10.11.0 which failed to install.
linear-1.10.1.2 depends on vector-0.10.11.0 which failed to install.
profunctors-4.2.0.1 depends on distributive-0.4.4 which failed to install.
semigroupoids-4.2 depends on distributive-0.4.4 which failed to install.
tetris-hs-0.1.0.0 depends on vector-0.10.11.0 which failed to install.
vector-0.10.11.0 failed during the building phase. The exception was:
ExitFailure 1
When I try to cabal install vector:
[ 5 of 19] Compiling Data.Vector.Fusion.Stream.Monadic ( Data/Vector/Fusion/Stream/Monadic.hs, dist/build/Data/Vector/Fusion/Stream/Monadic.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package primitive-0.5.3.0 ... <command line>: can't load .so/.DLL for: libHSprimitive-0.5.3.0.so (libHSprimitive-0.5.3.0.so: cannot open shared object file: No such file or directory)
cabal: Error: some packages failed to install:
vector-0.10.11.0 failed during the building phase. The exception was:
ExitFailure 1
--force-reinstallswithout much danger and it usually just works if you did not install to much into your local rep. before. For the new error itself: try installing the first offending (here:vector) package directly and post the errors there - Random Devcabal sandbox initthencabal install --dependencies-only(or evencabal install --dependencies-only --force-reinstallsand test if this helps (it probably will) - Random Dev