开发者

What is the relationship between ghc-pkg and cabal?

开发者 https://www.devze.com 2022-12-27 21:17 出处:网络
With respect to how packag开发者_如何学Ces are created, installed and used in Haskell, what is the relationship between ghc-pkg and cabal?

With respect to how packag开发者_如何学Ces are created, installed and used in Haskell, what is the relationship between ghc-pkg and cabal?

What are their roles - when would you use one, over the other, or use both?

Are they complementary tools, competitive tools, or simply tools that do different jobs?


Graphically, the dependencies are:

Packages GHC can use
    | 
Are registered with "ghc-pkg register"
    |
And (almost always) built with Cabal
    |
With build dependencies resolved by cabal-install
    |
From Hackage.


ghc-pkg is a direct interface to GHC's package database. Cabal is a tool that provides a consistent distribution structure for packages and a way to specify metadata such as dependencies between packages, version numbers, and build information.

Using Cabal to install a package will register it with ghc for you (among other things), but that's the extent of the overlap, really.

Note that ghc-pkg also provides functionality that (as far as I know) Cabal doesn't, such as hiding installed packages.

0

精彩评论

暂无评论...
验证码 换一张
取 消