From 2b37fb7a1809e4d0aec3db33a9c8a215b00a869b Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Mon, 16 Apr 2007 13:04:57 +0000 Subject: [PATCH] Add missing special case for GHC.Prim The special cases for GHC.Prim are a bit fragile. We were relying on (a) the base package to be already registered and (b) the base package not to be hidden. These used to be true with the old library build system, but aren't true now. I'm still not sure why we aren't seeing failures at the moment, but this patch at least fixes the build with 'setup makefile'. --- compiler/main/Finder.lhs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/compiler/main/Finder.lhs b/compiler/main/Finder.lhs index df1fa3e..56929ce 100644 --- a/compiler/main/Finder.lhs +++ b/compiler/main/Finder.lhs @@ -243,6 +243,14 @@ findHomeModule hsc_env mod_name = exts | isOneShot (ghcMode dflags) = hi_exts | otherwise = source_exts in + + -- special case for GHC.Prim; we won't find it in the filesystem. + -- This is important only when compiling the base package (where GHC.Prim + -- is a home module). + if mod == gHC_PRIM + then return (Found (error "GHC.Prim ModLocation") mod) + else + searchPathExts home_path mod exts -- 1.7.10.4