Ensure sandbox is used #1596

Closed
ygale opened this Issue Nov 28, 2013 · 2 comments

Projects

None yet

3 participants

@ygale
Contributor
ygale commented Nov 28, 2013

Since the cabal commands in a sandbox are exactly the same as for not in sandbox, it is very easy to destroy your GHC installation accidentally by forgetting to initialize a sandbox and typing cabal install inside a project with many dependencies.

I suggest adding a setting to cabal.config - valid in both the global and local cabal.config - to ensure that operations that modify the environment only run in a sandbox. When not in a sandbox, such operations would fail with an error message.

The setting could be something like this:

require-sandbox: True

It would then make sense to add a command-line option to override the config setting explicitly: like --require-sandbox and --no-require-sandbox.

@23Skidoo 23Skidoo was assigned Nov 28, 2013
@23Skidoo
Member

Should be easy to implement.

@wiz
wiz commented Dec 9, 2013

it is very easy to destroy your GHC installation accidentally

Just did this ):

@23Skidoo 23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Dec 19, 2013
@23Skidoo 23Skidoo Implement the 'require-sandbox' option.
Fixes #1596.
6df90cf
@23Skidoo 23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Dec 19, 2013
@23Skidoo 23Skidoo Implement the 'require-sandbox' option.
Fixes #1596.
39381c9
@23Skidoo 23Skidoo closed this in #1625 Dec 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment