[Haskell-cafe] Is it possible for cabal sandboxes to use $HOME/.cabal/lib?

Aldo Davide aldodavide at gmx.com
Mon Mar 30 20:57:51 UTC 2015


So basically, I think it would be useful for cabal to be able to support an arbitrary list of directories, e.g.:

/home/user/projects/foo/.cabal-sandbox/x86_64-linux-ghc-7.8.4-packages.conf.d
/home/user/.ghc/x86_64-linux-7.8.4/package.conf.d
/usr/lib64/ghc-7.8.4/package.conf.d

Whenever a package is needed, then it would look it up in all of those directories. If a new package is to be installed, it would be installed in the topmost directory. In other words, it would overlay these directories one on top of the other, with the topmost one being used for read-write and the other ones being read-only.

I understand that many people think that an implementation of nix-style packages would solve those issues, but I think the approach I describe above has its own merits.


Sent: Monday, March 30, 2015 at 9:04 PM
From: "Alexey Shmalko" <rasen.dubi at gmail.com>
To: "Brandon Allbery" <allbery.b at gmail.com>
Cc: "Aldo Davide" <aldodavide at gmx.com>, "Haskell Cafe" <haskell-cafe at haskell.org>
Subject: Re: [Haskell-cafe] Is it possible for cabal sandboxes to use $HOME/.cabal/lib?

Ok. Seems that I get this method working.
 
Just copied .cabal-sandbox and caba.sandbox.config over new location. Replaced all occurrences of the old path to the new one in cabal.sandbox.config and .cabal-sandbox/x86_64-linux-ghc-7.8.4-packages.conf.d/*.conf. After that I executed `cabal sandbox hc-pkg recache` and everything seems to work.
 
Doesn't seem like a sane solution, but can be used if absolutely needed.
 
On Mon, Mar 30, 2015 at 10:11 PM, Brandon Allbery <allbery.b at gmail.com> wrote:

On Mon, Mar 30, 2015 at 2:42 PM, Alexey Shmalko <rasen.dubi at gmail.com[rasen.dubi at gmail.com]> wrote:

Not sure, but is this possible to copy your home cabal sandbox to ./.cabal-sandbox? Then you'll have all your default packages available and won't build them again.
 
You'd need to fix paths in the package database and `cabal hc-pkg recache` (if that works; might need cabal exec).
 --

brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com[allbery.b at gmail.com]                                  ballbery at sinenomine.net[ballbery at sinenomine.net]
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net[http://sinenomine.net]


More information about the Haskell-Cafe mailing list