Questions tagged [ghc-pkg]

The command ghc-pkg can be used to handle GHC packages. It is used both internally by other tools and by GHC users.

The ghc-pkg tool is for querying and modifying package databases. The command ghc-pkg can be used to handle GHC packages. It is used both internally by other tools and by GHC users. It contains many commands that are often not needed by an average user.

This tool is most often used for uninstalling unneeded packages and those packages that are incompatible with packages that the user wants to install. It is also used for checking which packages are installed or have been broken by installs of other packages.

The stack of databases that ghc-pkg knows about can be modified using the GHC_PACKAGE_PATH environment variable and using --package-db options on the ghc-pkg command line.

14 questions
30
votes
4 answers

Is there a simple way to load extra packages to ghci when invoked via cabal repl?

cabal repl is quite useful for debugging a library, however ghci will have all packages hidden that aren't dependencies of the cabal package. While that is certainly a good thing for cabal build, for repl it means I can't load something from an…
leftaroundabout
  • 117,950
  • 5
  • 174
  • 319
9
votes
2 answers

Is there a way to find why cabal installed a certain package?

When installing a package with cabal-install, it will also indirectly install all the dependencies. Given a certain package in my .cabal/packages folder that I didn't directly install, is there a way to find what other package(s) it was a dependency…
hugomg
  • 68,213
  • 24
  • 160
  • 246
7
votes
1 answer

ghc-pkg: Couldn't open database for modification: hLock: invalid argument

I'm trying to compile the behead.hs script from the pandoc tutorial on Ubuntu 20.04 (WSL1). I can successfully compile it with stack exec -- ghc behead.hs or stack --resolver lts-16.25 exec -- ghc behead.hs but that uses pandoc-types-1.20 and I need…
peer
  • 4,171
  • 8
  • 42
  • 73
3
votes
1 answer

Missing ghc-mod packages in stack project

I recently broke something in my setup (probably stack upgrade) and found I cannot get it working again: ghc-mod: : cannot satisfy -package-id http-types-0.8.6-6a9e3ae2218aaee5f093c4f68fa256c5 $ stack list-dependencies | grep…
sevo
  • 4,559
  • 1
  • 15
  • 31
2
votes
0 answers

Upgrading a package without breaking ghc

In the global package database I have the version 1.3.6.0 of the directory package and I would like to use the version 1.3.6.1 for some project. But in the ghc-8.10.1.conf file there is: depends: (...) directory-1.3.6.0. How can I upgrade the…
user251130
  • 33
  • 3
2
votes
2 answers

How to work together with cabal-3 and ghc (ghc-pkg, too)?

With the release of cabal-3, the packages from Hackage are installed in a new location that the compiler ghc and ghc-pkg know nothing about. In other words, packages are installed but not registered for ghc. Ghci, ghc, ghc-pkg cannot work. For…
Vladimir
  • 541
  • 2
  • 8
2
votes
1 answer

Building haskell platform 2014.2.0.0 on debian wheezy using locally-built ghc

I would like to install the latest release of the Haskell platform on Debian wheezy. By executing sudo apt-get install haskell-platform I get ghc version 7.4.1 (released in 2012) whereas the current version is 7.8.3. So I have downloaded the…
Giorgio
  • 5,023
  • 6
  • 41
  • 71
2
votes
2 answers

Cannot locate cabal installed packages

I am at a loss. I use OS X 10.8.2. The only reference I can find is this: 4.1 I just installed packages, but now the packages are not found` This happens when you install a package globally, and the previous packages were installed locally.…
beoliver
  • 5,579
  • 5
  • 36
  • 72
1
vote
2 answers

Using ghc-pkg list and cabal list --installed give different lists

I'm trying to load my .hs file but when I import Data.Numbers.CReal, it gives me the error Failed to load interface for 'Data.Numbers.CReal'. I have runned cabal install numbers and if I cabal list --installed the number pkg appears, but if I…
Pablo D.
  • 11
  • 2
1
vote
1 answer

Access GHC package database in test and benchmark suite

I have a test suite and a benchmark suite that uses the GHC API to compile modules to Core, so that I don't have to write Core 'by hand'. I'm mostly using stack at this point, where I could just access the GHC_PACKAGE_PATH environment variable in…
Sebastian Graf
  • 3,602
  • 3
  • 27
  • 38
1
vote
1 answer

How does ghc resolve paths for libraries ?

I'm starting to to use haskell with nixpkgs. From the official guide to nixpkgs I read: GHC expects to find all installed libraries inside of its own lib directory. As it is stated it seems that it is saying that ghc require all the library to…
Giorgio Mossa
  • 235
  • 2
  • 13
1
vote
1 answer

Someone explain Haskell package management system

I just don't get it. It so confusing. I got that there's ghc-pkg, and Cabal and cabal-install. And these are all different things. I've been told that installing haskell-platform is a bad idea and it's better to get ghc and cabal-install…
iLemming
  • 34,477
  • 60
  • 195
  • 309
1
vote
2 answers

Haskell environment hosed post reinstall

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…
Abraham P
  • 15,029
  • 13
  • 58
  • 126
0
votes
1 answer

How to list files installed by a Haskell cabal package?

Is there a way to list files installed by a Haskell cabal package? In other words: is there a way to list files associated with a Haskell package? For example, in Debian based systems, including Ubuntu, one can use dpkg -l to list all packages, and…
Rudy Matela
  • 6,310
  • 2
  • 32
  • 37