Why can't cabal build mighttpd2 dynamically? - haskell

GHC is too slow when it links my executable statically, so I want to test using "-dynamic" options. The following two commands cause the same error although cabal install mighttpd2 is ok.
$cabal install --ghc-options=-dynamic mighttpd2
$cabal install --enable-executable-dynamic mighttpd2
Linking dist/build/mkindex/mkindex ...
Preprocessing executable 'mightyctl' for mighttpd2-2.7.1...
Process.hs:11:8:
Could not find module `Data.Conduit.Process'
Perhaps you haven't installed the "dyn" libraries for package `process conduit-0.5.0.2'?
Use Perhaps you haven't installed the "dyn" libraries for package `process-conduit-0.5.0.2'?
Use -v to see a list of the files searched for.
cabal: Error: some packages failed to install:
mighttpd2-2.7.1 failed during the building phase. The exception was:ExitFailure 1

You need to install the dynamic version of all the libraries that mighttpd2 depends on. cabal-install is rightly complaining that the dynamic version of process-conduit is not available. You will have to reinstall mighttpd2's entire dependency tree with --enable-shared --enable-executable-dynamic passed to cabal-install.

Related

cabal fails to find a library built and installed with cabal install --lib (linux)

I am building a Haskell library with Cabal,
and want to use this library in some other Cabal projects.
The problem is that after installing the library (with Cabal),
my library is not available to the other Cabal projects.
Neither ghc-pkg list nor cabal list shows my library
(and also does not show packages that my library depends on but
was downloaded by cabal as part of the build of my library).
How do I make cabal find my library when building the dependent projects?
I am using Linux, but the same problem has been reported for
Windows.
My setup:
Linux (Debian 11.5)
Haskell installed by ghcup:
ghc 8.0.2
cabal 3.6.2
(My library and the other projects need this version of ghc.)
My library builds and installs without problems using
$ cabal build
$ cabal install --lib
But ghc-pkg list and cabal list --installed both show only the
"predefined" libraries that was installed before the build.
These are found in ~/.ghcup/ghc/8.0.2/lib/ghc-8.0.2/package.conf.d/.
My library, and the libraries that it depends on, are installed in
~/.cabal/store/ghc-8.0.2/package.db/. But cabal doesn't find them
when building my other dependent projects.
I have tried different options for building, all with the same
result of
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: <PRJ-USING-LIB> (user goal)
[__1] unknown package: wilde (dependency of <PRJ-USING-LIB>)
[__1] fail (backjumping, conflict set: <PRJ-USING-LIB>, <MY-LIB>)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: <PRJ-USING-LIB>, <MY-LIB>
The options I tried are:
cabal build --global
cabal build --user
cabal build --package-db=~/.cabal/store/ghc-8.0.2/package.db
Interestingly, when adding ghc-options: -L<PATH-TO-MY-LIB-SRC> to the
dependent projects cabal file, cabal build says that my library is hidden:
...
Warning: Instead of 'ghc-options: -L<PATH-TO-MY-LIB-SRC>' use
'extra-lib-dirs: <PATH-TO-MY-LIB-SRC>'
...
app/Main.hs:3:1: error:
Failed to load interface for ‘<MODULE-IN-MY-LIB>’
It is a member of the hidden package ‘<MY-LIB>-0.5’.
Perhaps you need to add ‘<MY-LIB>’ to the build-depends in your .cabal file.
Use -v to see a list of the files searched for.
But trying to ghc-pkg expose <MY-LIB>, it says that
it cannot find .

Issue installing Snap on macOS Sierra

