diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-03-27 10:49:16 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-04-30 01:56:56 -0400 |
commit | 10a2ba90aa6a788677104cc43318c66f46e2e2b0 (patch) | |
tree | 86f1cadd79243ef67a7f150c5f074e5aa2115ccf /compiler/GHC/Driver/Finder.hs | |
parent | 2cfc4ab9710c873a55e9a44aac9dacb06ecce36f (diff) | |
download | haskell-10a2ba90aa6a788677104cc43318c66f46e2e2b0.tar.gz |
Refactor UnitInfo
* Rename InstalledPackageInfo into GenericUnitInfo
The name InstalledPackageInfo is only kept for alleged backward
compatibility reason in Cabal. ghc-boot has its own stripped down copy
of this datatype but it doesn't need to keep the name. Internally we
already use type aliases (UnitInfo in GHC, PackageCacheFormat in
ghc-pkg).
* Rename UnitInfo fields: add "unit" prefix and fix misleading names
* Add comments on every UnitInfo field
* Rename SourcePackageId into PackageId
"Package" already indicates that it's a "source package". Installed
package components are called units.
Update Haddock submodule
Diffstat (limited to 'compiler/GHC/Driver/Finder.hs')
-rw-r--r-- | compiler/GHC/Driver/Finder.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/GHC/Driver/Finder.hs b/compiler/GHC/Driver/Finder.hs index 1118e764be..5eb00e6dd2 100644 --- a/compiler/GHC/Driver/Finder.hs +++ b/compiler/GHC/Driver/Finder.hs @@ -373,7 +373,7 @@ findPackageModule_ hsc_env mod pkg_conf = mk_hi_loc = mkHiOnlyModLocation dflags package_hisuf - import_dirs = importDirs pkg_conf + import_dirs = unitImportDirs pkg_conf -- we never look for a .hi-boot file in an external package; -- .hi-boot files only make sense for the home package. in @@ -725,11 +725,11 @@ cantFindErr cannot_find _ dflags mod_name find_result | gopt Opt_BuildingCabalPackage dflags = let pkg = expectJust "pkg_hidden" (lookupUnit dflags uid) in text "Perhaps you need to add" <+> - quotes (ppr (packageName pkg)) <+> + quotes (ppr (unitPackageName pkg)) <+> text "to the build-depends in your .cabal file." | Just pkg <- lookupUnit dflags uid = text "You can run" <+> - quotes (text ":set -package " <> ppr (packageName pkg)) <+> + quotes (text ":set -package " <> ppr (unitPackageName pkg)) <+> text "to expose it." $$ text "(Note: this unloads all the modules in the current scope.)" | otherwise = Outputable.empty @@ -810,9 +810,9 @@ cantFindInstalledErr cannot_find _ dflags mod_name find_result looks_like_srcpkgid :: InstalledUnitId -> SDoc looks_like_srcpkgid pk - -- Unsafely coerce a unit id FastString into a source package ID - -- FastString and see if it means anything. - | (pkg:pkgs) <- searchPackageId pkgstate (SourcePackageId (installedUnitIdFS pk)) + -- Unsafely coerce a unit id (i.e. an installed package component + -- identifier) into a PackageId and see if it means anything. + | (pkg:pkgs) <- searchPackageId pkgstate (PackageId (installedUnitIdFS pk)) = parens (text "This unit ID looks like the source package ID;" $$ text "the real unit ID is" <+> quotes (ftext (installedUnitIdFS (unitId pkg))) $$ (if null pkgs then Outputable.empty |