I have discovered a bit more.
Sandbox usage has become more convenient with Cabal 1.20.
http://blog.johantibell.com/2014/04/announcing-cabal-120.html

Johan Tibell emphasises to not use 'cabal install'.
The workflow for a sandbox should then be more like

$ cd ~/programming/yi/yi
$ cabal sandbox init
$ cabal install --only-dependencies
$ cabal build


The resulting executable is ~/programming/yi/yi/dist/build/Yi/yi. (This 
isn't executable appropriate as a final install image, since it's not 
stripped as https://github.com/haskell/cabal/issues/1795 discusses; I'm not 
sure how much impact on performance the stripping would have..).

Cabal's user guide mentions the same flow, and mentions that "cabal build" 
is all that's needed if any source files have been modified.
http://www.haskell.org/cabal/users-guide/installing-packages.html#sandboxes-basic-usage


Anyway, the cool think which Cabal 1.20 brings is the 'cabal exec' command, 
which launches an executable in an environment with the GHC package DB as 
per the sandbox.
This means a "runyi" script is much simpler to write.

something like:

#!/bin/bash
YI_DIR=$HOME/programming/yi/yi
env CABAL_SANDBOX_CONFIG=$YI_DIR/cabal.sandbox.config cabal exec 
$YI_DIR/dist/build/Yi/yi 


Using $YI_DIR/.cabal-sandbox/bin/yi is fine as well, but would require an 
extra "cabal install" step for those hacking on the Yi source itself. 

-- 
-- 
Yi development mailing list
[email protected]
http://groups.google.com/group/yi-devel
--- 
You received this message because you are subscribed to the Google Groups 
"yi.devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to