Giorgio
Giorgio

Reputation: 5183

Cabal install reports package as installed, but Setup configure reports it as missing

I am using ghc-7.6.3 with cabal-install version 1.18.0.5 using version 1.18.1.3 of the Cabal library. My operating system is Debian Wheezy 7.5. I have a fresh cabal install, and that I have removed the .ghc from my home directory. After that I have changed the cabal config file and set:

remote-repo: stackage-nightly-2014-12-15:http://www.stackage.org/snapshot/nightly-2014-12-15

After that I did (following this documentation)

$ cabal update
$ cabal install alex happy yesod-bin

and the build complained that it cannot build package system-filepath-0.4.12.

So, I am trying to build package system-filepath-0.4.12 manually. After unpacking the archive, I cd-ed to the unpacked folder and entered:

$ ghc -o Setup Setup.hs
$ ./Setup configure

which gives:

Configuring system-filepath-0.4.12...
Setup: At least the following dependencies are missing:
text >=0.7.1

But

$ cabal install text

gives:

Resolving dependencies...
All the requested packages are already installed:
text-1.1.1.3
Use --reinstall if you want to reinstall anyway.

How is it possible that a package is reported as installed and missing at the same time? Should I look for a more stable remote-repo configuration, is there something I can check that might fix the missing text package? Note that I am not using a sandbox.

EDIT

Thanks for pointing out that there are two package databases. I have now tried both

$ cabal configure
$ cabal build

and

$ Setup configure --user
$ Setup build

Both give no error during configuration, but give the following error during the build phase:

Building system-filepath-0.4.12...
Preprocessing library system-filepath-0.4.12...
/usr/bin/ld: cannot find -lHStext-1.1.1.3-ghc7.8.3
collect2: error: ld returned 1 exit status

Upvotes: 1

Views: 174

Answers (2)

Daniel Wagner
Daniel Wagner

Reputation: 153162

There are (at least) two package databases: a global one available to all users, and a user-specific one. By default, Setup.hs looks in (and installs to) the global one, and cabal-install looks in (and installs to) the user-specific one. You can manually choose one or the other with --user and --global; so, you could fix this either by using

./Setup configure --user

or by

cabal install text --global

You can see the current state of the package databases with ghc-pkg, which will report information about both by default.

Upvotes: 1

jamshidh
jamshidh

Reputation: 12070

Try this instead

cd system-filepath--0.4.12
cabal configure

I am not sure why, but this works for me, whereas Setup.hs gave me the same error (truth be told, I always do it the cabal configure way, and am not sure if your way should also work).

Upvotes: 1

Related Questions