I'm having trouble installing the Haskell framework Snap on macOS Sierra. Whenever I install it, I get the following message:
Resolving dependencies...
Configuring securemem-0.1.9...
Configuring skein-1.0.9.4...
Configuring configurator-0.3.0.0...
Configuring cryptonite-0.24...
Building configurator-0.3.0.0...
Building securemem-0.1.9...
Building skein-1.0.9.4...
Failed to install configurator-0.3.0.0
Build log ( /Users/nicholas/.cabal/logs/ghc-8.2.1/configurator-0.3.0.0-6dySPcNCURWFswtMXJvzho.log ):
cabal: Entering directory '/tmp/cabal-tmp-66175/configurator-0.3.0.0'
Configuring configurator-0.3.0.0...
Preprocessing library for configurator-0.3.0.0..
Building library for configurator-0.3.0.0..
<command line>: cannot satisfy -package-id attoparsec-0.13.2.0-5dp4kBDsiGY4dQpLKbD5rk:
attoparsec-0.13.2.0-5dp4kBDsiGY4dQpLKbD5rk is unusable due to shadowed dependencies:
scientific-0.3.5.1-L0qYzdp0wpz8rO8gircNSR text-1.2.2.2-EGUst8sqNAZCw1xLPcmcMH
(use -v for more information)
cabal: Leaving directory '/tmp/cabal-tmp-66175/configurator-0.3.0.0'
Configuring transformers-base-0.4.4...
Building cryptonite-0.24...
Building transformers-base-0.4.4...
Installed securemem-0.1.9
Installed transformers-base-0.4.4
Installed skein-1.0.9.4
Installed cryptonite-0.24
Updating documentation index
/Users/nicholas/Library/Haskell/share/doc/x86_64-osx-ghc-8.2.1/index.html
cabal: Error: some packages failed to install:
configurator-0.3.0.0-6dySPcNCURWFswtMXJvzho failed during the building phase.
The exception was:
ExitFailure 1
snap-1.0.0.2-5CZKyA9EY4oLgkpHYCVfnv depends on snap-1.0.0.2 which failed to
install.
I'm using the Haskell Platform installed using homebrew (brew cask install haskell-platform), and cabal version 2.0.0.2. I have tried using sudo and deleting my ~/.ghc file
There was an issue with full 8.2.1 binary platform builds that's just been resolved: https://mail.haskell.org/pipermail/haskell-cafe/2017-October/127979.html
This was likely an instance of that.
(see also: GHC cannot find libraries on fresh install of Haskell-Platform)
This looks like a bug in Cabal 2 (or potentially GHC 8.2). See https://github.com/haskell/cabal/issues/4728. I'd recommend sticking to GHC 8.0.2 for the moment with either cabal 1.24 or Stack. I'm the case of Stack, the version won't matter, since it will use the Cabal version shipped with GHC.

cabal error: Could not find module `GHC.TypeLits'. How do I fix this?

I get the following when trying to install Hlearn:
$ cabal install HLearn-distributions --ghc-options=-XConstraintKinds
Resolving dependencies...
Configuring HLearn-distributions-0.1.0.1...
Building HLearn-distributions-0.1.0.1...
Preprocessing library HLearn-distributions-0.1.0.1...
src\HLearn\Models\Distributions\Moments.hs:13:14:
Warning: -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.
src\HLearn\Models\Distributions\Moments.hs:24:8:
Could not find module `GHC.TypeLits'
Perhaps you meant GHC.Types (needs flag -package ghc-prim)
Use -v to see a list of the files searched for.
cabal.exe: Error: some packages failed to install:
HLearn-distributions-0.1.0.1 failed during the building phase. The exception
was:
ExitFailure 1
I've tried installing the package using cabal (cabal install ghc-prim) but there's no such package. Also tried
$ cabal install HLearn-distributions --ghc-options=-XConstraintKinds -f-package ghc-prim
cabal.exe: There is no package named 'ghc-prim'.
You may need to run 'cabal update' to get the latest list of available
packages.
Any suggestions?
The module GHC.TypeLits is only available from base-4.6 on, with ghc-7.6.1.
I don't see any guards around the import, so the stated constraints on base in the build-depends are wrong in the versions 0.1.0.0 and 0.1.0.1.
If you want to install that package, you have to upgrade to ghc-7.6 or install a version < 0.1,
$ cabal-install "HLearn-distributions < 0.1"

installing reactive banana-wx or wx on redhat based linux with ghc 7.0.4

hi i'm trying to install, (without having to update or install the latest compiler),reactive-banana-wx and one of the requirement's are failing
cabal install reactive-banana-wx
and heres the error
Configuring wxc-0.90.0.4...
setup: failed
cabal: Error: some packages failed to install:
reactive-banana-wx-0.6.0.1 depends on wxc-0.90.0.4 which failed to install.
wx-0.90.0.1 depends on wxc-0.90.0.4 which failed to install.
wxc-0.90.0.4 failed during the configure step. The exception was:
ExitFailure 1
wxcore-0.90.0.3 depends on wxc-0.90.0.4 which failed to install
when i try to cabal install wxcore ,wx or wxc they all say failed and point towards wxc being required.
here's the error
cabal install wxc
Resolving dependencies...
[1 of 1] Compiling Main ( /tmp/wxc-0.90.0.419410/wxc-0.90.0.4/Setup.hs, /tmp/wxc-0.90.0.419410/wxc-0.90.0.4/dist/setup/Main.o )
Linking /tmp/wxc-0.90.0.419410/wxc-0.90.0.4/dist/setup/setup ...
Configuring wxc-0.90.0.4...
setup: failed
cabal: Error: some packages failed to install:
wxc-0.90.0.4 failed during the configure step. The exception was:
ExitFailure 1
here's my compiler info if it would be useful
ghc -v
Glasgow Haskell Compiler, Version 7.0.4, for Haskell 98, stage 2 booted by GHC version 7.0.4
I've got the same error trying to install phooey with ghc 7.4.1 on Debian tonight. The reason is a bug in the package wxc-0.90.0.4 and it should affect all wxHaskell-based packages. You can fix it, there is no need to downgrade your wxc package...
The easiest way to reproduce it is to do
cabal install wxc
or
cabal install glade
It might be a good idea to make sure that all prerequisites are in place, before you do it. wxc depends on a number of cabal and Linux packages and all of them should be installed and compiled... I did it in the most stupid way possible, just by running
cabal install wxc
and reading error messages which it spills out. This sweetie usually tells you what it wants... For instance, if it complains about cabal package x, just do cabal install x. If it complains about Linux package y, then use your Linux package manager and install the development version of this package, which is called normally lib<y>-dev in Debian. So, for instance, if
cabal install wxc
gives you an error saying that package gtk+2.0 is missing, you want to do
apt-get install libgtk2.0-dev
The same story with cairo, glade2 and other GTK-related libraries
When you are green with all prerequisites, you want to install wxWidgets-2.9, which is currently in the Development stage... so, it doesn't have any binaries for Linux and you should build it yourself. Download the source code from wxWidgets website and build it. It is pretty easy to do, just:
untar/unzip the source code to your favorite directory
run ./config
run ./make
If you are on wxc-0.90.0.4, at this moment you should encounter our little bug... To keep the long story short, it is in the file eljpen.cpp, which you can find in
~/.cabal/packages/hackage.haskell.org/wxc/0.90.0.4/wxc-0.90.0.4.tar.gz
Open the archive, go to the line 159 in the file and replace *_ref = NULL; with _ref = NULL or anything else what makes more sense. Then recreate the archive in the same place with the fixed eljpen.cpp file in it.
run ./make
It should work now.
run sudo make install (normally, you should have root privileges to insatll wxWidgets library...).
after it is done try to do
cabal install wx
again. It should be working now. I guess, after that you can enjoy your reactive-banana-wx, wxHaskell, phooey, etc.
PS http://sourceforge.net/tracker/index.php?func=detail&aid=3576397&group_id=73133&atid=536845. Why didn't I find it earlier? :/
I'v solved this problem on Lubuntu 12.10 so:
sudo cabal info wx
Synopsis: wxHaskell
Versions available: 0.11.1.2, 0.12.1.4, 0.12.1.5, 0.12.1.6, 0.13.2,
0.13.2.1, 0.13.2.3, 0.90, 0.90.0.1 (and 11 others)
I picked out different versions of wxHaskell, but only 0.13.2.3 was right.
sudo cabal install wx-0.13.2.3
...and everything has compiled and installed. Then I could install:
sudo cabal install reactive-banana-wx -fbuildExamples
That's no depends on the version of your Glasgow Haskell Compiler or the sort of your Linux.

install haskell cabal w/o manual dependency resolution

I see there's a nice package system called Cabal that handles dependency resolution. So I'm trying to install that so I can get it to install the Haskell OpenGL modules for me. However, Cabal itself has lots of dependencies. Is there a way to install Cabal without manually resolving all of its dependencies? I tried running the bootstrap, but that doesn't seem to do it, because it reports missing modules parsec and network (which in turn have their own dependencies).
Manually building the dep's got me about 3 deep before the mtl module install crapped out on me:
user#machine:~/haskell/mtl-1.1.0.2$ runghc Setup build
Preprocessing library mtl-1.1.0.2...
Building mtl-1.1.0.2...
Control/Monad/Cont.hs:74:7:
Could not find module `Control.Monad':
Perhaps you haven't installed the profiling libraries for package base?
Use -v to see a list of the files searched for.
You should install the Haskell Platform ("batteries included")

Resources