Reputation: 864
In macOS, if I execute
cabal install foo --global
where does cabal
install the foo package?
Upvotes: 1
Views: 1004
Reputation: 64740
There is no one place GHC stores global data—it depends on the configuration and that will vary by where you got GHC from (nixpkgs, Homebrew (brew
), MacPorts, raw from GHCHQ, etc.). For your particular case, you can get information as described by DanielWagner:
ghc-pkg describe unix --global
And some simple shell scripting can extract the specific information you desire:
ghc-pkg describe unix --global | egrep '^pkgroot' | cut -d' ' -f2
Output:
"/usr/local/Cellar/ghc/8.4.1/lib/ghc-8.4.1"
Or:
% nix-shell -p ghc
ghc-pkg describe unix --global | egrep '^pkgroot' | cut -d' ' -f2
Output:
"/nix/store/z0ypzmbhn6m0l2adzm8szcd72z7kwy04-ghc-8.0.2/lib/ghc-8.0.2"
Upvotes: 2
Reputation:
The setting for your user is in ~/.cabal/config
, in the install-dirs global
section, under prefix:
. (E.g. on Linux, it is pre-set to /usr/local
.)
Although in my cabal, for some reason --global
does the same thing as --user
, according to the man
page.
I would avoid using it.
Upvotes: 0