diff options
| author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2017-03-02 16:27:32 -0500 |
|---|---|---|
| committer | Ben Gamari <ben@smart-cactus.org> | 2017-03-02 19:58:01 -0500 |
| commit | 0b922909121f6a812d2861a29d0d0d3c7e2fcfce (patch) | |
| tree | d971f683eaeb3da2d16025c849637565320940b6 /compiler | |
| parent | a6874e546294173c166859769dd8054887a6ded7 (diff) | |
| download | haskell-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')
| -rw-r--r-- | compiler/backpack/DriverBkp.hs | 2 | ||||
| -rw-r--r-- | compiler/main/Packages.hs | 13 |
2 files changed, 12 insertions, 3 deletions
diff --git a/compiler/backpack/DriverBkp.hs b/compiler/backpack/DriverBkp.hs index 38b9d4fe5d..d85b80dbc2 100644 --- a/compiler/backpack/DriverBkp.hs +++ b/compiler/backpack/DriverBkp.hs @@ -308,6 +308,8 @@ buildUnit session cid insts lunit = do packageName = compat_pn, packageVersion = makeVersion [0], unitId = toInstalledUnitId (thisPackage dflags), + mungedPackageName = Nothing, + libName = Nothing, componentId = cid, instantiatedWith = insts, -- Slight inefficiency here haha 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 = |
