{"action":"created","issue":{"url":"https://api.github.com/repos/haskell/cabal/issues/2680","labels_url":"https://api.github.com/repos/haskell/cabal/issues/2680/labels{/name}","comments_url":"https://api.github.com/repos/haskell/cabal/issues/2680/comments","events_url":"https://api.github.com/repos/haskell/cabal/issues/2680/events","html_url":"https://github.com/haskell/cabal/pull/2680","id":90936403,"number":2680,"title":"Exit with an error if $CABAL_SANDBOX_CONFIG does not point to extant file","user":{"login":"BardurArantsson","id":459138,"avatar_url":"https://avatars.githubusercontent.com/u/459138?v=3","gravatar_id":"","url":"https://api.github.com/users/BardurArantsson","html_url":"https://github.com/BardurArantsson","followers_url":"https://api.github.com/users/BardurArantsson/followers","following_url":"https://api.github.com/users/BardurArantsson/following{/other_user}","gists_url":"https://api.github.com/users/BardurArantsson/gists{/gist_id}","starred_url":"https://api.github.com/users/BardurArantsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BardurArantsson/subscriptions","organizations_url":"https://api.github.com/users/BardurArantsson/orgs","repos_url":"https://api.github.com/users/BardurArantsson/repos","events_url":"https://api.github.com/users/BardurArantsson/events{/privacy}","received_events_url":"https://api.github.com/users/BardurArantsson/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-25T11:36:08Z","updated_at":"2015-09-15T11:36:17Z","closed_at":"2015-07-07T09:07:03Z","pull_request":{"url":"https://api.github.com/repos/haskell/cabal/pulls/2680","html_url":"https://github.com/haskell/cabal/pull/2680","diff_url":"https://github.com/haskell/cabal/pull/2680.diff","patch_url":"https://github.com/haskell/cabal/pull/2680.patch"},"body":"--\r\n\r\nI think this fixes #2224. I haven't done extensive manual testing, but the tests all (obviously) still pass.\r\n\r\nExample output:\r\n\r\ncabal: Cabal sandbox file in $CABAL_SANDBOX_CONFIG does not exist: foo\r\n\r\nthe \"foo\" is the content of the env variable.\r\n\r\nI should note that the error occurs quite \"aggressively\", i.e. when the settings are read, and not when they are actually used -- so even things like \"cabal info\" will fail if the env variable is invalid. I think a more relaxed would be a lot more error-prone since it would be easy to miss cases.\r\n"},"comment":{"url":"https://api.github.com/repos/haskell/cabal/issues/comments/140360590","html_url":"https://github.com/haskell/cabal/pull/2680#issuecomment-140360590","issue_url":"https://api.github.com/repos/haskell/cabal/issues/2680","id":140360590,"user":{"login":"edsko","id":935288,"avatar_url":"https://avatars.githubusercontent.com/u/935288?v=3","gravatar_id":"","url":"https://api.github.com/users/edsko","html_url":"https://github.com/edsko","followers_url":"https://api.github.com/users/edsko/followers","following_url":"https://api.github.com/users/edsko/following{/other_user}","gists_url":"https://api.github.com/users/edsko/gists{/gist_id}","starred_url":"https://api.github.com/users/edsko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edsko/subscriptions","organizations_url":"https://api.github.com/users/edsko/orgs","repos_url":"https://api.github.com/users/edsko/repos","events_url":"https://api.github.com/users/edsko/events{/privacy}","received_events_url":"https://api.github.com/users/edsko/received_events","type":"User","site_admin":false},"created_at":"2015-09-15T11:36:17Z","updated_at":"2015-09-15T11:36:17Z","body":"I've submitted a PR that undoes this commit, because it makes `cabal` completely unusable when `CABAL_SANDBOX_CONFIG` is set. This check happens much too early, so that for instance we get\r\n\r\n```\r\n# ../dist/build/cabal/cabal sandbox init\r\ncabal: Cabal sandbox file in $CABAL_SANDBOX_CONFIG does not exist:\r\n./cabal.sandbox.config-7.8.4\r\n```\r\n\r\nMoreover, even if we initialize the sandbox using an older `cabal`\r\n\r\n```\r\n[7.8.4 ~/wt/projects/tuf/cabal/cabal-install/t]\r\n# ~/opt/cabal/cabal-1.22.0.0 sandbox init\r\nWriting a default package environment file to ./cabal.sandbox.config-7.8.4\r\nCreating a new sandbox at\r\n/Users/e/wt/projects/tuf/cabal/cabal-install/t/.cabal-sandbox\r\n```\r\n\r\ntrying to install any packages into the sandbox fails:\r\n\r\n```\r\n# ../dist/build/cabal/cabal install mtl\r\nResolving dependencies...\r\nNotice: installing into a sandbox located at\r\n/Users/e/wt/projects/tuf/cabal/cabal-install/t/.cabal-sandbox\r\nConfiguring transformers-0.4.3.0...\r\nFailed to install transformers-0.4.3.0\r\nBuild log ( /Users/e/wt/projects/tuf/cabal/cabal-install/t/.cabal-sandbox/logs/transformers-0.4.3.0.log ):\r\ncabal: Cabal sandbox file in $CABAL_SANDBOX_CONFIG does not exist:\r\n./cabal.sandbox.config-7.8.4\r\ncabal: Error: some packages failed to install:\r\nmtl-2.2.1 depends on transformers-0.4.3.0 which failed to install.\r\ntransformers-0.4.3.0 failed during the configure step. The exception was:\r\nExitFailure 1\r\n```\r\n"}}