Commit 10a2ba90 authored by Sylvain Henry's avatar Sylvain Henry Committed by Marge Bot

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
parent 2cfc4ab9
......@@ -307,20 +307,20 @@ buildUnit session cid insts lunit = do
let compat_fs = (case cid of ComponentId fs _ -> fs)
compat_pn = PackageName compat_fs
return InstalledPackageInfo {
return GenericUnitInfo {
-- Stub data
abiHash = "",
sourcePackageId = SourcePackageId compat_fs,
packageName = compat_pn,
packageVersion = makeVersion [0],
unitAbiHash = "",
unitPackageId = PackageId compat_fs,
unitPackageName = compat_pn,
unitPackageVersion = makeVersion [0],
unitId = toInstalledUnitId (thisPackage dflags),
sourceLibName = Nothing,
componentId = cid,
instantiatedWith = insts,
unitComponentName = Nothing,
unitInstanceOf = cid,
unitInstantiations = insts,
-- Slight inefficiency here haha
exposedModules = map (\(m,n) -> (m,Just n)) mods,
hiddenModules = [], -- TODO: doc only
depends = case session of
unitExposedModules = map (\(m,n) -> (m,Just n)) mods,
unitHiddenModules = [], -- TODO: doc only
unitDepends = case session of
-- Technically, we should state that we depend
-- on all the indefinite libraries we used to
-- typecheck this. However, this field isn't
......@@ -331,29 +331,29 @@ buildUnit session cid insts lunit = do
$ deps ++ [ moduleUnitId mod
| (_, mod) <- insts
, not (isHoleModule mod) ],
abiDepends = [],
ldOptions = case session of
TcSession -> []
_ -> obj_files,
importDirs = [ hi_dir ],
exposed = False,
indefinite = case session of
TcSession -> True
_ -> False,
unitAbiDepends = [],
unitLinkerOptions = case session of
TcSession -> []
_ -> obj_files,
unitImportDirs = [ hi_dir ],
unitIsExposed = False,
unitIsIndefinite = case session of
TcSession -> True
_ -> False,
-- nope
hsLibraries = [],
extraLibraries = [],
extraGHCiLibraries = [],
libraryDynDirs = [],
libraryDirs = [],
frameworks = [],
frameworkDirs = [],
ccOptions = [],
includes = [],
includeDirs = [],
haddockInterfaces = [],
haddockHTMLs = [],
trusted = False
unitLibraries = [],
unitExtDepLibsSys = [],
unitExtDepLibsGhc = [],
unitLibraryDynDirs = [],
unitLibraryDirs = [],
unitExtDepFrameworks = [],
unitExtDepFrameworkDirs = [],
unitCcOptions = [],
unitIncludes = [],
unitIncludeDirs = [],
unitHaddockInterfaces = [],
unitHaddockHTMLs = [],
unitIsTrusted = False
}
......
......@@ -135,7 +135,7 @@ outputC dflags filenm cmm_stream packages
--
let rts = getPackageDetails dflags rtsUnitId
let cc_injects = unlines (map mk_include (includes rts))
let cc_injects = unlines (map mk_include (unitIncludes rts))
mk_include h_file =
case h_file of
'"':_{-"-} -> "#include "++h_file
......@@ -226,7 +226,7 @@ outputForeignStubs dflags mod location stubs
-- we need the #includes from the rts package for the stub files
let rts_includes =
let rts_pkg = getPackageDetails dflags rtsUnitId in
concatMap mk_include (includes rts_pkg)
concatMap mk_include (unitIncludes rts_pkg)
mk_include i = "#include \"" ++ i ++ "\"\n"
-- wrapper code mentions the ffi_arg type, which comes from ffi.h
......
......@@ -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
......
......@@ -1192,7 +1192,7 @@ hscCheckSafe' m l = do
packageTrusted _ Sf_SafeInferred False _ = True
packageTrusted dflags _ _ m
| isHomePkg dflags m = True
| otherwise = trusted $ getPackageDetails dflags (moduleUnitId m)
| otherwise = unitIsTrusted $ getPackageDetails dflags (moduleUnitId m)
lookup' :: Module -> Hsc (Maybe ModIface)
lookup' m = do
......@@ -1221,7 +1221,7 @@ checkPkgTrust pkgs = do
dflags <- getDynFlags
let errors = S.foldr go [] pkgs
go pkg acc
| trusted $ getInstalledPackageDetails (pkgState dflags) pkg
| unitIsTrusted $ getInstalledPackageDetails (pkgState dflags) pkg
= acc
| otherwise
= (:acc) $ mkErrMsg dflags noSrcSpan (pkgQual dflags)
......
......@@ -343,8 +343,8 @@ warnUnusedPackages = do
matchingStr :: String -> UnitInfo -> Bool
matchingStr str p
= str == sourcePackageIdString p
|| str == packageNameString p
= str == unitPackageIdString p
|| str == unitPackageNameString p
matching :: DynFlags -> PackageArg -> UnitInfo -> Bool
matching _ (PackageArg str) p = matchingStr str p
......
This diff is collapsed.
......@@ -2066,8 +2066,8 @@ generatePackageVersionMacros pkgs = concat
-- Do not add any C-style comments. See #3389.
[ generateMacros "" pkgname version
| pkg <- pkgs
, let version = packageVersion pkg
pkgname = map fixchar (packageNameString pkg)
, let version = unitPackageVersion pkg
pkgname = map fixchar (unitPackageNameString pkg)
]
fixchar :: Char -> Char
......
......@@ -2038,7 +2038,7 @@ mkQualPackage dflags uid
= False
| otherwise
= True
where mb_pkgid = fmap sourcePackageId (lookupUnit dflags uid)
where mb_pkgid = fmap unitPackageId (lookupUnit dflags uid)
-- | A function which only qualifies package names if necessary; but
-- qualifies all other identifiers.
......
......@@ -1260,7 +1260,7 @@ linkPackages' hsc_env new_pks pls = do
| Just pkg_cfg <- lookupInstalledPackage pkgstate new_pkg
= do { -- Link dependents first
pkgs' <- link pkgs (depends pkg_cfg)
pkgs' <- link pkgs (unitDepends pkg_cfg)
-- Now link the package itself
; linkPackage hsc_env pkg_cfg
; return (new_pkg : pkgs') }
......@@ -1275,12 +1275,12 @@ linkPackage hsc_env pkg
let dflags = hsc_dflags hsc_env
platform = targetPlatform dflags
is_dyn = interpreterDynamic (hscInterp hsc_env)
dirs | is_dyn = Packages.libraryDynDirs pkg
| otherwise = Packages.libraryDirs pkg
dirs | is_dyn = Packages.unitLibraryDynDirs pkg
| otherwise = Packages.unitLibraryDirs pkg
let hs_libs = Packages.hsLibraries pkg
let hs_libs = Packages.unitLibraries pkg
-- The FFI GHCi import lib isn't needed as
-- compiler/ghci/Linker.hs + rts/Linker.c link the
-- GHC.Runtime.Linker + rts/Linker.c link the
-- interpreted references to FFI to the compiled FFI.
-- We therefore filter it out so that we don't get
-- duplicate symbol errors.
......@@ -1294,10 +1294,10 @@ linkPackage hsc_env pkg
-- package file provides an "extra-ghci-libraries" field then we use
-- that instead of the "extra-libraries" field.
extra_libs =
(if null (Packages.extraGHCiLibraries pkg)
then Packages.extraLibraries pkg
else Packages.extraGHCiLibraries pkg)
++ [ lib | '-':'l':lib <- Packages.ldOptions pkg ]
(if null (Packages.unitExtDepLibsGhc pkg)
then Packages.unitExtDepLibsSys pkg
else Packages.unitExtDepLibsGhc pkg)
++ [ lib | '-':'l':lib <- Packages.unitLinkerOptions pkg ]
-- See Note [Fork/Exec Windows]
gcc_paths <- getGCCPaths dflags (platformOS platform)
dirs_env <- addEnvPaths "LIBRARY_PATH" dirs
......@@ -1322,10 +1322,10 @@ linkPackage hsc_env pkg
pathCache <- mapM (addLibrarySearchPath hsc_env) all_paths_env
maybePutStr dflags
("Loading package " ++ sourcePackageIdString pkg ++ " ... ")
("Loading package " ++ unitPackageIdString pkg ++ " ... ")
-- See comments with partOfGHCi
when (packageName pkg `notElem` partOfGHCi) $ do
when (unitPackageName pkg `notElem` partOfGHCi) $ do
loadFrameworks hsc_env platform pkg
-- See Note [Crash early load_dyn and locateLib]
-- Crash early if can't load any of `known_dlls`
......@@ -1352,7 +1352,7 @@ linkPackage hsc_env pkg
if succeeded ok
then maybePutStrLn dflags "done."
else let errmsg = "unable to load package `"
++ sourcePackageIdString pkg ++ "'"
++ unitPackageIdString pkg ++ "'"
in throwGhcExceptionIO (InstallationError errmsg)
{-
......@@ -1426,8 +1426,8 @@ loadFrameworks :: HscEnv -> Platform -> UnitInfo -> IO ()
loadFrameworks hsc_env platform pkg
= when (platformUsesFrameworks platform) $ mapM_ load frameworks
where
fw_dirs = Packages.frameworkDirs pkg
frameworks = Packages.frameworks pkg
fw_dirs = Packages.unitExtDepFrameworkDirs pkg
frameworks = Packages.unitExtDepFrameworks pkg
load fw = do r <- loadFramework hsc_env fw_dirs fw
case r of
......
......@@ -55,7 +55,7 @@ mkExtraObj dflags extn xs
-- set of include directories and PIC flags.
cOpts = map Option (picCCOpts dflags)
++ map (FileOption "-I")
(includeDirs $ getPackageDetails dflags rtsUnitId)
(unitIncludeDirs $ getPackageDetails dflags rtsUnitId)
-- When compiling assembler code, we drop the usual C options, and if the
-- compiler is Clang, we add an extra argument to tell Clang to ignore
......
......@@ -572,7 +572,7 @@ mergeSignatures
isFromSignaturePackage =
let inst_uid = fst (splitUnitIdInsts (IndefiniteUnitId iuid))
pkg = getInstalledPackageDetails pkgstate inst_uid
in null (exposedModules pkg)
in null (unitExposedModules pkg)
-- 3(a). Rename the exports according to how the dependency
-- was instantiated. The resulting export list will be accurate
-- except for exports *from the signature itself* (which may
......
......@@ -17,14 +17,14 @@ module GHC.Unit.Info (
-- * The UnitInfo type: information about a unit
UnitInfo,
InstalledPackageInfo(..),
GenericUnitInfo(..),
ComponentId(..),
SourcePackageId(..),
PackageId(..),
PackageName(..),
Version(..),
defaultUnitInfo,
sourcePackageIdString,
packageNameString,
unitPackageNameString,
unitPackageIdString,
pprUnitInfo,
) where
......@@ -41,12 +41,12 @@ import GHC.Types.Module as Module
import GHC.Types.Unique
-- -----------------------------------------------------------------------------
-- Our UnitInfo type is the InstalledPackageInfo from ghc-boot,
-- Our UnitInfo type is the GenericUnitInfo from ghc-boot,
-- which is similar to a subset of the InstalledPackageInfo type from Cabal.
type UnitInfo = InstalledPackageInfo
type UnitInfo = GenericUnitInfo
ComponentId
SourcePackageId
PackageId
PackageName
Module.InstalledUnitId
Module.UnitId
......@@ -57,70 +57,70 @@ type UnitInfo = InstalledPackageInfo
-- feature, but ghc doesn't currently have convenient support for any
-- other compact string types, e.g. plain ByteString or Text.
newtype SourcePackageId = SourcePackageId FastString deriving (Eq, Ord)
newtype PackageId = PackageId FastString deriving (Eq, Ord)
newtype PackageName = PackageName
{ unPackageName :: FastString
}
deriving (Eq, Ord)
instance BinaryStringRep SourcePackageId where
fromStringRep = SourcePackageId . mkFastStringByteString
toStringRep (SourcePackageId s) = bytesFS s
instance BinaryStringRep PackageId where
fromStringRep = PackageId . mkFastStringByteString
toStringRep (PackageId s) = bytesFS s
instance BinaryStringRep PackageName where
fromStringRep = PackageName . mkFastStringByteString
toStringRep (PackageName s) = bytesFS s
instance Uniquable SourcePackageId where
getUnique (SourcePackageId n) = getUnique n
instance Uniquable PackageId where
getUnique (PackageId n) = getUnique n
instance Uniquable PackageName where
getUnique (PackageName n) = getUnique n
instance Outputable SourcePackageId where
ppr (SourcePackageId str) = ftext str
instance Outputable PackageId where
ppr (PackageId str) = ftext str
instance Outputable PackageName where
ppr (PackageName str) = ftext str
defaultUnitInfo :: UnitInfo
defaultUnitInfo = emptyInstalledPackageInfo
defaultUnitInfo = emptyGenericUnitInfo
sourcePackageIdString :: UnitInfo -> String
sourcePackageIdString pkg = unpackFS str
unitPackageIdString :: UnitInfo -> String
unitPackageIdString pkg = unpackFS str
where
SourcePackageId str = sourcePackageId pkg
PackageId str = unitPackageId pkg
packageNameString :: UnitInfo -> String
packageNameString pkg = unpackFS str
unitPackageNameString :: UnitInfo -> String
unitPackageNameString pkg = unpackFS str
where
PackageName str = packageName pkg
PackageName str = unitPackageName pkg
pprUnitInfo :: UnitInfo -> SDoc
pprUnitInfo InstalledPackageInfo {..} =
pprUnitInfo GenericUnitInfo {..} =
vcat [
field "name" (ppr packageName),
field "version" (text (showVersion packageVersion)),
field "name" (ppr unitPackageName),
field "version" (text (showVersion unitPackageVersion)),
field "id" (ppr unitId),
field "exposed" (ppr exposed),
field "exposed-modules" (ppr exposedModules),
field "hidden-modules" (fsep (map ppr hiddenModules)),
field "trusted" (ppr trusted),
field "import-dirs" (fsep (map text importDirs)),
field "library-dirs" (fsep (map text libraryDirs)),
field "dynamic-library-dirs" (fsep (map text libraryDynDirs)),
field "hs-libraries" (fsep (map text hsLibraries)),
field "extra-libraries" (fsep (map text extraLibraries)),
field "extra-ghci-libraries" (fsep (map text extraGHCiLibraries)),
field "include-dirs" (fsep (map text includeDirs)),
field "includes" (fsep (map text includes)),
field "depends" (fsep (map ppr depends)),
field "cc-options" (fsep (map text ccOptions)),
field "ld-options" (fsep (map text ldOptions)),
field "framework-dirs" (fsep (map text frameworkDirs)),
field "frameworks" (fsep (map text frameworks)),
field "haddock-interfaces" (fsep (map text haddockInterfaces)),
field "haddock-html" (fsep (map text haddockHTMLs))
field "exposed" (ppr unitIsExposed),
field "exposed-modules" (ppr unitExposedModules),
field "hidden-modules" (fsep (map ppr unitHiddenModules)),
field "trusted" (ppr unitIsTrusted),
field "import-dirs" (fsep (map text unitImportDirs)),
field "library-dirs" (fsep (map text unitLibraryDirs)),
field "dynamic-library-dirs" (fsep (map text unitLibraryDynDirs)),
field "hs-libraries" (fsep (map text unitLibraries)),
field "extra-libraries" (fsep (map text unitExtDepLibsSys)),
field "extra-ghci-libraries" (fsep (map text unitExtDepLibsGhc)),
field "include-dirs" (fsep (map text unitIncludeDirs)),
field "includes" (fsep (map text unitIncludes)),
field "depends" (fsep (map ppr unitDepends)),
field "cc-options" (fsep (map text unitCcOptions)),
field "ld-options" (fsep (map text unitLinkerOptions)),
field "framework-dirs" (fsep (map text unitExtDepFrameworkDirs)),
field "frameworks" (fsep (map text unitExtDepFrameworks)),
field "haddock-interfaces" (fsep (map text unitHaddockInterfaces)),
field "haddock-html" (fsep (map text unitHaddockHTMLs))
]
where
field name body = text name <> colon <+> nest 4 body
......@@ -142,13 +142,13 @@ installedUnitInfoId = unitId
packageConfigId :: UnitInfo -> UnitId
packageConfigId p =
if indefinite p
then newUnitId (componentId p) (instantiatedWith p)
if unitIsIndefinite p
then newUnitId (unitInstanceOf p) (unitInstantiations p)
else DefiniteUnitId (DefUnitId (unitId p))
expandedUnitInfoId :: UnitInfo -> UnitId
expandedUnitInfoId p =
newUnitId (componentId p) (instantiatedWith p)
newUnitId (unitInstanceOf p) (unitInstantiations p)
definiteUnitInfoId :: UnitInfo -> Maybe DefUnitId
definiteUnitInfoId p =
......
......@@ -57,7 +57,7 @@ import GHC.Driver.Types ( tyThingParent_maybe, handleFlagWarnings, getSafeMode,
hsc_dynLinker, hsc_interp )
import GHC.Types.Module
import GHC.Types.Name
import GHC.Driver.Packages ( trusted, getPackageDetails, getInstalledPackageDetails,
import GHC.Driver.Packages ( unitIsTrusted, getPackageDetails, getInstalledPackageDetails,
listVisibleModuleNames, pprFlag )
import GHC.Iface.Syntax ( showToHeader )
import GHC.Core.Ppr.TyThing
......@@ -2341,11 +2341,11 @@ isSafeModule m = do
packageTrusted dflags md
| thisPackage dflags == moduleUnitId md = True
| otherwise = trusted $ getPackageDetails dflags (moduleUnitId md)
| otherwise = unitIsTrusted $ getPackageDetails dflags (moduleUnitId md)
tallyPkgs dflags deps | not (packageTrustOn dflags) = (S.empty, S.empty)
| otherwise = S.partition part deps
where part pkg = trusted $ getInstalledPackageDetails pkgstate pkg
where part pkg = unitIsTrusted $ getInstalledPackageDetails pkgstate pkg
pkgstate = pkgState dflags
-----------------------------------------------------------------------------
......
This diff is collapsed.
......@@ -1272,7 +1272,7 @@ updateDBCache verbosity db db_stack = do
let definitelyBrokenPackages =
nub
. sort
. map (unPackageName . GhcPkg.packageName . fst)
. map (unPackageName . GhcPkg.unitPackageName . fst)
. filter snd
$ pkgsGhcCacheFormat
when (definitelyBrokenPackages /= []) $ do
......@@ -1306,7 +1306,7 @@ updateDBCache verbosity db db_stack = do
case packageDbLock db of
GhcPkg.DbOpenReadWrite lock -> GhcPkg.unlockPackageDb lock
type PackageCacheFormat = GhcPkg.InstalledPackageInfo
type PackageCacheFormat = GhcPkg.GenericUnitInfo
ComponentId
PackageIdentifier
PackageName
......@@ -1353,49 +1353,49 @@ recomputeValidAbiDeps :: [InstalledPackageInfo]
-> PackageCacheFormat
-> (PackageCacheFormat, Bool)
recomputeValidAbiDeps db pkg =
(pkg { GhcPkg.abiDepends = newAbiDeps }, abiDepsUpdated)
(pkg { GhcPkg.unitAbiDepends = newAbiDeps }, abiDepsUpdated)
where
newAbiDeps =
catMaybes . flip map (GhcPkg.abiDepends pkg) $ \(k, _) ->
catMaybes . flip map (GhcPkg.unitAbiDepends pkg) $ \(k, _) ->
case filter (\d -> installedUnitId d == k) db of
[x] -> Just (k, unAbiHash (abiHash x))
_ -> Nothing
abiDepsUpdated =
GhcPkg.abiDepends pkg /= newAbiDeps
GhcPkg.unitAbiDepends pkg /= newAbiDeps
convertPackageInfoToCacheFormat :: InstalledPackageInfo -> PackageCacheFormat
convertPackageInfoToCacheFormat pkg =
GhcPkg.InstalledPackageInfo {
GhcPkg.GenericUnitInfo {
GhcPkg.unitId = installedUnitId pkg,
GhcPkg.componentId = installedComponentId pkg,
GhcPkg.instantiatedWith = instantiatedWith pkg,
GhcPkg.sourcePackageId = sourcePackageId pkg,
GhcPkg.packageName = packageName pkg,
GhcPkg.packageVersion = Version.Version (versionNumbers (packageVersion pkg)) [],
GhcPkg.sourceLibName =
GhcPkg.unitInstanceOf = installedComponentId pkg,
GhcPkg.unitInstantiations = instantiatedWith pkg,
GhcPkg.unitPackageId = sourcePackageId pkg,
GhcPkg.unitPackageName = packageName pkg,
GhcPkg.unitPackageVersion = Version.Version (versionNumbers (packageVersion pkg)) [],
GhcPkg.unitComponentName =
fmap (mkPackageName . unUnqualComponentName) (libraryNameString $ sourceLibName pkg),
GhcPkg.depends = depends pkg,
GhcPkg.abiDepends = map (\(AbiDependency k v) -> (k,unAbiHash v)) (abiDepends pkg),
GhcPkg.abiHash = unAbiHash (abiHash pkg),
GhcPkg.importDirs = importDirs pkg,
GhcPkg.hsLibraries = hsLibraries pkg,
GhcPkg.extraLibraries = extraLibraries pkg,
GhcPkg.extraGHCiLibraries = extraGHCiLibraries pkg,
GhcPkg.libraryDirs = libraryDirs pkg,
GhcPkg.libraryDynDirs = libraryDynDirs pkg,
GhcPkg.frameworks = frameworks pkg,
GhcPkg.frameworkDirs = frameworkDirs pkg,
GhcPkg.ldOptions = ldOptions pkg,
GhcPkg.ccOptions = ccOptions pkg,
GhcPkg.includes = includes pkg,
GhcPkg.includeDirs = includeDirs pkg,
GhcPkg.haddockInterfaces = haddockInterfaces pkg,
GhcPkg.haddockHTMLs = haddockHTMLs pkg,
GhcPkg.exposedModules = map convertExposed (exposedModules pkg),
GhcPkg.hiddenModules = hiddenModules pkg,
GhcPkg.indefinite = indefinite pkg,
GhcPkg.exposed = exposed pkg,
GhcPkg.trusted = trusted pkg
GhcPkg.unitDepends = depends pkg,
GhcPkg.unitAbiDepends = map (\(AbiDependency k v) -> (k,unAbiHash v)) (abiDepends pkg),
GhcPkg.unitAbiHash = unAbiHash (abiHash pkg),
GhcPkg.unitImportDirs = importDirs pkg,
GhcPkg.unitLibraries = hsLibraries pkg,
GhcPkg.unitExtDepLibsSys = extraLibraries pkg,
GhcPkg.unitExtDepLibsGhc = extraGHCiLibraries pkg,
GhcPkg.unitLibraryDirs = libraryDirs pkg,
GhcPkg.unitLibraryDynDirs = libraryDynDirs pkg,
GhcPkg.unitExtDepFrameworks = frameworks pkg,
GhcPkg.unitExtDepFrameworkDirs = frameworkDirs pkg,
GhcPkg.unitLinkerOptions = ldOptions pkg,
GhcPkg.unitCcOptions = ccOptions pkg,
GhcPkg.unitIncludes = includes pkg,
GhcPkg.unitIncludeDirs = includeDirs pkg,
GhcPkg.unitHaddockInterfaces = haddockInterfaces pkg,
GhcPkg.unitHaddockHTMLs = haddockHTMLs pkg,
GhcPkg.unitExposedModules = map convertExposed (exposedModules pkg),
GhcPkg.unitHiddenModules = hiddenModules pkg,
GhcPkg.unitIsIndefinite = indefinite pkg,
GhcPkg.unitIsExposed = exposed pkg,
GhcPkg.unitIsTrusted = trusted pkg
}
where
convertExposed (ExposedModule n reexport) = (n, reexport)
......
Subproject commit 2d2587182568cc5aa4b29d401517337c32459c66
Subproject commit 75b9b6ebbe8326f3a2b099ab7f130960b4567618
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment