On 07/12/2014 12:12 PM, Richard Goulter wrote:
> 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. 
> 

I have always used cabal build for Yi itself but cabal install for
dependencies. I didn't know about cabal exec though.

Do you want to make a PR documenting this workflow?

-- 
Mateusz K.

-- 
-- 
Yi development mailing list
yi-devel@googlegroups.com
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 yi-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to