cabal

Cabal Multiple Executables

蓝咒 提交于 2019-12-05 17:14:18
问题 I'm working on a website using Yesod I have the normal build running but I can't seem to populate my database reliably. I have a second haskell program that populates the database and I've added it to my cabal file like this: executable program if flag(library-only) Buildable: False main-is: ../main.hs hs-source-dirs: dist build-depends: base , myproject , yesod-default executable init if flag(library-only) Buildable: False main-is: init.hs hs-source-dirs: Init build-depends: base , directory

Flags in cabal files

霸气de小男生 提交于 2019-12-05 16:42:26
问题 I am following the user-guide for package developing: https://www.haskell.org/cabal/users-guide/developing-packages.html#quickstart I got stuck in the Flags section. How do I pass flags to my files? Is it just at build time? I have tried to search for it, but found no useful information - just the command option --flags . cabal build -f debug doesn't work Flag Debug Description: Enable debug support Manual: True Default: False BenchMark bench-foo ghc-options: -Wall type: exitcode-stdio-1.0

How do I get Cabal to bypass my Windows proxy settings?

走远了吗. 提交于 2019-12-05 14:50:42
When retrieving packages with Cabal, I frequently get errors with this message: user error (Codec.Compression.Zlib: premature end of compressed stream) It looks like Cabal is using my Windows Networking proxy settings (for Privoxy). From digging around Google, Cabal or its libraries appear to have (had) a problem in this area. Possible solutions I can see are: Turn off proxying while using Cabal (not very keen on this one); or Get a patch and start hacking. I'm hesitant to go down this path, as I'm a complete Haskell noob and I'm not yet comfortable with Darcs; or Give it the magic "can I haz

Multiple Haskell cabal-packages in one directory

こ雲淡風輕ζ 提交于 2019-12-05 13:43:48
What is the recommended way of having several cabal packages in one directory? Why : I have an old project with many separable modules. Since originally they formed just one program it was, and still is, handy to have them in same directory for easy compiling. Options Just suffer and split everything, including VCS holding the stuff, into different directories? Hack cabal until it is happy with multiple .cabal files in same directory? Make another subdirectory for each module and put .cabal files there along with symlinks to original pieces of code? Something smarter? What? I'd have to

Installed parsec in sandbox, but can't find libraries when trying to load file in ghci

浪子不回头ぞ 提交于 2019-12-05 12:37:40
tl;dr: installed library with cabal sandbox, ghci still complains that the library is missing I have a directory where I am developing some Haskell stuff. This used to work fine on another computer, with ghc 7.6, but now that I'm working on another computer with ghc 7.8.2 (I don't know if the version would matter) I get errors like this: Prelude> :l Interpreter.hs Parser.hs:9:8: Could not find module ‘Text.ParserCombinators.Parsec’ Perhaps you meant Text.ParserCombinators.ReadPrec (from base) Text.ParserCombinators.ReadP (from base) Use -v to see a list of the files searched for. when trying

How to upgrade gtk2hsC2hs?

久未见 提交于 2019-12-05 11:16:44
问题 I am trying cabal install glib-0.12.3 under my Ubuntu 11.10 using cabal-install 0.10.2. However, it shows the following error messages: setup: The program gtk2hsC2hs version >=0.13.5 is required but the version found at /usr/bin/gtk2hsC2hs is version 0.13.4 cabal: Error: some packages failed to install: glib-0.12.3 failed during the configure step. The exception was: ExitFailure 1 After half an hour's search, I cannot find where this gtk2hsC2hs is. I dug into places like http://code.haskell

Blacklisting your own faulty hackage release

五迷三道 提交于 2019-12-05 10:52:12
问题 I've accidentally uploaded a faulty distribution and tried to reupload it right away, but cabal replied with: This version of the package has already been uploaded. As a matter of policy we do not allow package tarballs to be changed after a release (so we can guarantee stable md5sums etc). The usual recommendation is to upload a new version, and if necessary blacklist the existing one. In extraordinary circumstances, contact the administrators. Okay, I've incremented the version and uploaded

cabal can't use http proxy

早过忘川 提交于 2019-12-05 09:59:01
My Linux(redhat6) server has to use http proxy to connect to outside world. While it works for other things like wget, it doesn't work for cabal. cabal update -v3 shows errors like this: 407 - proxy authentication required cabal: Failed to download http://hackage.haskell.org/packages/archive/00-index.tar.gz : ErrorMisc "Unsucessful HTTP code: 407" I tried to change http_proxy environment variable to format like http:// user: passwd at proxy:port, but it doesn't work either. The same problem has been asked here But I'm not allowed use a proxy server like polipo, is there any other way to make

ghc-pkg check haddock warnings

时光毁灭记忆、已成空白 提交于 2019-12-05 04:54:31
Upon a fresh install of the haskell-platform (via homebrew ) ( GHC x64 7.6.3 ) on OSX 10.9.2 I receive the following warnings when I run ghc-pkg check (see below) Warning: haddock-interfaces: /Users/user/.cabal/share/doc/x86_64-osx-ghc-7.6.3/ghc-mod-3.1.7/html/ghc-mod.haddock doesn't exist or isn't a file Warning: haddock-html: /Users/user/.cabal/share/doc/x86_64-osx-ghc-7.6.3/ghc-mod-3.1.7/html doesn't exist or isn't a directory Warning: haddock-interfaces: /Users/user/.cabal/share/doc/x86_64-osx-ghc-7.6.3/hlint-1.8.59/html/hlint.haddock doesn't exist or isn't a file Warning: haddock-html:

mysterious cabal-install problems

ⅰ亾dé卋堺 提交于 2019-12-05 02:01:41
With a clean install of the "Haskell Platform". (OS X Snow-Leopard & Platform 2010.1.0.1), doing this causes simple sequence causes very weird cabal install behaviour: $ cabal install time $ cabal install random $ ghc-pkg list random /Library/Frameworks/GHC.framework/Versions/612/usr/lib/ghc-6.12.1/package.conf.d random-1.0.0.2 /Users/yairc/.ghc/i386-darwin-6.12.1/package.conf.d random-1.0.0.2 random-1.0.0.2 is installed twice in my system. and now doing cabal install random reinstalls random-1.0.0.2 every time. Looks like random depends on time , and cabal wants to reinstall it after there's