Problem using the debugger with Test

I’m trying to use ghci debugger to debug a failing test.
I use a normal set up with a library and a separate test package.
I’m trying to setup a breakpoint in a function from a module (from the library) imported by the test file, I get

ghci> :b WarehousePlanner.Rearrange 168
module 'WarehousePlanner.Rearrange' is from another package;
this command requires an interpreted module

Any idea ?

Solved

I found out that using adding stack ghci --test and then :load test/Spec.hs loads every modules (but what I was doing stack ghci test/Spec.hs doesn’t).

1 Like

Maybe --enable-multi-repl will do, test and report back.

1 Like

This seems to be a cabal flag. I am using stack any idea if and how it can be done vith stack ?

Nope sorry, but we have plenty of stack users on Discourse, wait a bit and they will chime in.

I was tripped up by that many times. Similarly, remember to use stack’s --bench or --profile flags when running ghc/ghci/ghcid in those contexts.

2 Likes