Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i use runhaskell with cabal-dev?

Unfortunately cabal-dev ghci does not work in this project, i get an error:

Loading package download-0.3.2 ... linking ... 
ghc: /home/stulli/haskell/ifdl/cabal-dev//lib/download-0.3.2/ghc-7.4.1/HSdownload-0.3.2.o: unknown symbol `stat64'
ghc: unable to load package `download-0.3.2'

So i try runhaskell, but it uses the packages that come installed with cabal instead of cabal-dev and thus fails.

update: runhaskell produces the same error:

$ runhaskell -isrc:src/test -package-conf=cabal-dev/packages-7.4.1.conf src/test/Test.hs
Test.hs: /home/stulli/haskell/ifdl/cabal-dev//lib/download-0.3.2/ghc-7.4.1/HSdownload-0.3.2.o: unknown symbol `stat64'
Test.hs: Test.hs: unable to load package `download-0.3.2'

cabal-dev install on the other hand works without problems.

like image 241
somesoaccount Avatar asked Feb 20 '12 22:02

somesoaccount


People also ask

What is the difference between stack and cabal?

Stack supports creating projects using templates. It also supports your own custom templates. Stack has built-in hpack support in it. It provides an alternative (IMO, a better) way of writing cabal files using yaml file which is more widely used in the industry.

How do I run a cabal project?

To create a new project using Cabal, you should first be in a specific directory set aside for the project. Then you can use cabal init -n to create a project. This will auto-generate a . cabal file for you with defaults in all the metadata fields.

Where is cabal installed?

Using Cabal By default stack installs packages to ~/. cabal and ~/. ghc in your home directory.


1 Answers

You can try something like the next:

runhaskell -package-conf=cabal-dev/packages-7.0.3.conf main.hs

But I think if cabal-dev ghci doesn't work, then runhaskell will not work too. You need to find out what is wrong with download package.

like image 83
Yuras Avatar answered Oct 11 '22 00:10

Yuras