diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2016-01-18 17:32:27 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-01-19 00:07:33 +0100 |
commit | 240ddd7c39536776e955e881d709bbb039b48513 (patch) | |
tree | b9686cb0e771a268b514a57dc8bec7e31601351c /utils/ghc-cabal | |
parent | b8abd852d3674cb485490d2b2e94906c06ee6e8f (diff) | |
download | haskell-240ddd7c39536776e955e881d709bbb039b48513.tar.gz |
Switch from -this-package-key to -this-unit-id.
A small cosmetic change, but we have to do a bit of work to
actually support it:
- Cabal submodule update, so that Cabal passes us
-this-unit-id when we ask for it. This includes
a Cabal renaming to be consistent with Unit ID, which
makes ghc-pkg a bit more scrutable.
- Build system is updated to use -this-unit-id rather than
-this-package-key, to avoid deprecation warnings. Needs
a version test so I resurrected the old test we had
(sorry rwbarton!)
- I've *undeprecated* -package-name, so that we are in the same
state as GHC 7.10, since the "correct" flag will have only
entered circulation in GHC 8.0.
- I removed -package-key. Since we didn't deprecate -package-id
I think this should not cause any problems for users; they
can just change their code to use -package-id.
- The package database is indexed by UNIT IDs, not component IDs.
I updated the naming here.
- I dropped the signatures field from ExposedModule; nothing
was using it, and instantiatedWith from the package database
field.
- ghc-pkg was updated to use unit ID nomenclature, I removed
the -package-key flags but I decided not to add any new flags
for now.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: austin, hvr, bgamari
Reviewed By: bgamari
Subscribers: 23Skidoo, thomie, erikd
Differential Revision: https://phabricator.haskell.org/D1780
Diffstat (limited to 'utils/ghc-cabal')
-rw-r--r-- | utils/ghc-cabal/Main.hs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/utils/ghc-cabal/Main.hs b/utils/ghc-cabal/Main.hs index 2c05da83a7..575f8f341a 100644 --- a/utils/ghc-cabal/Main.hs +++ b/utils/ghc-cabal/Main.hs @@ -313,12 +313,12 @@ generate directory distdir dll0Modules config_args -- generate inplace-pkg-config withLibLBI pd lbi $ \lib clbi -> do cwd <- getCurrentDirectory - let ipid = ComponentId (display (packageId pd)) + let ipid = mkUnitId (display (packageId pd)) let installedPkgInfo = inplaceInstalledPackageInfo cwd distdir - pd (Installed.AbiHash "") lib lbi clbi + pd (AbiHash "") lib lbi clbi final_ipi = mangleIPI directory distdir lbi $ installedPkgInfo { - Installed.installedComponentId = ipid, - Installed.compatPackageKey = ipid, + Installed.installedUnitId = ipid, + Installed.compatPackageKey = display (packageId pd), Installed.haddockHTMLs = [] } content = Installed.showInstalledPackageInfo final_ipi ++ "\n" @@ -369,12 +369,12 @@ generate directory distdir dll0Modules config_args dep_ids = map snd (externalPackageDeps lbi) deps = map display dep_ids dep_direct = map (fromMaybe (error "ghc-cabal: dep_keys failed") - . PackageIndex.lookupComponentId + . PackageIndex.lookupUnitId (installedPkgs lbi) . fst) . externalPackageDeps $ lbi - dep_ipids = map (display . Installed.installedComponentId) dep_direct + dep_ipids = map (display . Installed.installedUnitId) dep_direct depLibNames | packageKeySupported comp = dep_ipids | otherwise = deps @@ -406,7 +406,7 @@ generate directory distdir dll0Modules config_args allMods = mods ++ otherMods let xs = [variablePrefix ++ "_VERSION = " ++ display (pkgVersion (package pd)), -- TODO: move inside withLibLBI - variablePrefix ++ "_COMPONENT_ID = " ++ display (localCompatPackageKey lbi), + variablePrefix ++ "_COMPONENT_ID = " ++ localCompatPackageKey lbi, variablePrefix ++ "_MODULES = " ++ unwords mods, variablePrefix ++ "_HIDDEN_MODULES = " ++ unwords otherMods, variablePrefix ++ "_SYNOPSIS =" ++ (unwords $ lines $ synopsis pd), |