cabal

Can I get `cabal install` to use multiple cores?

南楼画角 提交于 2019-11-30 11:46:06
问题 Does anyone know how to get cabal install to exploit parallelism? I'm compiling with GHC, and while I don't know if GHC itself can do parallel builds, surely cabal install could run multiple compilations in parallel, no? At least for distinct, independent packages? Does anyone know if it is possible and how to do it? 回答1: There was a Google Summer of Code project this summer to parallelize cabal-install . While it hasn't been merged into the mainline yet, the linked article provides

Is there any way to define flags for cabal dependencies?

霸气de小男生 提交于 2019-11-30 10:52:33
I recently ran into a Cabal issue that I only managed to solve by manually installing transformers-compat with the -f transformers3 flag in my cabal sandbox before running cabal install for my project. Is there any way to indicate in my application's .cabal file that I depend on a library so that it is built with the specific build flag? Christopher Monsanto One way to do this is to use Stack . Edit your stack.yaml to include flags: transformers-compat: transformers3: true See also the section on flags . Mikhail Glushenkov Looks like it's not possible to specify such a dependency via the build

Can't install cairo with cabal on Windows - how to get pkg-config on win?

百般思念 提交于 2019-11-30 08:37:25
问题 Configuring cairo-0.12.0... setup.exe: The program pkg-config version >=0.9.0 is required but it could not be found. cabal: Error: some packages failed to install: cairo-0.12.0 failed during the configure step. The exception was: ExitFailure 1 so how can I get pkg-config on windows or how to install cairo then ? 回答1: Do you have the cairo development files installed? Recall this isn't the same as having a cairo dll! See the Windows section of their download page for binaries. Also, you can

Enable --hyperlink-source for “cabal install”

心已入冬 提交于 2019-11-30 08:21:20
The command cabal haddock has very useful --hyperlink-source option. I would like to have the source hyperlinked when building documentation with cabal install . The ticket #517 seems to be just about it: http://hackage.haskell.org/trac/hackage/ticket/517 However, perhaps it is possible to set this flag via ~/.cabal/config file? If not, how can I get working cabal-install build with the patch from #517 without installing Cabal-1.9, which is currently mandatory (due to one patch from December)? Currently you cannot get the equivalent of the --hyperlink-source option when using the "all in one"

How to specify dependency on external C library in .cabal?

♀尐吖头ヾ 提交于 2019-11-30 06:46:55
I maintain a library with FFI bindings on Hackage. So my Haskell library depends on the corresponding C library and its header files. Now I specify the external dependency in the .cabal file like this: PkgConfig-Depends: libfoo >= 1.2 And it works well for me in Linux. However, I have a user of the library who reports, that installing pkg-config on Windows is rather cumbersome, and instead he prefers Includes: foo.h Extra-libraries: foo I'd like my library to be as easy to build as possible, and don't want to force build dependencies which are not strictly required. However, I see that Cabal

How to avoid recompiling in this cabal file?

我与影子孤独终老i 提交于 2019-11-30 04:44:48
I've been working on this Haskell project, and I have a cabal file for it. Now, my project is structured as a library that implements a simple interpreter. I also have a very short Main file which needs to be build into an executable to call the library. What I want to do is: 1) compile the library and expose some of the modules 2) compile the executable I have a cabal file that works and seems to do this. The problem is that when it compiles the executable it recompiles all the modules which have already been compiled in step (1) . I don't quite understand why it does this - is there any way

Depending on a local package in cabal

╄→尐↘猪︶ㄣ 提交于 2019-11-30 00:30:52
问题 I've written a few packages containing some extra functions for dealing with common types that reflect the way I like to use them (for instance, I prefer to treat Bson documents as maps, rather than lists of fields). I keep these packages in local source directories, not on Hackage. I would like to introduce dependencies between these packages in their .cabal files, using cabal's build-depends system. But this leads to the following error ( bson-docmap being a local module): cabal: At least

How to get cabal and nix work together

大兔子大兔子 提交于 2019-11-29 19:52:30
As far as I understood, Nix is alternative for cabal sandbox . I finally managed to install Nix, but I still don't understand how it can replace a sandbox. I understand you don't need cabal using Nix and the wrapped version of GHC; however if you want to publish a package you'll need at some point to package it using cabal. Therefore, you need to be able to write and test your cabal configuration within NIX. How do you do that? Ideally, I would like an environment similar to cabal sandbox but "contained" within NIX, is that possible? In fact, what I really would like is the equivalent of

How can my Haskell program or library find its version number?

心已入冬 提交于 2019-11-29 19:31:41
I would like my cabalised program to have a --version switch. I would like it to report the same version as is present in the .cabal file. If I have to update the version number separately in my Haskell source code as well as in the .cabal file, I will eventually get them out of sync. So, how can my program, while being compiled under cabal, get its version number from the .cabal file? Don Stewart This is well supported with Cabal. As follows (from xmonad): Import Paths_$myprogram - a file Cabal creates with lots of metadata from the .cabal file, along with a the module for handling version

MacOSX - cabal install: built failed during the building phase. The exception was: ExitFailure 1 - dist/package.conf.inplace: inappropriate type

我的未来我决定 提交于 2019-11-29 16:46:14
using cabal; came accross this error. did cabal install and this happened . failed during the building phase. The exception was: ExitFailure 1 checked my log; it said : dist/package.conf.inplace: inappropriate type I have 0 ideas what's going on. cabal build works though . #STRANGE CURRENTLY: CABAL version: 1.22.0.0. Glorious Glasgow Haskell Compilation version: 7.8.4 Possible explanation: you have upgraded GHC to 7.10, which does things a bit differently I gather, but not upgraded cabal-install. If this is the problem, running cabal install cabal-install -w ghc-7.8.4 # or whatever other