creswick / cabal-dev

A wrapper program around cabal and cabal-install that maintains sandboxed build environments.
BSD 3-Clause "New" or "Revised" License
150 stars 24 forks source link

Allow to specify sandbox location via environment variable #38

Open hvr opened 13 years ago

hvr commented 13 years ago

It would be convenient to be able to specify the default sandbox location (which currently seems hard-coded to ./cabal-dev) via an environment variable. The -s/--sandbox=DIR option should have always precedence over the location set via an environment variable.

creswick commented 13 years ago

This seems reasonable to me - does anyone have suggestions for a name? I'm a /little/ concerned about name clashes, but that's probably just me being paranoid.

@hvr: in the short term, it should be easy to work around this with a shell script that inserts a variable of your choice and passes the remaining arguments on to cabal-dev.

This should work:

#!/bin/bash

CABAL_DEV=/path/to/cabal-dev
$CABAL_DEV --sandbox=$(eval 'echo '"$SANDBOX_VAR") "$@"
hvr commented 13 years ago

...what about a more or less verbose variable called CABAL_SANDBOX?

lightquake commented 12 years ago

Just wanted to say that I wrote a script called sandboxer that takes care of this by wrapping cabal-dev using a script similar to creswick's.

If you wanted to be super fancy about it you could do something like the virtualenv-burrito approach and make all the sandboxes in ~/.cabal-dev/sandboxes/sandbox_name or something.