Skip to content

hs-source-dirs starting with ../ are not included in the -i<dir> arguments when using stack ghci file.hs #2895

@tallen-imvu

Description

@tallen-imvu

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

  1. add a relative path to hs-source-dirs:
    ex:
    hs-source-dirs: . ../extra

  2. Add a module to the ../extra directory and import it in your main file

  3. run command stack build
    everything should work

  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions