[commit: ghc] master: Make GHC install libraries to e.g. xhtml-3000.2.1-0ACfOp3hebWD9jGWE4v4Gh. (85d5397)

git at git.haskell.org git at git.haskell.org
Sat Jun 20 21:58:58 UTC 2015


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

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

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

commit 85d539754ac07286ef5fed714ad42451bd5a1d28
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date:   Thu May 28 17:11:12 2015 -0700

    Make GHC install libraries to e.g. xhtml-3000.2.1-0ACfOp3hebWD9jGWE4v4Gh.
    
    Summary:
    Previously, we'd install them to something like
    xhtml_0ACfOp3hebWD9jGWE4v4G which was fairly ugly; this
    commit changes the default install path to contain the full
    package name and version, as well as the package key.
    
    Needs a Cabal submodule update for the commit for install paths support
    "Add libname install-dirs variable, use it by default. Fixes #2437".
    It also contains some miscellaneous fixes for Cabal HEAD.
    
    Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>
    
    Test Plan: validate
    
    Reviewers: austin
    
    Subscribers: bgamari, thomie
    
    Trac Issues: #10479
    
    Differential Revision: https://phabricator.haskell.org/D922


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

85d539754ac07286ef5fed714ad42451bd5a1d28
 ghc.mk                            |  2 +-
 libraries/Cabal                   |  2 +-
 libraries/ghc-prim/ghc-prim.cabal |  3 +++
 rules/distdir-way-opts.mk         |  4 ++--
 utils/ghc-cabal/Main.hs           | 10 +++++++++-
 utils/ghc-pkg/Main.hs             |  2 +-
 6 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/ghc.mk b/ghc.mk
