[commit: ghc] master: Use -package-id to specify libraries on command line. (f70fb68)

git at git.haskell.org git at git.haskell.org
Mon Jun 22 17:32:11 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/f70fb6892f5fd32e6161e951aa3e804148afd2fe/ghc

>---------------------------------------------------------------

commit f70fb6892f5fd32e6161e951aa3e804148afd2fe
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date:   Sat Jun 20 15:35:28 2015 -0700

    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 at cs.stanford.edu>
    
    Test Plan: validate
    
    Reviewers: austin
    
    Subscribers: thomie, bgamari
    
    Differential Revision: https://phabricator.haskell.org/D1000


>---------------------------------------------------------------

f70fb6892f5fd32e6161e951aa3e804148afd2fe
 rules/distdir-way-opts.mk |  7 +++----
 utils/ghc-cabal/Main.hs   | 17 +++++++++--------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/rules/distdir-way-opts.mk b/rules/distdir-way-opts.mk
index 8073093..7a4115c 100644
--- a/rules/distdir-way-opts.mk
+++ b/rules/distdir-way-opts.mk
@@ -87,13 +87,12 @@ $4_USE_PACKAGE_KEY=NO
 endif
 endif
 
-ifeq "$($4_USE_PACKAGE_KEY)" "NO"
 $1_$2_$4_DEP_OPTS = \
- $$(foreach pkg,$$($1_$2_DEPS),-package $$(pkg))
+ $$(foreach pkg,$$($1_$2_DEP_IPIDS),-package-id $$(pkg))
+
+ifeq "$($4_USE_PACKAGE_KEY)" "NO"
 $4_THIS_PACKAGE_KEY = -package-name
 else
-$1_$2_$4_DEP_OPTS = \
- $$(foreach pkg,$$($1_$2_DEP_KEYS),-package-key $$(pkg))
 $4_THIS_PACKAGE_KEY = -this-package-key
 endif
 
diff --git a/utils/ghc-cabal/Main.hs b/utils/ghc-cabal/Main.hs
index 3c049fe..6302349 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,



More information about the ghc-commits mailing list