[Git][ghc/ghc][master] hadrian: Add extra_dependencies edges for all different ways
Marge Bot (@marge-bot)
gitlab at gitlab.haskell.org
Wed Sep 21 00:15:21 UTC 2022
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
c8ae3add by Matthew Pickering at 2022-09-20T20:15:04-04:00
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
- - - - -
1 changed file:
- hadrian/src/Rules/Dependencies.hs
Changes:
=====================================
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
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c8ae3add11969b5128f34d02a5582c1f007cce5c
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c8ae3add11969b5128f34d02a5582c1f007cce5c
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/20220920/10988879/attachment-0001.html>
More information about the ghc-commits
mailing list