+ -- In interactive or --make mode, we are *not allowed* to demand-load
+ -- a home package .hi file. So don't even look for them.
+ -- This helps in the case where you are sitting in eg. ghc/lib/std
+ -- and start up GHCi - it won't complain that all the modules it tries
+ -- to load are found in the home location.
+ ioToRnM_no_fail (readIORef v_GhcMode) `thenRn` \ mode ->
+ let home_allowed = hi_boot_file ||
+ mode `notElem` [ DoInteractive, DoMake ]
+ in
+
+ ioToRnM (if home_allowed
+ then findModule mod_name
+ else findPackageModule mod_name) `thenRn` \ maybe_found ->
+