[Git][ghc/ghc][wip/inplace-final] 2 commits: Revert "Revert "Add some more packages to multi-cradle""

Matthew Pickering (@mpickering) gitlab at gitlab.haskell.org
Mon Aug 22 16:51:45 UTC 2022



Matthew Pickering pushed to branch wip/inplace-final at Glasgow Haskell Compiler / GHC


Commits:
3ec09df9 by Matthew Pickering at 2022-08-22T17:35:21+01:00
Revert "Revert "Add some more packages to multi-cradle""

This reverts commit a76f915ed981bfeef2ec4c8f5dced21d41edebd2.

- - - - -
9b7fd2df by Matthew Pickering at 2022-08-22T17:51:38+01:00
fix

- - - - -


2 changed files:

- hadrian/src/Rules/ToolArgs.hs
- hadrian/src/Settings/Builders/Ghc.hs


Changes:

=====================================
hadrian/src/Rules/ToolArgs.hs
=====================================
@@ -79,8 +79,6 @@ multiSetup pkg_s = do
                           (Ghc ToolArgs stage0InTree) [] ["ignored"]
       arg_list <- interpret fake_target getArgs
       let c = Context stage0InTree p (if windowsHost then vanilla else dynamic) Inplace -- Critical use of Inplace, one of the main motivations!
-      -- readContextData has the effect of configuring the package so all
-      -- dependent packages will also be built.
       cd <- readContextData c
       srcs <- hsSources c
       gens <- interpretInContext c generatedDependencies
@@ -128,7 +126,6 @@ mkToolTarget es p = do
     let fake_target = target context
                         (Ghc ToolArgs stage0InTree) [] ["ignored"]
     -- Generate any source files for this target
-    cd <- readContextData context
     srcs <- hsSources context
     gens <- interpretInContext context generatedDependencies
 
@@ -154,17 +151,17 @@ toolTargets = [ binary
               , directory
               , process
               , exceptions
---            , ghc     # depends on ghc library
---            , runGhc  # depends on ghc library
+              -- , ghc     -- # depends on ghc library
+              -- , runGhc  -- # depends on ghc library
               , ghcBoot
               , ghcBootTh
               , ghcHeap
               , ghci
---            , ghcPkg  # executable
---            , haddock # depends on ghc library
---            , hsc2hs  # executable
+              , ghcPkg  -- # executable
+              -- , haddock -- # depends on ghc library
+              , hsc2hs  -- # executable
               , hpc
---            , hpcBin  # executable
+              , hpcBin  -- # executable
               , mtl
               , parsec
               , time
@@ -172,7 +169,7 @@ toolTargets = [ binary
               , text
               , terminfo
               , transformers
---            , unlit  # executable
+              , unlit  -- # executable
               ] ++ if windowsHost then [ win32 ] else [ unix ]
 
 -- | Create a mapping from files to which component it belongs to.


=====================================
hadrian/src/Settings/Builders/Ghc.hs
=====================================
@@ -13,6 +13,7 @@ import qualified Context as Context
 import Rules.Libffi (libffiName)
 import qualified Data.Set as Set
 import System.Directory
+import Data.Version.Extra
 
 ghcBuilderArgs :: Args
 ghcBuilderArgs = mconcat
@@ -245,12 +246,15 @@ wayGhcArgs = do
 packageGhcArgs :: Args
 packageGhcArgs = do
     package <- getPackage
+    ghc_ver <- readVersion <$> (expr . ghcVersionStage =<< getStage)
     pkgId   <- expr $ pkgIdentifier package
     mconcat [ arg "-hide-all-packages"
             , arg "-no-user-package-db"
             , arg "-package-env -"
             , packageDatabaseArgs
-            , libraryPackage ? arg ("-this-unit-id " ++ pkgId)
+            -- We want to pass -this-unit-id for executables as well for multi-repl to
+            -- work with executable packages but this is buggy on GHC-9.0.2
+            , (isLibrary package || (ghc_ver >= makeVersion [9,2,1])) ?  arg ("-this-unit-id " ++ pkgId)
             , map ("-package-id " ++) <$> getContextData depIds ]
 
 includeGhcArgs :: Args



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a76f915ed981bfeef2ec4c8f5dced21d41edebd2...9b7fd2df8c392340902ead4439b6561020b69480

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a76f915ed981bfeef2ec4c8f5dced21d41edebd2...9b7fd2df8c392340902ead4439b6561020b69480
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/20220822/416e189c/attachment-0001.html>


More information about the ghc-commits mailing list