summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-09-20 11:12:55 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-09-20 20:15:04 -0400
commitc8ae3add11969b5128f34d02a5582c1f007cce5c (patch)
tree26893c6d87f9d54d51c094e2de762e9a1d9e6f0a
parent854224ed32422f7a315a2480c129691ad40ca504 (diff)
downloadhaskell-c8ae3add11969b5128f34d02a5582c1f007cce5c.tar.gz
hadrian: Add extra_dependencies edges for all different ways
The hack to add extra dependencies needed by DeriveLift extension missed the cases for profiles and dynamic ways. For the profiled way this leads to errors like: ``` GHC error in desugarer lookup in Data.IntSet.Internal: Failed to load interface for ‘Language.Haskell.TH.Lib.Internal’ Perhaps you haven't installed the profiling libraries for package ‘template-haskell’? Use -v (or `:set -v` in ghci) to see a list of the files searched for. ghc: panic! (the 'impossible' happened) GHC version 9.5.20220916: initDs ``` Therefore the fix is to add these extra edges in. Fixes #22197
-rw-r--r--hadrian/src/Rules/Dependencies.hs12
1 files changed, 8 insertions, 4 deletions
diff --git a/hadrian/src/Rules/Dependencies.hs b/hadrian/src/Rules/Dependencies.hs
index dda176a64f..453c45acad 100644
--- a/hadrian/src/Rules/Dependencies.hs
+++ b/hadrian/src/Rules/Dependencies.hs
@@ -14,6 +14,7 @@ import Target
import Utilities
import Packages
import qualified Data.Map as M
+import qualified Data.Set as S
import qualified Text.Parsec as Parsec
@@ -22,7 +23,7 @@ import qualified Text.Parsec as Parsec
-- until it does we need to add this dependency ourselves.
extra_dependencies :: M.Map Package (Stage -> Action [(FilePath, FilePath)])
extra_dependencies =
- M.fromList [(containers, fmap sequence (sequence
+ M.fromList [(containers, fmap (fmap concat . sequence) (sequence
[dep (containers, "Data.IntSet.Internal") th_internal
,dep (containers, "Data.Set.Internal") th_internal
,dep (containers, "Data.Sequence.Internal") th_internal
@@ -32,9 +33,12 @@ extra_dependencies =
where
th_internal = (templateHaskell, "Language.Haskell.TH.Lib.Internal")
- dep (p1, m1) (p2, m2) s = (,) <$> path s p1 m1 <*> path s p2 m2
- path stage p m =
- let context = Context stage p vanilla Inplace
+ dep (p1, m1) (p2, m2) s = do
+ let context = Context s p1 (error "extra_dependencies: way not set") (error "extra_dependencies: iplace not set")
+ ways <- interpretInContext context getLibraryWays
+ mapM (\way -> (,) <$> path s way p1 m1 <*> path s way p2 m2) (S.toList ways)
+ path stage way p m =
+ let context = Context stage p way Inplace
in objectPath context . moduleSource $ m
formatExtra :: (FilePath, FilePath) -> String