lukexi / halive

Live recompiler for Haskell
BSD 2-Clause "Simplified" License
263 stars 18 forks source link

Halive can't find cabal generated Paths #15

Closed schell closed 8 years ago

schell commented 8 years ago

This might not be a bug so much as a misunderstanding. How do I tell halive about the Paths_my_exe module generated by cabal? I need this in order to access data files packaged with cabal.

src/Main.hs:14:8:
    Could not find module ‘Paths_gelatin_example’
    Use -v to see a list of the files searched for.
lukexi commented 8 years ago

Hi Schell! : ))

Does passing the path to it as an include dir help? As in: https://github.com/lukexi/halive#passing-command-line-arguments

so like halive src/Main.hs path/where/Paths_gelative_example/lives

??

schell commented 8 years ago

Part of the problem is that I'm not quite sure where the module lives, since it's generated by cabal (or in this case cabal via stack). I'll see what I can find and post any updates here :) I hope all is well!

lukexi commented 8 years ago

Hmm, maybe something like

halive src/Main.hs `stack path --dist-dir`

?? (I haven't needed a Paths file in a while so I forget where it puts them but it's gotta be one of those stack path entries : )

schell commented 8 years ago

I revisited this today and figured it out. The answer is to include (stack path --dist-dir)/build/autogen.

Example using fish shell:

halive app/Example.hs src/ (stack path --dist-dir)/build/autogen