[Git][ghc/ghc][wip/sv/T25246-b] Possible fix

Sjoerd Visscher (@trac-sjoerd_visscher) gitlab at gitlab.haskell.org
Wed Oct 23 13:28:22 UTC 2024



Sjoerd Visscher pushed to branch wip/sv/T25246-b at Glasgow Haskell Compiler / GHC


Commits:
7c7f3548 by Sjoerd Visscher at 2024-10-23T15:27:03+02:00
Possible fix

- - - - -


1 changed file:

- compiler/GHC/Unit/Finder.hs


Changes:

=====================================
compiler/GHC/Unit/Finder.hs
=====================================
@@ -461,7 +461,7 @@ findInstalledHomeModule fc fopts home_unit gwib at GWIB { gwib_mod = mod_name, gwib
    -- 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 `installedModuleEq` gHC_PRIM
+   if mod `installedModuleEq` gHC_PRIM && is_boot == NotBoot
          then return (InstalledFound (error "GHC.Prim ModLocation"))
          else searchPathExts search_dirs mod exts
 
@@ -488,13 +488,13 @@ findPackageModule fc unit_state fopts mod = do
 -- The redundancy is to avoid an extra lookup in the package state
 -- for the appropriate config.
 findPackageModule_ :: FinderCache -> FinderOpts -> InstalledModuleWithIsBoot -> UnitInfo -> IO InstalledFindResult
-findPackageModule_ fc fopts gwib at GWIB { gwib_mod = mod } pkg_conf = do
+findPackageModule_ fc fopts gwib at GWIB { gwib_mod = mod, gwib_isBoot = is_boot } pkg_conf = do
   massertPpr (moduleUnit mod == unitId pkg_conf)
              (ppr (moduleUnit mod) <+> ppr (unitId pkg_conf))
   modLocationCache fc gwib $
 
     -- special case for GHC.Prim; we won't find it in the filesystem.
-    if mod `installedModuleEq` gHC_PRIM
+    if mod `installedModuleEq` gHC_PRIM && is_boot == NotBoot
           then return (InstalledFound (error "GHC.Prim ModLocation"))
           else
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7c7f3548f80aea40f4ec242335b04e344d6ae1b3

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7c7f3548f80aea40f4ec242335b04e344d6ae1b3
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20241023/c9102459/attachment-0001.html>


More information about the ghc-commits mailing list