haskell / haskell-ide-engine

The engine for haskell ide-integration. Not an IDE
BSD 3-Clause "New" or "Revised" License
2.38k stars 210 forks source link

hie fails to compile mutually recursive modules #1134

Open PanAeon opened 5 years ago

PanAeon commented 5 years ago

With mutually recursive modules, e.g.


# ------------- ModuleA.hs ---------------------------
module ModuleA where

import {-# SOURCE #-} ModuleB

newtype A = A Int   
# -------------ModuleB.hs ---------------------------

module ModuleB where

import ModuleA

foo :: Int
foo = 34  

# ------------ModuleB.hs-boot----------------------------
module ModuleB where

-- import ModuleA (A)

foo :: Int
#---------------------------------------------------------

hie reports error when working with moduleA, and stops to provide diagnostics:

/private/var/folders/j8/1wn_n3g12171ly1q141dr28507kn/T/ghc-mod32137/ModuleA32136-3.hs:3:23: error: Can't find /private/var/folders/j8/1wn_n3g12171ly1q141dr28507kn/T/ghc-mod32137/ModuleB32136-2.hs-boot

Screen Shot 2019-03-14 at 13 37 53pm

stack builds the project successfuly.

hie version: Version 0.6.0.0, Git revision 726c37e52ac25e034ec25118eb1bea4dedb03aba (2457 commits) x86_64 ghc-8.6.3 Version 0.7.0.0, Git revision d049fdfeef422933912c66245a50904ee98f86d0 x86_64 ghc-8.6.2 OS: Mac OS Sierra

alanz commented 5 years ago

@mpickering , does your new hie-bios deal with this properly?

mpickering commented 5 years ago

Yes it does but not perfectly. GHC has a lot of hs-boot files so I needed to deal with it.

alanz commented 5 years ago

Ok, so I think it is best to use this as a requirement on hie-bios, rather than try to fix it with the current setup.