Skip to content

Handle hsc files more robustly #353

Closed

Description

@fisx

to reproduce:

  • compile an hsc file in your project to its hs form (in order to make ghci work).
  • run stack --build.
  • hpack will find the hs file and add an entry to the module list.

this will lead to two identical entries for the module, one motivated by the hsc file, one motivated by the hs file.

desired behavior: if there are two files for one module, one hsc and one hs, only make one entry.

this is arguably not a bug but odd user behavior, but hpack may be in the best position to solve it. of course i am also very open to ideas how to fix my tooling. :-)

thanks!

Activity

  1. added a commit that references this issue on Nov 10, 2020
    e2a0be9
  2. added a commit that references this issue on Nov 10, 2020
    604b364
  3. sol commented on Nov 10, 2020

    @sol
    Owner

    @fisx sorry for the late reply. This will be fixed with the next release (thanks @andreasabel).

    of course i am also very open to ideas how to fix my tooling

    I think cabal will drop generated source files into dist/build/ (or some new-style equivalent). So what I would try is not generate anything within your source tree. Let cabal take care of generating any modules and add something like :set -idist/build/ to a .ghci file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions