[commit: ghc] master: GHC doesn't have a way to ask for user-package-db, so Cabal reimplemented it. (7221ad7)

git at git.haskell.org git at git.haskell.org
Thu Dec 17 00:41:10 UTC 2015


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

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

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

commit 7221ad70daa363d77f60d96c3f6e1baa1d9bec81
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date:   Wed Dec 16 10:39:12 2015 -0800

    GHC doesn't have a way to ask for user-package-db, so Cabal reimplemented it.
    
    Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>
    
    Test Plan: docs only
    
    Reviewers: austin, bgamari
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1644


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

7221ad70daa363d77f60d96c3f6e1baa1d9bec81
 compiler/main/DynFlags.hs | 2 ++
 compiler/main/Packages.hs | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 5b16bd6..e443926 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -973,6 +973,8 @@ versionedAppDir :: DynFlags -> IO FilePath
 versionedAppDir dflags = do
   appdir <- getAppUserDataDirectory (programName dflags)
   return $ appdir </> (TARGET_ARCH ++ '-':TARGET_OS ++ '-':projectVersion dflags)
+  -- NB: This functionality is reimplemented in Cabal, so if you
+  -- change it, be sure to update Cabal.
 
 -- | The target code type of the compilation (if any).
 --
diff --git a/compiler/main/Packages.hs b/compiler/main/Packages.hs
index 8d0f2a6..a26b275 100644
--- a/compiler/main/Packages.hs
+++ b/compiler/main/Packages.hs
@@ -378,6 +378,9 @@ getPackageConfRefs dflags = do
 
 resolvePackageConfig :: DynFlags -> PkgConfRef -> IO (Maybe FilePath)
 resolvePackageConfig dflags GlobalPkgConf = return $ Just (systemPackageConfig dflags)
+-- NB: This logic is reimplemented in Cabal, so if you change it,
+-- make sure you update Cabal.  (Or, better yet, dump it in the
+-- compiler info so Cabal can use the info.)
 resolvePackageConfig dflags UserPkgConf = handleIO (\_ -> return Nothing) $ do
   dir <- versionedAppDir dflags
   let pkgconf = dir </> "package.conf.d"



More information about the ghc-commits mailing list