summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-09-27 17:01:21 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-10-19 03:30:16 -0400
commitd25868b6dc4e4bfaf6977ef4173b7f5494e68f13 (patch)
tree930e965d4b495c234108a3a15b4ed04209e44fcd
parent3035d1a2f28fcd26e85f22fb17ca2c9f30f8920a (diff)
downloadhaskell-d25868b6dc4e4bfaf6977ef4173b7f5494e68f13.tar.gz
dynamic-too: Expand GHC.Iface.Recomp comment about the backpack hack
-rw-r--r--compiler/GHC/Iface/Recomp.hs15
1 files changed, 11 insertions, 4 deletions
diff --git a/compiler/GHC/Iface/Recomp.hs b/compiler/GHC/Iface/Recomp.hs
index f74012c0ac..f71d9f812e 100644
--- a/compiler/GHC/Iface/Recomp.hs
+++ b/compiler/GHC/Iface/Recomp.hs
@@ -1541,10 +1541,17 @@ mkHashFun hsc_env eps name
-- Kind of a heinous hack.
initIfaceLoad hsc_env . withException ctx
$ withoutDynamicNow
- -- For some unknown reason, we need to reset the
- -- dynamicNow bit, otherwise only dynamic
- -- interfaces are looked up and some tests fail
- -- (e.g. T16219).
+ -- If you try and load interfaces when dynamic-too
+ -- enabled then it attempts to load the dyn_hi and hi
+ -- interface files. Backpack doesn't really care about
+ -- dynamic object files as it isn't doing any code
+ -- generation so -dynamic-too is turned off.
+ -- Some tests fail without doing this (such as T16219),
+ -- but they fail because dyn_hi files are not found for
+ -- one of the dependencies (because they are deliberately turned off)
+ -- Why is this check turned off here? That is unclear but
+ -- just one of the many horrible hacks in the backpack
+ -- implementation.
$ loadInterface (text "lookupVers2") mod ImportBySystem
return $ snd (mi_hash_fn (mi_final_exts iface) occ `orElse`
pprPanic "lookupVers1" (ppr mod <+> ppr occ))