23

I would like to work on a project in a cabal sandbox. But instead of using the same remote-repo as my non-sandboxed code (i.e., Hackage), I'd like to point to a different remote repo. I tried creating a cabal.config file in the project directory with a remote-repo line, but it seemed to have no effect; running cabal update after that indicated that Hackage was being downloaded, but not my custom repo.

Is this use case supported, and if so, how do I achieve it?

Michael Snoyman
  • 31,100
  • 3
  • 48
  • 77
  • I think you need to name the file `cabal.sandbox.config`. – Tobias Brandt May 19 '14 at 23:02
  • The top of that file says: -- This is a Cabal package environment file. -- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY. -- Please create a 'cabal.config' file in the same directory -- if you want to change the default settings for this sandbox. – Michael Snoyman May 20 '14 at 04:46
  • Adding a `remote-repo` line to a cabal.config only sets the repository as a [secondary option](https://github.com/haskell/cabal/issues/1488) (when the first one is offline): it's a list rather than a single field. Don't know if that feature exists in Cabal. *Maybe reopen that issue or create a feature request?* – Rudy Matela May 27 '14 at 16:22
  • @RudyMatela I don't see the "secondary option" implication in that issue, sorry. To be clear, adding a second remote-repo to the main cabal config file works as I'd expect (both repos are used simultaneously). – Michael Snoyman May 28 '14 at 04:35

1 Answers1

4

This is in fact a Cabal bug, I've opened a Github issue about it.

Michael Snoyman
  • 31,100
  • 3
  • 48
  • 77