summaryrefslogtreecommitdiff
path: root/utils/ghc-cabal/Main.hs
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2015-06-20 15:35:28 -0700
committerEdward Z. Yang <ezyang@cs.stanford.edu>2015-06-22 10:32:27 -0700
commitf70fb6892f5fd32e6161e951aa3e804148afd2fe (patch)
tree3a7e377e1a1d7c71d31b1022f5e2da5961a1cc12 /utils/ghc-cabal/Main.hs
parente60dbf30adfcc0ba90ed9271239c0c8a7bc14f06 (diff)
downloadhaskell-f70fb6892f5fd32e6161e951aa3e804148afd2fe.tar.gz
Use -package-id to specify libraries on command line.
Summary: There's not really any good reason to use -package-key over -package-id, so use the latter as standard practice. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: austin Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1000
Diffstat (limited to 'utils/ghc-cabal/Main.hs')
-rw-r--r--utils/ghc-cabal/Main.hs17
1 files changed, 9 insertions, 8 deletions
diff --git a/utils/ghc-cabal/Main.hs b/utils/ghc-cabal/Main.hs
index 3c049fedf1..6302349a2a 100644
--- a/utils/ghc-cabal/Main.hs
+++ b/utils/ghc-cabal/Main.hs
@@ -396,17 +396,17 @@ 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.lookupInstalledPackageId
+ (installedPkgs lbi)
+ . fst)
+ . externalPackageDeps
+ $ lbi
dep_keys
| packageKeySupported comp
- = map (display
- . Installed.packageKey
- . fromMaybe (error "ghc-cabal: dep_keys failed")
- . PackageIndex.lookupInstalledPackageId
- (installedPkgs lbi)
- . fst)
- . externalPackageDeps
- $ lbi
+ = map (display . Installed.packageKey) dep_direct
| otherwise = deps
+ dep_ipids = map (display . Installed.installedPackageId) dep_direct
depNames = map (display . packageName) dep_ids
transitive_dep_ids = map Installed.sourcePackageId dep_pkgs
@@ -448,6 +448,7 @@ generate directory distdir dll0Modules config_args
variablePrefix ++ "_HS_SRC_DIRS = " ++ unwords (hsSourceDirs bi),
variablePrefix ++ "_DEPS = " ++ unwords deps,
variablePrefix ++ "_DEP_KEYS = " ++ unwords dep_keys,
+ variablePrefix ++ "_DEP_IPIDS = " ++ unwords dep_ipids,
variablePrefix ++ "_DEP_NAMES = " ++ unwords depNames,
variablePrefix ++ "_TRANSITIVE_DEPS = " ++ unwords transitiveDeps,
variablePrefix ++ "_TRANSITIVE_DEP_KEYS = " ++ unwords transitiveDepKeys,