cabal

Retrieving names of modules included in a cabal package from parsing the .cabal file

穿精又带淫゛_ 提交于 2019-12-04 07:19:59
I wonder if there is a way to retrieve the module names of a cabal package from parsing the .cabal files. I have tried to use parsePackageDescription from Distribution.PackageDescription.Parse but for instance when I try parsing the .cabal of the Cabal package itself ( http://hackage.haskell.org/package/Cabal-1.18.1.2/Cabal.cabal ) the library value of PackageDescription is Nothing even though there is a library section with both exposed-modules and other.modules in the .cabal file. Is this intended or am I doing anything wrong? Also, if it is intended, does anyone know any other simple way of

How can I tell Cabal which dependency to use?

橙三吉。 提交于 2019-12-04 06:56:46
I'm trying to get Cabal to install the haskell-src-meta package, and I'm having difficulty with the template-haskell dependency. The dependencies for haskell-src-meta include both template-haskell >=2.7 && <2.9, template-haskell >=2.4 && <2.7, It so happens that template-haskell versions 2.7 and later will not install on my system, but template-haskell 2.5.0.0 will install. When I'm asking Cabal to install haskell-src-meta , how do I tell it to use template-haskell == 2.5.0.0 ? Here is the full information for cabal info haskell-src-meta on my system: * haskell-src-meta (library) Synopsis:

Cabal install criterion out of memory

自作多情 提交于 2019-12-04 06:32:29
问题 I'm running on a container with 768MB ram and 512 MB swap space. I can't increase either of this. cabal install criterion always gives Failed during the building phase. The exception was: ExitFailure (-9) This may be due to an out-of-memory condition. during Compiling Criterion.Types . Is there any way around this or do I have to make do without criterion? 回答1: Set RTS flags on GHC to limit its memory usage ( --ghc-options="+RTS -M600M" ) and avoid running multiple jobs in parallel ( -j1 ).

Cabal rebuild all with enable-shared flag

女生的网名这么多〃 提交于 2019-12-04 06:15:48
I am having an issue with building a shared library with ghc and I think I need to rebuild my haskell packages with --enable-shared, is there an easy way to rebuild all of my packages with cabal with the flag --enable-shared? If you have a ~/.cabal/world, cabal install --reinstall --enable-shared world could work, but test with the --dry-run flag first. That will, however only take care of cabal-installed packages. If you have packages installed with your distro's package manager, the distro might also provide shared versions for those (otherwise, you'd have to do it manually). Also, it would

Haskell environment hosed post reinstall

北慕城南 提交于 2019-12-04 05:28:52
问题 I've recently reinstalled my Haskell environment as I thought I had hosed it beyond recovery after updating my Mac OS X to Mavericks. Now every time I run cabal install cabal-install , I get the following error. Resolving dependencies... Configuring cabal-install-1.18.0.3... /var/folders/4l/qbdvy5xj4q53skv0zn0lhw940000gp/T/8247.c:1:12: warning: control reaches end of non-void function [-Wreturn-type] int foo() {} ^ 1 warning generated. Building cabal-install-1.18.0.3... Preprocessing

Can't install sdl2 via cabal

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 03:28:46
问题 I am trying to install helm . When I try to install it, however I get this error: $ cabal install helm Resolving dependencies... Configuring sdl2-1.1.0... cabal: The pkg-config package 'sdl2' version >=2.0.3 is required but it could not be found. Failed to install sdl2-1.1.0 cabal: Error: some packages failed to install: helm-0.6.1 depends on sdl2-1.1.0 which failed to install. sdl2-1.1.0 failed during the configure step. The exception was: ExitFailure 1 When I go to install sdl2 by itself, I

Error while creating test suites: “cannot satisfy -package-id”

血红的双手。 提交于 2019-12-04 03:16:27
I'm attempting to create a test suite for my project, HaskSplit in my .cabal configuration: -- Initial HaskSplit.cabal generated by cabal init. For further -- documentation, see http://haskell.org/cabal/users-guide/ name: HaskSplit version: 0.1.0.0 synopsis: Haskell Implementation of Shamir's Secret Sharing Scheme -- description: license: MIT license-file: LICENSE author: maintainer: -- copyright: category: Security build-type: Simple -- extra-source-files: cabal-version: >=1.10 executable HaskSplit main-is: Main.hs default-language: Haskell2010 -- other-modules: other-extensions:

Cabal Multiple Executables

孤街醉人 提交于 2019-12-04 02:17:53
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 , persistent , persistent-sqlite , text , myproject , yesod-default The problem is that when I run

Flags in cabal files

狂风中的少年 提交于 2019-12-04 01:22:33
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 default-language: Haskell2010 build-depends: base, time main-is: bench-foo.hs if flag(debug) && os

Using alex/happy with Cabal

限于喜欢 提交于 2019-12-04 00:18:08
I'm writing a compiler for a class I'm taking. The class isn't specifically Haskell but I'm using Haskell to write my compiler and interpreter. I have a cabal package setup to hopefully make it easy for my prof to run/compile. I have happy and alex in the build-tools field for both executables but Cabal ignores that and then complains that it cannot find the modules that Happy and Alex should be generating. If I manually run: alex LimpScanner.x happy LimpParser.y then cabal runs perfectly. I thought I had cabal automatically running them earlier but perhaps I remember imperfectly. limp.cabal: