[commit: ghc] master: Make $1 in $1_$2_$3_FOO actually be directory. (73a6265)

git at git.haskell.org git at git.haskell.org
Tue Jun 23 17:59:06 UTC 2015


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

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

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

commit 73a6265e040fdbb2c9e75337663aa6879e20e233
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date:   Sat Jun 20 16:32:56 2015 -0700

    Make $1 in $1_$2_$3_FOO actually be directory.
    
    Summary:
    Previously, we used $1_$2_PACKAGE_KEY to parametrize $1.  But the
    documentation says that $1 should be the directory...  and we're now
    putting the libraries in $1_$2_LIB_NAME.  So use /that/.  This is just
    alpha-renaming, so as long as we're consistent, there's no material
    difference.)
    
    I also fixed a bug of a package ID calculation which I missed first
    time around, which was tickled by this change.
    
    BTW, this means DEP_KEYS and TRANSITIVE_DEP_KEYS are unused, so
    remove them from ghc-cabal.
    
    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/D1010


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

73a6265e040fdbb2c9e75337663aa6879e20e233
 rules/build-package-way.mk |  8 ++++----
 rules/build-package.mk     |  2 +-
 rules/build-prog.mk        |  2 +-
 utils/ghc-cabal/Main.hs    | 10 ++++++----
 4 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/rules/build-package-way.mk b/rules/build-package-way.mk
index cb8440d..c179159 100644
--- a/rules/build-package-way.mk
+++ b/rules/build-package-way.mk
@@ -25,7 +25,7 @@ $(call hs-objs,$1,$2,$3)
 # the second is indexed by the package id, distdir and way
 $1_$2_$3_LIB_FILE = libHS$$($1_$2_LIB_NAME)$$($3_libsuf)
 $1_$2_$3_LIB = $1/$2/build/$$($1_$2_$3_LIB_FILE)
-$$($1_$2_PACKAGE_KEY)_$2_$3_LIB = $$($1_$2_$3_LIB)
+$$($1_$2_LIB_NAME)_$2_$3_LIB = $$($1_$2_$3_LIB)
 
 ifeq "$$(HostOS_CPP)" "mingw32"
 ifneq "$$($1_$2_dll0_HS_OBJS)" ""
@@ -42,7 +42,7 @@ endif
 # Really we should use a consistent scheme for distdirs, but in the
 # meantime we work around it by defining ghc-<ver>_dist-install_way_LIB:
 ifeq "$$($1_PACKAGE) $2" "ghc stage2"
-$$($1_$2_PACKAGE_KEY)_dist-install_$3_LIB = $$($1_$2_$3_LIB)
+$$($1_$2_LIB_NAME)_dist-install_$3_LIB = $$($1_$2_$3_LIB)
 endif
 
 # All the .a/.so library file dependencies for this library.
@@ -50,8 +50,8 @@ endif
 # The $(subst stage2,dist-install,..) is needed due to Note
 # [inconsistent distdirs].
 #
-# NB: Use DEP_KEYS, since DEPS only contains package IDs
-$1_$2_$3_DEPS_LIBS=$$(foreach dep,$$($1_$2_DEP_KEYS),$$($$(dep)_$(subst stage2,dist-install,$2)_$3_LIB))
+# NB: Use DEP_LIB_NAMES for the /directory/ parameter.
+$1_$2_$3_DEPS_LIBS=$$(foreach dep,$$($1_$2_DEP_LIB_NAMES),$$($$(dep)_$(subst stage2,dist-install,$2)_$3_LIB))
 
 $1_$2_$3_NON_HS_OBJS = $$($1_$2_$3_CMM_OBJS) $$($1_$2_$3_C_OBJS)  $$($1_$2_$3_S_OBJS) $$($1_$2_EXTRA_OBJS)
 $1_$2_$3_ALL_OBJS = $$($1_$2_$3_HS_OBJS) $$($1_$2_$3_NON_HS_OBJS)
diff --git a/rules/build-package.mk b/rules/build-package.mk
index 34997cc..f05f230 100644
--- a/rules/build-package.mk
+++ b/rules/build-package.mk
@@ -133,7 +133,7 @@ $$(foreach way,$$($1_$2_WAYS),$$(eval \
 # If dyn libs are not being built then $$($1_$2_dyn_LIB) will just
 # expand to the empty string, and be ignored.
 $1_$2_PROGRAM_DEP_LIB = $$($1_$2_v_LIB) $$($1_$2_dyn_LIB)
-$$($1_PACKAGE)-$$($1_$2_VERSION)_$2_PROGRAM_DEP_LIB = $$($1_$2_PROGRAM_DEP_LIB)
+$$($1_$2_LIB_NAME)_$2_PROGRAM_DEP_LIB = $$($1_$2_PROGRAM_DEP_LIB)
 
 # C and S files are possibly built the "dyn" way.
 ifeq "$$(BuildSharedLibs)" "YES"
diff --git a/rules/build-prog.mk b/rules/build-prog.mk
index eca3358..1029fdd 100644
--- a/rules/build-prog.mk
+++ b/rules/build-prog.mk
@@ -189,7 +189,7 @@ ifneq "$$(BINDIST)" "YES"
 # The quadrupled $'s here are because the _<way>_LIB variables aren't
 # necessarily set when this part of the makefile is read
 $1/$2/build/tmp/$$($1_$2_PROG) $1/$2/build/tmp/$$($1_$2_PROG).dll : \
-    $$(foreach dep,$$($1_$2_DEPS),\
+    $$(foreach dep,$$($1_$2_DEP_LIB_NAMES),\
         $$(if $$(filter ghc%,$$(dep)),\
             $(if $(filter 0,$3),$$(compiler_stage1_PROGRAM_DEP_LIB),\
             $(if $(filter 1,$3),$$(compiler_stage2_PROGRAM_DEP_LIB),\
diff --git a/utils/ghc-cabal/Main.hs b/utils/ghc-cabal/Main.hs
index 77caf58..ed57fb8 100644
--- a/utils/ghc-cabal/Main.hs
+++ b/utils/ghc-cabal/Main.hs
@@ -402,11 +402,13 @@ generate directory distdir dll0Modules config_args
                            . fst)
                        . externalPackageDeps
                        $ lbi
-          dep_keys
+          dep_ipids = map (display . Installed.installedPackageId) dep_direct
+          depLibNames
             | packageKeySupported comp
-                   = map (display . Installed.packageKey) dep_direct
+                = map (\p -> packageKeyLibraryName
+                                (Installed.sourcePackageId p)
+                                (Installed.packageKey p)) 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
@@ -443,9 +445,9 @@ generate directory distdir dll0Modules config_args
                 variablePrefix ++ "_SYNOPSIS =" ++ synopsis pd,
                 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 ++ "_DEP_LIB_NAMES = " ++ unwords depLibNames,
                 variablePrefix ++ "_TRANSITIVE_DEPS = " ++ unwords transitiveDeps,
                 variablePrefix ++ "_TRANSITIVE_DEP_LIB_NAMES = " ++ unwords transitiveDepLibNames,
                 variablePrefix ++ "_TRANSITIVE_DEP_NAMES = " ++ unwords transitiveDepNames,



More information about the ghc-commits mailing list