index 93da0cb..bee6abf 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -908,7 +908,7 @@ install_packages: rts/dist/package.conf.install
 	$(call INSTALL_DIR,"$(DESTDIR)$(topdir)/rts")
 	$(call installLibsTo, $(RTS_INSTALL_LIBS), "$(DESTDIR)$(topdir)/rts")
 	$(foreach p, $(INSTALL_DYNLIBS), \
-	    $(call installLibsTo, $(wildcard $p/dist-install/build/*.so $p/dist-install/build/*.dll $p/dist-install/build/*.dylib), "$(DESTDIR)$(topdir)/$($p_dist-install_PACKAGE_KEY)"))
+	    $(call installLibsTo, $(wildcard $p/dist-install/build/*.so $p/dist-install/build/*.dll $p/dist-install/build/*.dylib), "$(DESTDIR)$(topdir)/$($p_dist-install_LIB_NAME)"))
 	$(foreach p, $(INSTALL_PACKAGES),                             \
 	    $(call make-command,                                      \
 	           "$(ghc-cabal_INPLACE)" copy                        \
diff --git a/libraries/Cabal b/libraries/Cabal
index bda1ce6..9e9e437 160000
--- a/libraries/Cabal
+++ b/libraries/Cabal
@@ -1 +1 @@
-Subproject commit bda1ce6b757cdaca93f2eba4e1906a4658719537
+Subproject commit 9e9e4370bbca6af032794225fe5638124acf2d85
diff --git a/libraries/ghc-prim/ghc-prim.cabal b/libraries/ghc-prim/ghc-prim.cabal
index b9e74d1..58b6ee0 100644
--- a/libraries/ghc-prim/ghc-prim.cabal
+++ b/libraries/ghc-prim/ghc-prim.cabal
@@ -21,6 +21,9 @@ flag include-ghc-prim
     Description: Include GHC.Prim in exposed-modules
     default: False
 
+custom-setup
+    setup-depends: base >= 4 && < 5, Cabal >= 1.23
+
 Library
     default-language: Haskell2010
     other-extensions:
diff --git a/rules/distdir-way-opts.mk b/rules/distdir-way-opts.mk
index 99f7ce9..8073093 100644
--- a/rules/distdir-way-opts.mk
+++ b/rules/distdir-way-opts.mk
@@ -186,11 +186,11 @@ ifneq "$4" "0"
 ifeq "$$(TargetElf)" "YES"
 $1_$2_$3_GHC_LD_OPTS += \
     -fno-use-rpaths \
-    $$(foreach d,$$($1_$2_TRANSITIVE_DEP_KEYS),-optl-Wl$$(comma)-rpath -optl-Wl$$(comma)'$$$$ORIGIN/../$$d') -optl-Wl,-zorigin
+    $$(foreach d,$$($1_$2_TRANSITIVE_DEP_LIB_NAMES),-optl-Wl$$(comma)-rpath -optl-Wl$$(comma)'$$$$ORIGIN/../$$d') -optl-Wl,-zorigin
 else ifeq "$$(TargetOS_CPP)" "darwin"
 $1_$2_$3_GHC_LD_OPTS += \
     -fno-use-rpaths \
-    $$(foreach d,$$($1_$2_TRANSITIVE_DEP_KEYS),-optl-Wl$$(comma)-rpath -optl-Wl$$(comma)'@loader_path/../$$d')
+    $$(foreach d,$$($1_$2_TRANSITIVE_DEP_LIB_NAMES),-optl-Wl$$(comma)-rpath -optl-Wl$$(comma)'@loader_path/../$$d')
 endif
 endif
 endif
diff --git a/utils/ghc-cabal/Main.hs b/utils/ghc-cabal/Main.hs
index 4ae85ec..3c049fe 100644
--- a/utils/ghc-cabal/Main.hs
+++ b/utils/ghc-cabal/Main.hs
@@ -118,6 +118,7 @@ doCheck directory
           []   -> return ()
           errs -> mapM_ print errs >> exitWith (ExitFailure 1)
     where isFailure (PackageDistSuspicious {}) = False
+          isFailure (PackageDistSuspiciousWarn {}) = False
           isFailure _ = True
 
 runHsColour :: FilePath -> FilePath -> [String] -> IO ()
@@ -256,7 +257,7 @@ updateInstallDirTemplates relocatableBuild myPrefix myLibdir myDocdir idts
                           if relocatableBuild
                           then "$topdir"
                           else myLibdir,
-          libsubdir = toPathTemplate "$pkgkey",
+          libsubdir = toPathTemplate "$libname",
           docdir    = toPathTemplate $
                           if relocatableBuild
                           then "$topdir/../doc/html/libraries/$pkgid"
@@ -414,6 +415,12 @@ generate directory distdir dll0Modules config_args
             | packageKeySupported comp
                    = map (display . Installed.packageKey) dep_pkgs
             | otherwise = transitiveDeps
+          transitiveDepLibNames
+            | packageKeySupported comp
+                = map (\p -> packageKeyLibraryName
+                                (Installed.sourcePackageId p)
+                                (Installed.packageKey p)) dep_pkgs
+            | otherwise = transitiveDeps
           transitiveDepNames = map (display . packageName) transitive_dep_ids
 
           libraryDirs = forDeps Installed.libraryDirs
@@ -444,6 +451,7 @@ generate directory distdir dll0Modules config_args
                 variablePrefix ++ "_DEP_NAMES = " ++ unwords depNames,
                 variablePrefix ++ "_TRANSITIVE_DEPS = " ++ unwords transitiveDeps,
                 variablePrefix ++ "_TRANSITIVE_DEP_KEYS = " ++ unwords transitiveDepKeys,
+                variablePrefix ++ "_TRANSITIVE_DEP_LIB_NAMES = " ++ unwords transitiveDepLibNames,
                 variablePrefix ++ "_TRANSITIVE_DEP_NAMES = " ++ unwords transitiveDepNames,
                 variablePrefix ++ "_INCLUDE_DIRS = " ++ unwords (includeDirs bi),
                 variablePrefix ++ "_INCLUDES = " ++ unwords (includes bi),
diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs
index f3017a2..a83720b 100644
--- a/utils/ghc-pkg/Main.hs
+++ b/utils/ghc-pkg/Main.hs
@@ -19,7 +19,7 @@ import Distribution.ModuleName (ModuleName)
 import Distribution.InstalledPackageInfo as Cabal
 import Distribution.Compat.ReadP hiding (get)
 import Distribution.ParseUtils
-import Distribution.Package hiding (depends, installedPackageId)
+import Distribution.Package hiding (installedPackageId)
 import Distribution.Text
 import Distribution.Version
 import Distribution.Simple.Utils (fromUTF8, toUTF8)



More information about the ghc-commits mailing list