Summary
stack ghci <target file> will correctly determine include directories using the cabal file's hs-source-dirs property unless the source directory starts with a ../
stack build however deals with this correctly.
Steps to reproduce
-
add a relative path to hs-source-dirs:
ex:
hs-source-dirs: . ../extra
-
Add a module to the ../extra directory and import it in your main file
-
run command stack build
everything should work
-
run command stack ghci <path to main>
Expected
ghci launched with package loaded
Actual
Error in compiling due to failing to load the extra module. Because it cannot find it.
running the stack ghci command with --version shows that the ../extra directory is not being added to the list of -i<directory> flags passed to ghci.
If the module is moved to a directory that does not require a ../ prefix, then that directory is included properly.
Stack version
$ stack --version
Version 1.3.2, Git revision 3f675146590da4f3edf768b89355f798229da2a5 (4395 commits) x86_64 hpack-0.15.0
Method of installation