summaryrefslogtreecommitdiff
path: root/compiler/main
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2017-03-02 16:27:32 -0500
committerBen Gamari <ben@smart-cactus.org>2017-03-02 19:58:01 -0500
commit0b922909121f6a812d2861a29d0d0d3c7e2fcfce (patch)
treed971f683eaeb3da2d16025c849637565320940b6 /compiler/main
parenta6874e546294173c166859769dd8054887a6ded7 (diff)
downloadhaskell-0b922909121f6a812d2861a29d0d0d3c7e2fcfce.tar.gz
Print out sub-libraries of packages more nicely.
Previously, we would print out the munged package name which looked like z-bkpcabal01-z-p-0.1.0.0. Now it looks like: bkpcabal01-0.1.0.0:p. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, bgamari, austin Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3235
Diffstat (limited to 'compiler/main')
-rw-r--r--compiler/main/Packages.hs13
1 files changed, 10 insertions, 3 deletions
diff --git a/compiler/main/Packages.hs b/compiler/main/Packages.hs
index 06678317e7..cb350d7f36 100644
--- a/compiler/main/Packages.hs
+++ b/compiler/main/Packages.hs
@@ -97,6 +97,7 @@ import qualified Data.Semigroup as Semigroup
import qualified Data.Map as Map
import qualified Data.Map.Strict as MapStrict
import qualified Data.Set as Set
+import Data.Version
-- ---------------------------------------------------------------------------
-- The Package state
@@ -1857,9 +1858,15 @@ missingDependencyMsg (Just parent)
-- -----------------------------------------------------------------------------
componentIdString :: DynFlags -> ComponentId -> Maybe String
-componentIdString dflags cid =
- fmap sourcePackageIdString (lookupInstalledPackage dflags
- (componentIdToInstalledUnitId cid))
+componentIdString dflags cid = do
+ conf <- lookupInstalledPackage dflags (componentIdToInstalledUnitId cid)
+ return $
+ case libName conf of
+ Nothing -> sourcePackageIdString conf
+ Just (PackageName libname) ->
+ packageNameString conf
+ ++ "-" ++ showVersion (packageVersion conf)
+ ++ ":" ++ unpackFS libname
displayInstalledUnitId :: DynFlags -> InstalledUnitId -> Maybe String
displayInstalledUnitId dflags uid =