summaryrefslogtreecommitdiff
path: root/ghc/Main.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-03-20 17:24:34 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-03-29 17:30:47 -0400
commite54500c12de051cb9695728d27c812e5160593ee (patch)
treece6108608acc6903985288084c9d6d15ae37607b /ghc/Main.hs
parentef9c608eba417c59fe45c9edd6a946c59f50b5d2 (diff)
downloadhaskell-e54500c12de051cb9695728d27c812e5160593ee.tar.gz
Store ComponentId details
As far as GHC is concerned, installed package components ("units") are identified by an opaque ComponentId string provided by Cabal. But we don't want to display it to users (as it contains a hash) so GHC queries the database to retrieve some infos about the original source package (name, version, component name). This patch caches these infos in the ComponentId itself so that we don't need to provide DynFlags (which contains installed package informations) to print a ComponentId. In the future we want GHC to support several independent package states (e.g. for plugins and for target code), hence we need to avoid implicitly querying a single global package state.
Diffstat (limited to 'ghc/Main.hs')
-rw-r--r--ghc/Main.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/ghc/Main.hs b/ghc/Main.hs
index 3cec5b6191..3552133891 100644
--- a/ghc/Main.hs
+++ b/ghc/Main.hs
@@ -865,9 +865,9 @@ dumpFastStringStats dflags = do
x `pcntOf` y = int ((x * 100) `quot` y) Outputable.<> char '%'
showPackages, dumpPackages, dumpPackagesSimple :: DynFlags -> IO ()
-showPackages dflags = putStrLn (showSDoc dflags (pprPackages dflags))
-dumpPackages dflags = putMsg dflags (pprPackages dflags)
-dumpPackagesSimple dflags = putMsg dflags (pprPackagesSimple dflags)
+showPackages dflags = putStrLn (showSDoc dflags (pprPackages (pkgState dflags)))
+dumpPackages dflags = putMsg dflags (pprPackages (pkgState dflags))
+dumpPackagesSimple dflags = putMsg dflags (pprPackagesSimple (pkgState dflags))
-- -----------------------------------------------------------------------------
-- Frontend plugin support