SOLVED: GHC 9.3 API panics with "No home unit"

Norman Ramsey nr at cs.tufts.edu
Tue Sep 28 23:36:28 UTC 2021


 > The code worked in the 9.0 API, but using the 9.3 API causes a panic:
 > 
 >   sandbox: panic! (the 'impossible' happened)
 >     GHC version 9.3.20210918:
 >           unsafeGetHomeUnit: No home unit

SOLVED: I was getting an `HscEnv` by using `newHscEnv` with a `DynFlags`.
Turns out I'm not supposed to do that; using `getSession` instead
solved the problem.  Thanks to Cheng Shao for the diagnosis!

If there is something I can read to help me avoid similar mistakes in
the future, please point me in its direction!


Norman


More information about the ghc-devs mailing list