I have a project which pulls in two local packages. My stack.yaml has:
packages:
- '.'
- '../creatur-wains'
- '../creatur-wains-test-utils'
Both creatur-wains and creatur-wains-test-utils define a module called ALife.Creatur.Wain.TestUtils, but in creatur-wains it's only part of the test code, not part of the library. This wasn't a problem when I was using ghci. I could load both packages, and only the version of TestUtils from creatur-wains-test-utils was visible.
However, Stack also seems to pull in the test modules from creatur-wains, so I get the following error:
$ stack repl
The following GHC options are incompatible with GHCi and have not been passed to it: -Werror -threaded
Configuring GHCi with the following packages: creatur-dvector-wains, creatur-wains-test-utils, creatur-wains
* * * * * * * *
The following modules are present in multiple packages:
* ALife.Creatur.Wain.TestUtils (in creatur-wains, creatur-wains-test-utils)
* * * * * * * *
Not attempting to start ghci due to these duplicate modules.
Use --no-load to try to start it anyway, without loading any modules (but these are still likely to cause errors)
I can work around this using --no-load, and adding the packages one by one, but that's a bit tedious. Is this desireable behaviour for stack repl, or is it a bug?